Thanks all of your feedback and advice.
LlewelynJames,
Can you please elaborate on " 60 day historical volatility of the stock that you are trading is less than 40. Ã..
Since reading all the post i have been using the SMA usually 20 and a 50 as a filter. Look at stocks which above both SMAs and its been showing me better setup.
Really appreciate all the feedback and advice.
Thanks
Hi Buwa84.
In Amibroker 60 day historical volatility is written as:
//60 day Volatility//
HV = StDev(ln(Close/Ref(Close,-1)), 60)*100*sqrt(252);
To illustrate I have run some tests for you...the following strategy was tested on all of the stocks that currently populate the NYSE. Test runs between 01/01/2004 and 28/02/13.
As i mentioned in an earlier post, big volume, HV filter and market environment filter can be combined for nice results. To answer another earlier question...I have added a rule that only trades breakouts when the volume is at least 3 times greater than the 20 day Volume average.
1) The market environment filter can prevent buying during bear markets or when the borad markets are already overbought.
2) The HV filter and large breakout volume are one way of coding a stock that has been relatively benign and then BOOMSHAKKALAKA, we have a sudden jump in volume as well as new highs.
I wouldn't trade the system, but it should illustrate that filters can greatly enhance the breakout performance.
50 open positions were allowed at a time, so the sample of breakouts we are testing is significant. All breakouts were held for 10 days. Tests will show us the average 10 day % gain/loss of all breakout positions entered.
Note that I have included a market environment filter by stipulating that breakout signals are only valid if the SPY has a 20 day MA above a 50 day MA and a RSI that isn't already overbought.
The example strategy is:
///////////////////////////////////////////////////////////
SetOption ("MaxOpenPositions" , 50 );
SetPositionSize (2, spsPercentOfEquity );
Index = Foreign ("SPY","C",True);
Indexfastma = MA (Index,20);
Indexslowma = MA (Index,50);
RSIlength = 8;
HV = StDev(ln(Close/Ref(Close,-1)), 60)*100*sqrt(252);
VolVAl= 40;
INDEXRSI = RSIa(Index,RSIlength);
Buy = Close > 5
AND Volume > 3 * MA( Volume , 20 ) //test with&without this line//
AND MA(Volume,20) > 100000
AND Indexfastma > Indexslowma
AND HV < Volval //test with&without this line//
AND MA( Close , 40 ) > MA( Close , 120 )
AND C>Ref(HHV(H,40),-1)
AND IndexRSI < 65;
Sell = 0;
ApplyStop (stopTypeNBar,stopModeBars,10,0,False,3)
PS=Optimize("position score",1,1,50,1);
PositionScore = Random()*PS;
//////////////////////////////////////////////////////////////////
Average 10 day return without HV and 3 * VolumeMA filters = 0.07%
Average 10 day return with HV and 3 * VolumeMA filters = 0.18%
Finally, when keeping our HV and Volume filters but ignoring our market environment filter. E.G.
////////////////////////////////////////////////
Buy = Close > 5
AND Volume > 3 * MA( Volume , 20 )
AND MA(Volume,20) > 100000
AND HV < Volval
AND MA( Close , 40 ) > MA( Close , 120 )
AND C>Ref(HHV(H,40),-1);
//////////////////////////////////////////////
We have have these results...
Average 10 day return with no market environment filter = (-0.01)%
If you intend on trading stocks as part of a trend following strategy, a market environment filter is the best filter you can add in my opinion.
Also be conscious that barely 50% of breakouts in these tests were profitable, regardless of the filter employed.
Hope this helps.
Regards,
Llewelyn