“Why are the EA backtest results different from the real (live) market results?” - page 2

 

Coding a profitable EA that backtests accurately can be somewhat straightforward, albeit not super easy. Example: Create a smoothed custom chart with its own OHLC bars and then 🥁🥁🥁... backtest on that OHLC data.🔔

Of course, you still need to determine your profitable hours, days, weeks, and/or months to trade; stoploss; trailing stoploss, dynamic exit, and/or takeprofit; news events to trade or news events to avoid; etc.

If spreads, commissions, and/or swaps are "killing" your strategy, then either your OHLC bars are too small or your logic/concept was junk from the get-go.

And finally, to each her/his own in this wide world of trading. There is no universal trading style for everyone.

 
Ryan L Johnson #:

Coding a profitable EA that backtests accurately can be somewhat straightforward, albeit not super easy. Example: Create a smoothed custom chart with its own OHLC bars and then 🥁🥁🥁... backtest on that OHLC data.🔔

Of course, you still need to determine your profitable hours, days, weeks, and/or months to trade; stoploss; trailing stoploss, dynamic exit, and/or takeprofit; news events to trade or news events to avoid; etc.

If spreads, commissions, and/or swaps are "killing" your strategy, then either your OHLC bars are too small or your logic/concept was junk from the get-go.

And finally, to each her/his own in this wide world of trading. There is no universal trading style for everyone.

One more thing that I forgot to say which may not be obvious to everyone...

To use the above method, your EA should send its orders upon bar close. This serves 2 purposes:

  1. Sending orders at high or low prices is self-defeating for smoothing purposes. Remember that the idea is to make the close prices in your custom chart and the Tester align to a T (more accurately, a C). 😉
  2. While different broker-dealers will likely have slightly different price data, the close prices of a smoothed custom chart will likely remain more universal among broker-dealers because the broker-dealer's source data is reduced to a "tick farm."
 
Ryan L Johnson #:

One more thing that I forgot to say which may not be obvious to everyone...

To use the above method, your EA should send its orders upon bar close. This serves 2 purposes:

  1. Sending orders at high or low prices is self-defeating for smoothing purposes. Remember that the idea is to make the close prices in your custom chart and the Tester align to a T (more accurately, a C). 😉
  2. While different broker-dealers will likely have slightly different price data, the close prices of a smoothed custom chart will likely remain more universal among broker-dealers because the broker-dealer's source data is reduced to a "tick farm."
“I’m already using bar-close execution, but the discrepancy is still significant.”
 
Muhammad Nurrochim #:
“I’m already using bar-close execution, but the discrepancy is still significant.”
What kind of custom chart did you create?
 
Muhammad Nurrochim #:
“I’m already using bar-close execution, but the discrepancy is still significant.”

In your backtest, when it has placed the deal that has crashed it, was it at the same time, same openprice, same account balance, same leverage, same everything than in your real account ? I doubt it was : difficult to reproduce exactly. 

You'd better work on a way to avoid those margin crash, for now you had luck on your real account.