Can we trust the strategy tester?

 

I'm tested an EA using a VPS for a week. the EA ended up with loses (-30.00$). then I did a back test for same week with same EA and with the same parameters that used to trade on live trading. 

but the strategy tester showed me positive results (+280.00$). The strategy was developed by me. so, the code is very simple and there are no difference modules for the strategy tester and for the live trading. Here are the things were same. 

  • my VPS server ping was around 5ms, so I did the back test on Delay settings for 5ms.
  • I used the same instrument for both back test and live test. also, the broker and the account are also same
  • Trading sessions was also same (because I let the EA to run for the whole day for both back test and live test). 
  • The VPS server was not crashed or stopped. (I checked it)
  • I checked the whole code script line by line but there wasn't any issue with the code script as well.
  • I did back test using "Single" template in strategy tester. There was no other EAs loaded during the live trading period.
  • There was not High Impact news events on that week to cause the volatility to do some slippages as well. 


right now, I'm fully confused with these results.

01. what was the possible reason here?

02. What should I do to fix this? 

03. Did you face the same situation?


 

Yes, we can, but you need to know how to use it. You also need to take into consideration when backtesting lots of variables that may differ when trying the strategy in a real account.


Imagine the following situation: the current price is $9.90. Your EA is programmed to enter a long position when the price hits $10.00. It does hit the entry price, but because the market is absolutely taken by the bulls, it goes way too fast. In this case, you'll probably be affected by slippage, and your entry price will actually be $10.05. These $0.05 may really consume your profit along your trading career. Now, also imagine your take profit was set to be $1.00 above your entry price. You would need to hit $0.05 cents above than you were expecting - and many times the tp will not be hit specifically because of these $0.05.

This can happen every time you open/close a position. The strategy tester may not be the best to simulate this conditions (it may be using real ticks data, but depending on the instrument it can slow down the backtest way too much).


That's just an example of what can happen that make the backtest differ from the real life trading and that's why it's necessary to learn how to interpret and choose the best parameters/settings for your backtest.

The best way to avoid slippage is to improve your code speed so your EA executes exactly when the condition is met. Also, it's easier to match the backtest results if you check if the buy/sell signals to open a position happen when a new bar arrives, thus setting a specific point in time and reducing the impredictability of opening a position in the middle of a bar.


These are examples that you probably need to figure out for yourself, since many conditions may vary according to the backtest settings and to your EA logic (for example, if your EA checks for a condition every tick, it's recommendable for you to use real ticks when testing; if uses the open price or 1 minute ohlc, it's way better if you check the conditions to open positions every new bar).


Take note of when your EA opens new positions and where it closes in the backtests and compare it to the real life trading, identify where it's doing wrong and adjust the backtest to the best options. There'll always be divergences, but you can minimize them.

 
Emanuel Cavalcante Amorim Filho #:

Yes, we can, but you need to know how to use it. You also need to take into consideration when backtesting lots of variables that may differ when trying the strategy in a real account.


Imagine the following situation: the current price is $9.90. Your EA is programmed to enter a long position when the price hits $10.00. It does hit the entry price, but because the market is absolutely taken by the bulls, it goes way too fast. In this case, you'll probably be affected by slippage, and your entry price will actually be $10.05. These $0.05 may really consume your profit along your trading career. Now, also imagine your take profit was set to be $1.00 above your entry price. You would need to hit $0.05 cents above than you were expecting - and many times the tp will not be hit specifically because of these $0.05.

This can happen every time you open/close a position. The strategy tester may not be the best to simulate this conditions (it may be using real ticks data, but depending on the instrument it can slow down the backtest way too much).


That's just an example of what can happen that make the backtest differ from the real life trading and that's why it's necessary to learn how to interpret and choose the best parameters/settings for your backtest.

The best way to avoid slippage is to improve your code speed so your EA executes exactly when the condition is met. Also, it's easier to match the backtest results if you check if the buy/sell signals to open a position happen when a new bar arrives, thus setting a specific point in time and reducing the impredictability of opening a position in the middle of a bar.


These are examples that you probably need to figure out for yourself, since many conditions may vary according to the backtest settings and to your EA logic (for example, if your EA checks for a condition every tick, it's recommendable for you to use real ticks when testing; if uses the open price or 1 minute ohlc, it's way better if you check the conditions to open positions every new bar).


Take note of when your EA opens new positions and where it closes in the backtests and compare it to the real life trading, identify where it's doing wrong and adjust the backtest to the best options. There'll always be divergences, but you can minimize them.

thanks for the reply bro. I'll figure out it. 

 

I'm having the opposite issue. I tested a strat on backtester and gave me negative result. Live it's giving me profits.


I think there are too many variables for a backtest to be worth anything, in my humble opinion. 

Yes it can give you an idea of what's working or not, but take it with a grain of salt. 

Reason: