Posted this originally in the beginner section but looking for more clarity. When building an EA it seems that one strategy will not work on all pairs (if it did we would all be printing money with one good strategy). I have found one that works on several pairs it buys off of only price action. But in order for it to be reasonably profitable (4% per month per pair) it has to have SL, TP, and TS optimized by each pair. I am about to run them forward on a demo account and will be happy to share the results. But can anyone tell me does this look like over optimization?
Hey Mike… I could type a few pages to answer this question…
All pairs have their own characteristics, volatility, average true range and correlation with other pairs.
Eg: GBPUSD moves large pips, a high ATR and can be very volatile due to the USD. It is also a good pair for trading because of low spread and it’s large moves. You can throw a Buy and a Sell (7-10 pips) at this pair at the same time and you will find that 90% of the time both trades will close with a profit.
Then you have the EURGBP, this pair generally has a low ATR, ranges most of the time… so the parameter settings for a Bot on this pair would be a lot tighter (smaller TP and SL) than the GBPUSD as described above.
This is what automated optimization will show you. As you run it for each pair over a similar point in time… say 3 months you will see the best parameters vary with every test…
Calgo Backtest (2 Day B/Test on the GBPUSD 5min Chart) Negatives…Massive Drawdown… Unstomachable Margin, so not code that is usable in reality… but great results…
It’s just to show how you can see the weakness of your logic in a backtest and alter the code to correct the issues before every releasing it onto a Demo…or God forbid a Live account.
You need to find an automated backtesting program to get the fastest, quality results from tick data…
Thank you! So that would not be curve fitting its simply optimizing the strategy for each pair. I do my backtest on MT4 is that not an accurate enough software?
No, but markets are always changing, and so parameters will require constant tweaking… the settings that are making a profit today are going to be slightly different to what is making a profit next week and so on…
I only backtest a week, a month, 3 months at a time… why you would B/Test over 3 years is beyond me because the spread, the pair, the market, the broker would have been so variable over that 3 year period…
I have never backtested with MT4 Software, so I’m not the one to ask… maybe others here, watching on can answer…
The image above is taken today from Ctrader Calgo which has a lot of great features for coding support. As you can see the feedback from a backtest is very comprehensive and makes it easier to improve code, logic and parameters.
The main drawback with Calgo is the API used is very limited and MT4’s API has a much greater range of features.
Perhaps the problem is even worse than over-optimisation plus the on-going need for continuous monitoring of market behaviour and tweaking of your SL, TP and TS conditions accordingly, for every pair traded.
It sounds like the strategy will use a fixed-pip SL, TP and TS. Can the fixed-pip approach really be considered optimum for trading at all? Fixed pip TP and TS will inevitably lead to early exits from winning trades and a failure to pyramid these to maximise returns at no additional risk. Fixed pip SL’s could possibly exit you from losers too late but are more likely to be relatively tight, so that you are stopped out of trades on a random basis, simply owing to volatility.
Exits pay the bills, and these (and other EA) exits might be expected to be random.
Hey Tom… Stops, Take Profits and Pending orders can be programmed to be moved by a Bot, even while positions are open, It’s just hard to make it think strategically like a carbon based trader. Price action is so random that it is impossible to cater for every session and every pair.
The backtested Bot above uses some of this logic to close losses when smallest and move pending orders ahead of the trend, while an existing position is increasing in profit…and it can do it for hours at a time…so it can be done. Even adding to open positions can be coded.
It just depends on how good the programmer is too how profitable the logic turns out to be. I am only 12mths into coding my own scripts and I have seen some unbelievably sophisticated Bots produced by other traders turned programmers.
Your trading technique of letting the trades run and pyramiding on the trends is very profitable… I’m working on a Bot that just uses a TSL…no TP to get a greater pip take on the trends… the hard part is getting the logic to reliably adjust the TSL distance to match changing volatility…
It’s best to make EA for a single pair. Well it may work for other pair also but not always. For few times some pair behave in the same way. But every pair is different from each other. All pairs have their own distinctive characteristics.
You might have a look at MT5 as it will allow you to have more than one pair in an ea. This is good for robustness. It is superior to MT4 in many ways.
Eventually you will have to learn MT5 as MT4 is no longer going to be supported.