Originally Posted by Harro26
How is it going Harro. Although limited in AFL experience I have been testing various strategies from year 2000 and I thought your long only trading results are unrealistic due to the limp market conditions from 2000 to 2003 and the global market declines from 2007 to 2009 in which few stocks escaped. This would mean a large chunk of time "out" of the market. How is your strategy going since 1/1/2010?
Testing all ASX fully paid ordinary shares since 2000:
Profit - 600% (Compared with the XAO's 47% rise), outperforms 100% of the time
I also have been working over various trend trading strategies and one thing that is evident with your 15/40 MA is the lag. That is the market has tanked well before the MA15 swings below the MA 40 which signifies not to open long positions. Additionally there are many times when the cross below is brief yet the market had declined to most of its extreme before this. That means long trades are still being opened on the decline due to the lag.
My strategy is a trend trading strategy (Long only at this time), I won't give away the exact system but I will give you the high points. My software of choice is Amibroker (With data from premium data) so the code I quote is for this.
In my testing, that index filter will not produce above average results.
Have you considered using the Correlation function? I had improved results using position score with it. Though I know what correlation means, the explanation in AMI.'s Help suggests correlation between two arrays. That being the Index Close and the Stock Close for the period of 20.
Note that the correlation may be declining also and that is why I implemented a LinRegSlope ...
Index = Foreign("^AORD", "C", True);
PositionScore = Correlation(Index, C, 20);
Index advancing and stock correlation worth investing time on I think.
Index = Foreign("^AORD", "C", True);
Slope = LinRegSlope(Index, 40) > 0;
Again here if one is in a long position then that is capital effectively out of the system until closed and (hopefully) after a while at a large profit. It is only through these infrequent outliers that a 40 - 45% ratio makes the strategy worth pursuing. Noting that 40 to 60% win/loss, loss/win is the typical range.
PositionSize = -10;
A trend trading strategy will not neccessarily give you a greater than 50% win/loss ratio (Mine gives about 40-45%) so the idea of trend trading is to let your wins go and cut your losses short, 10 stocks allows you to do this.
I agree with Howard that ranking the group with a higher order. Otherwise when it comes to the real thing we don't know which are the best statistical choices. Would you run the 5 stock selections through the psuedo Monte Carlo optimiser to see which one drew the highest results or maybe you use a discretionary fundamental approach in present day testing.
2. Position score - Set this to random
For those not familiar with Amibroker this makes it enter trades randomly, i.e. if on a given day you have enough funds to enter 2 trades but you get 5 buy signals it will choose these at random (If it is not set to random it enters them alphabetically). Each time you hit backtest you will get a different result.
A trap for absolute beginner EOD strategy developers.
3. Trade delays - It is crucial to get this right.
. I do intraday trading so I get my signals at night and enter buy/sell signals the next day. If doing Intraday trading set your trade delays as follows:
An simple example of setting these incorrectly is as follows:
Buy = Close>open;
Sell = Close>open;
If you trade this with no trade delays you will get amazing results but obviously this is unrealistic.
Excellent point, excellent. One of the reasons why real time results don't reflect tested results. No two events are replicated and adjusted data smooths out real time stock gyrations.
4. Don't let your backtest results be biased by suvivorism/indexes - The best way to do this is to backtest historical share/index data including delisted stocks, I haven't been able to obtain historical index data (ASX 200 etc.) So I only backtest all Fully paid ordinary shares and delisted stocks. The bottom line is don't backtest the current day ASX200 as this will bias your results (Obviously stocks have done well in the past to get into thew ASX 200).
When carried out to the letter then when to get in and when to get out "should" be mechanical. One thing I have trouble with is overriding the tested rules. Optimistic and pessimistic need not be involved but they are forever gnawing away.
5. Trade with the market - Let the market drive your trades (Long/Short how much money to have in at a time etc.). Nobody knows where the market is heading, for every so called expert telling you the market is about to go gangbusters there is one telling you it is about to tank.
Easy to cheat on back testing with this one. As I mentioned elsewhere we are buying a piece of the whole days traded volume which will differ significantly at market and trade open in the morning.
6. Ensure the stock has enough volume for you to enter - Again this will bias your results, if you try to buy $50000 of a stock that only had $10000 of volume traded you will have to pay a premium for this. Ensure the stock has 5-10 times the average volume traded that you are looking to buy. Use the recent moving average of volume for this, for example if we are buying $10000 per trade set it as follows:
You have to admit though that those smooth rising equity curves are easier on the eye than the jagged goat trodden hills.
9. Optimization - It is easy to over optimize a system. Optimization is a good thing as you have to set your paramaters to something. To prevent over optimization ensure that the value for your buy/sell paramaters can be changed to sensible values and it will still outperform the market. If your system only works with a specific set of numbers it is probably over optimized.
And quite a difference that makes. The S&P 500 has predominantly higher dollar per share stocks than the Oz market. This factor alone produces radically different results.
10. Backtest against foreign markets - I forked out for the US data also for this purpose. Ensure your strategy outperforms in these markets also.
Thanks for the read. Back to chasing my tail again now.