Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I've been playing around with backtesting a very basic approach for forex. I ran through 3 years of daily prices for USDJPY using the following types of things:
Close at 5 day high AND
6 SMA above 12 SMA AND
12 SMA is higher than it was 6 days ago
Enter long at the "open" the next day
Stop loss is the LOW of the previous day
Exit when a new 2 day low is reached (exit at the open of the following day).
I ran through transaction by transaction for 3 years. Arrived at a positive result (sort of). I'm not looking for feedback on the rules; as I believe that there are many different ways to do this.
What I'm wondering though is, what other steps to backtest this should I take? What other things do I need to test or evaluate?
Any specific points that I should consider (I also tried to see the range of results if I used slightly diff parameters)
Can you help answer these questions from other members on NexusFi?
I think I won't be alone in wondering what "sort of" means?
Drawdown.
Also dealing-costs, spread, slippage, statistical significance, profit factor (are the ones that spring to mind), especially when looking back at theoretical trades: it's easy to imagine that you could have entered and exited trades at prices which you might not achieve in reality, in a live account.
I don't mean to sound disparaging, but this isn't one I'd backtest, myself.
Did you use software to do this test? Be very careful if you did it manually, as manual backtests can be very inaccurate.
How many versions of this system did you test before you arrived at this particular one? If you tried 100 versions (different values for moving avg lengths, etc), I'd certainly trust it less than if you only tested one version of it.
Apart from the good replies above, I would also be asking, on what basis did you pick those entry and exit conditions?
Entry and exit conditions should be based on sound statistical reasons (mean reversion standard deviations, momentum trend SDs, anomalies due to institutional trading such as fund rebalancing or investment etc), so if you just pulled those entry conditions out of the air because it looked alright on paper I would be very suspicious (and careful) overall. An edge needs to be grounded in a solid reason as to why it exists, if you simply data mined the "edge" (by coming up with a random theory then optimising it), it is certainly a curve fit.
The steps you should take in a back test, each step should show positive expectancy and each step should increase expectancy.
1. Test the entry with a fixed time exit (end of the day, 1 day, 2 days, whatever).
2. Test the exit with the entry and variable target
3. Test exit with variable time stop (if your losing trades are longer in duration than winning, this is often the case)
4. Test exit with variable stop loss
5. Test scale in / scale out
6. Look at entry times and consider optimal entry times as the market can behave differently at different hours of the day
Test your optimised algo on out of sample data. If it doesn't blow up you are probably on to something.
Your equity curve should be smooth, and winners should not be clustered too much. Additionally, check for DD duration and that it is within your tolerance. Whatever you think your tolerance is, reduce it by 50% - everyone always over estimates how tolerant they are until real money comes into play.
Thanks for the excellent feedback and advice. I'll look into incorporating those thoughts.
What I did was run a macro in Excel to automatically determine which transactions would occur. I did use the opening price of the next day as the entry; so there will need to be adjustments for the spread, slippage on stops, etc.
I'm not really looking to trade this though. It was more for the purposes of thinking, learning and seeing the outcomes of different approaches. I was trying to understand how a very simple approach would perform. One that really just looks at whether prices are moving up or down, goes in the direction of the trend and has consistent simple rules for entry / exit.
From watching the price for about 1yr, I suspected that there was some benefit of a 5 day vs. 2 day move; and a short period SMA. So just tested my theory.
For those interested, I did run this from January 1, 2013 to December 7th 2015. On the LONG and SHORT side (basically reversing the rules for the SHORTS).
There were a total of 101 transactions during this time.
For the 62 LONG transactions, 26 WINS, 36 LOSSES, Avg Win 0.8699 Avg Loss 0.4268
For the 39 SHORT transactions, 13 WINS, 26 LOSSES, Avg Win 0.94808 Avg Loss 0.37106
Not spectacular. Over the total period, it worked out to about 993 pips total. That's why I said it was "sort of" profitable. After factoring in slippage, commissions, I suspect its not worth the effort.
I also wanted to see if it was a fluke; so tested using different periods for the longer and shorter SMA (e.g. 3v12, 3v6, 3v9, etc.). The length of the SMA wasn't really a factor. The results were roughly similar.
I also tried it without any SMA rule at all, and as one would expect...that had poor results (as it basically had no filter for following the trend).
Anyways, it's a long way to go before this becomes any sort of real strategy. However, I did learn alot from doing it. Thanks everyone!!!
I would think this must be right, if the figures above are without any allowance for dealing-costs and slippage.
Yes; any other conclusion would be surprising indeed, even on rather a small sample-size. Still, I can completely understand the "education value" of the exercise.