Strategy testing vs reality.

 

Greetings everybody!

I have been working on a meta trader 4 trading bot for a while. When tuned all the algorithms and parameters I get a impressive results as shown below in the screen capture. 

Trading bot progression increase

This is for the time period Jan 1st 2024 to Today (14 Mar 2024). It gives similar results for any time period. My next step was running a few demo accounts with the same algorithm. Now I'm running this for 4 days and having positive results. So I invested in a real account yesterday and I was watching the behaviour. It's the same bot and it makes decisions in demo account. but not in real account.Any one has a clue why this is happening? 

 
Herath Mudiyanselage Yasitha Naveendra Herath:
It's the same bot and it makes decisions in demo account. but not in real account

Fix your bot.
Besides, there is something well-known which is related to MT4:

Forum on trading, automated trading systems and testing trading strategies

entry price in ea backtesting different from live trades why

Sergey Golubev, 2021.12.08 18:53

Entry price in live trading may be different from the backtesting results in the following cases:

  • your EA is for MT4 (and it is almost always different; if not so it is the subject to the discussion on the way to the following: "which special technique do you use to be the same ...");
  • bug in your code;
  • martingale/hedging - it depends on the many factors, such as the following: number of ticks used, time/hours/min to be started to trade, data quality provided, and some more.
  • more.

Testing trading strategies on real ticks and the explanation is on this post


More in post

----------------------

Many traders are converting their EAs to MT5 (from MT4/mql4 to MT5/mql5) just to backtest EAs with "every tick based on real ticks" to use the broker's data to backtest EA.

Testing trading strategies on real ticks and the explanation is on this post

Why results are different from mt4 to mt5
Why results are different from mt4 to mt5
  • 2021.11.08
  • jaderogwin
  • www.mql5.com
Hi all, I've been using mt4 to run back testing on EA's for a while now...
 
I am moving your thread to MT4/MQL5 section of the forum.
 
Sergey Golubev #:

Fix your bot.
Besides, there is something well-known which is related to MT4:


More in post

----------------------

Many traders are converting their EAs to MT5 (from MT4/mql4 to MT5/mql5) just to backtest EAs with "every tick based on real ticks" to use the broker's data to backtest EA.

Testing trading strategies on real ticks and the explanation is on this post

Thank you so much for you valuable comment. I would look in to MT5 as well. At the moment I did all work in MT4. 

Cheers! 

 
Herath Mudiyanselage Yasitha Naveendra Herath #:

Thank you so much for you valuable comment. I would look in to MT5 as well. At the moment I did all work in MT4. 

Cheers! 

unless you post your code, then we can only make guesses as to reason why. But coding an ea to be used in strategy tester and trading live -- is often different. Everyone hopes that their code that works in strategy tester will also work in live account, however, that rarely works out that way. testing an ea in strategy tester is primarily to see if your code works, and to detect any errors or obvious issues with the strategy. 99% of backtests are misleading because they only show what the balance and equity was when a trade opened or when it is closed. A backtest chart/graph rarely shows what that balance and equity was when that trade was at 1 hour or 2 hours after the trade was first opened.

 
Michael Charles Schefe #:

unless you post your code, then we can only make guesses as to reason why. But coding an ea to be used in strategy tester and trading live -- is often different. Everyone hopes that their code that works in strategy tester will also work in live account, however, that rarely works out that way. testing an ea in strategy tester is primarily to see if your code works, and to detect any errors or obvious issues with the strategy. 99% of backtests are misleading because they only show what the balance and equity was when a trade opened or when it is closed. A backtest chart/graph rarely shows what that balance and equity was when that trade was at 1 hour or 2 hours after the trade was first opened.

Hello Michael, Thank you for the advice, I made some changes and now it is working in the live account. Still only running for a few hours, but its in the profit side as expected. Need to wait for a few days to get an accurate result overall.Hope it would work as I expect :)

misleading because they only show what the balance and equity was when a trade opened or when it is closed
This is different in my approach because In my strategy its only one trade at a time. In the graph no hidden open trades in the lost side. Cheers!
 
Herath Mudiyanselage Yasitha Naveendra Herath #:

Hello Michael, Thank you for the advice, I made some changes and now it is working in the live account. Still only running for a few hours, but its in the profit side as expected. Need to wait for a few days to get an accurate result overall.Hope it would work as I expect :)

This is different in my approach because In my strategy its only one trade at a time. In the graph no hidden open trades in the lost side. Cheers!

whether it be only 1 trade open, or 100 trades being open, the issue i mention is the same.

 
Herath Mudiyanselage Yasitha Naveendra Herath:

Greetings everybody!

I have been working on a meta trader 4 trading bot for a while. When tuned all the algorithms and parameters I get a impressive results as shown below in the screen capture. 

This is for the time period Jan 1st 2024 to Today (14 Mar 2024). It gives similar results for any time period. My next step was running a few demo accounts with the same algorithm. Now I'm running this for 4 days and having positive results. So I invested in a real account yesterday and I was watching the behaviour. It's the same bot and it makes decisions in demo account. but not in real account.Any one has a clue why this is happening? 

You should see how often Your EA is supposed to trade based on Your back test results. BTW It looks to have too few trades to be statistically robust.

Reason: