Hedging Faults - Fine in Backtest, Weird in Forward Testing
-
Hi Everyone, I'm hoping a wise fxdreema out there can help me with an issue I'm having.
So on a demo account I've recently started forward testing an EA I made that hedges. As a quick overview, if there is only 1 trade, it waits for that trade to hit X-pips profit and then closes, simple. If that trade goes into Y-pips loss, it places a trade of the opposite kind. It then waits for price to exceed the last buy or sell by Z-pips and then places another trade of that kind. It continues in this way until the profit from one 'side' (buy or sells) exceeds the loss of the other by a certain amount and then closes everything, leaving it clear to open another single trade and the system effectively restarts.
It works great in backtesting, I've tried it on lots of different markets and timeframes and it always performs well but I've had it on forward testing for a couple of weeks now and it's not functioning the way it should, it doesn't place hedging trades when it should, it enters hedging trades randomly in the middle of existing hedges, its crazy! I've rebuilt the system in a couple of different ways, e.g. instead of using 'pips away from' blocks I tried making it draw a horizontal line and then wait for market price to cross over/below that, but still coming up with the same issues.
What I don't get is why it works perfectly in backtesting but then goes haywire on forward testing! To be clear its not a performance/profitability issue I'm running into, its the fact that it seems to stop following the same rules and conditions when I put it on 'live' market data. Like I say I've backtested thoroughly, for 14 years on some pairs, so there is no way this fault can be occurring in the tests otherwise it would wipe out any account very quickly, its just on the forward testing.
Has anyone come across this kind of thing before? Weird behaviour where an EA works just how its intended in back tests but then is all over the place on actual markets?
I did notice most of the issues seemed to appear on Monday morning when I switched my computer back on after the weekend. I've seen stuff online about people's chart objects vanishing randomly when they come back to their terminal after shutting down the computer, is there possibly some bug in MT4/broker which is causing this?
Any suggestions on fixes that I can try would be much appreciated!
Thanks in advance.
-
It's probably something in the project, I see you are using many Formula blocks and who knows where something fails. But to be honest, I don't even want to know and I don't want to hear that word "hedge". My advice is to forget about hedging in the same symbol. This doesn't work and will never work. Hedging in the same symbol is making the EA too complicated and hard to maintain, with no benefit at all. I guess that there are many people trying to sell this idea to naive people, but hedging is not that magical thing that they sell. Simply close the trade and continue with the real strategy.
-
Thanks for your response and advice. It would still be good to understand why it works in back testing but not on 'live' markets in case I run into it again in the future. If there is a problem with the EA itself why doesn't it appear in visual mode? It bizarre!
-
The Tester is not exactly the same as the real life. There are different ways of testing - "Every tick" is the most accurate, but there are other models where depending on the EA, results can be very different. Also, in the Tester you start with 0 history trades, while in the live account you probably have some history. Some blocks are looking at these closed trades. Also the spread is different, in the Tester it is a fixed value. Just in case, check for any error messages.
-
@tomli said in Hedging Faults - Fine in Backtest, Weird in Forward Testing:
I did notice most of the issues seemed to appear on Monday morning when I switched my computer back on after the weekend. I've seen stuff online about people's chart objects vanishing randomly when they come back to their terminal after shutting down the computer, is there possibly some bug in MT4/broker which is causing this?
If it happens just because you switching off the EA (or computer), that means that EA doesn't remember the last state (stage) of the trading system.
Workaround of this could be a logic where you keep in a global variables every single stage of the trading system.