Searching the internet for Volatility, I found some references to this indicator and decided to code it, adding an average to it:
https://www.realvol.com/VolFormula.htm
https://www.realvol.com/VolatilityFormula2.html
https://www.wallstreetmojo.com/realized-volatility/
https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0102940
I hope its formula has been correctly coded. Should you spot any mistake, please let me know.
If you prefer not to have the MA plotted, you may make it invisible with its properties, once installed in ProBuilder.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
// RealVol - Realized Volatility // // https://www.realvol.com/VolFormula.htm // https://www.realvol.com/VolatilityFormula2.html // https://www.wallstreetmojo.com/realized-volatility/ // https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0102940 // //Periods = 10 //MAperiods = 20 //MAtype = 0 //0=sma, 1=eama, etc... Periods = max(1,min(999,Periods)) MAperiods = max(1,min(999,MAperiods)) MAtype = max(0,min(6,MAtype)) IF BarIndex > 0 THEN R = Log(close) - Log(close[1]) //or Log(close / close[1]) VolReal = Sqrt(summation[Periods](Square(R))) * 100 Avg = Average[MAperiods,MAtype](VolReal) ENDIF RETURN VolReal AS "Realized Volatility",Avg AS "RV Average" |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Grazie Robertogozzi, secondo Te oltre ai setaggi postati, si possono usare altre combinazioni degli stessi,se si quali, di nuovo grazie
Yes, you can use any setting that suits you best!
As to which one… it depends on the instrument traded and the TF used.
You’ll need to test settings thoroughly to tell which are best.
Grazie!
grazie Robnerto