Recently i came across the idea of Historical Volatility, it is developed by Larry Connors.
Historical Volatility
It was mentioned that for mean reversion systems it is better to trade stocks with high HV and for trend following it is better to trade stocks with low HV.
so here is the Amibroker code for the HV, I added two limits upper and lower to be able to short list the stocks as per their HV
Code:
lenPeriod = Param(“HV Periods”,100,10,1000,1);
HV = 100 * StDev(log(C/Ref(C,-1)),lenPeriod) * sqrt(252);
HVUTarget = Param(“HV Upper Target”,500,50,500,10);
HVLTarget = Optimize(“HV Lower Target”,0,0,200,10);
Cond5 = HV <= HVUTarget AND HV >= HVLTarget;
the i ran some tests with different Upper and Lower HV values on two strategies one MRV and the other is Trend Following to verify the statement mentioned above.
here are the results from the tests
first MRV
setting the Lower limit for HV to ZERO and changing the Upper limit value
Then setting the Upper limit to 500 and changing the lower limit for the HV
so from the above snapshots it is clear that high HV give better results for MRV but it is better not to exclude the low HV stocks as well so trade all the range.