Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Historical Volatility for Amibroker (AFL)

Rating:
5 / 5 (Votes 1)
Tags:
amibroker, oscillator

The Rules

Summary of rules as in the article.

Keep track of the daily returns Calculate the 20-day historical volatility of your returns When volatility exceeds 30% and the return over the last three days is negative, exit all positions Restart the strategy when volatility falls below 30% and the return over the last three days is positive.

Each strategy will have a different volatility threshold which one must test for. He also suggests possible using different volatility values in steps 3 & 4 to reduce whipsaws.

Indicator / Formula

Copy & Paste Friendly
// Provided by Cesar Alvarez www.AlvarezQuantTrading.com
// Historical Volatility 
lenPeriod = Param("Periods",100,10,1000,1);

HV = 100 * StDev(log(C/Ref(C,-1)),lenPeriod) * sqrt(252);
Plot(HV, "HV("+lenPeriod+")", ParamColor( "Color", colorRed ), ParamStyle("Style")  );

0 comments

Leave Comment

Please login here to leave a comment.

Back