Strategy Tester doesn't match reality

 

I am a neophyte in MQL programming and have been trying to develop my own EA.

It has a pretty good performance on Strategy Tester, but loses money when it goes live.

This week was the ultimate test. I left it running for the whole week in a demo account and it lost money consistently, every day, every hour. But then I run it against the same week as historical data on Strategy Tester and the exact same EA has very good performance in the simulation.

Why does that happen? Is Strategy Tester that useless?

 
whoowl:

I am a neophyte in MQL programming and have been trying to develop my own EA.

It has a pretty good performance on Strategy Tester, but loses money when it goes live.

This week was the ultimate test. I left it running for the whole week in a demo account and it lost money consistently, every day, every hour. But then I run it against the same week as historical data on Strategy Tester and the exact same EA has very good performance in the simulation.

Why does that happen? Is Strategy Tester that useless?

mt5 tester more reliable than mt4 

which one you use?

 
whoowl:

I am a neophyte in MQL programming and have been trying to develop my own EA.

It has a pretty good performance on Strategy Tester, but loses money when it goes live.

This week was the ultimate test. I left it running for the whole week in a demo account and it lost money consistently, every day, every hour. But then I run it against the same week as historical data on Strategy Tester and the exact same EA has very good performance in the simulation.

Why does that happen? Is Strategy Tester that useless?

So, you run EA through the tester and got extremely super deluxe wonderful results?

And then, this week you run your expert advisor on completely different prices and spreads and you are equally surprised that you did not get results same as those on the tester?


Did you check that trades EA opened on the demo account follow your strategy?  

If not - fix your EA.

If so - your strategy sucks and probably will not make you money. Fix your strategy. Does you strategy take into account spreads, trade execution timing, slippage, commissions and swaps?


Every EA can be tweaked to produce "good results" on strategy tester. Because you know where the price was.

Use strategy tester to verify that your EA executes trades according to your strategy. That's what the tester is good for. 

 
Drazen Penic:

So, you run EA through the tester and got extremely super deluxe wonderful results?

And then, this week you run your expert advisor on completely different prices and spreads and you are equally surprised that you did not get results same as those on the tester?


Please pay attention.

"...then I run it against the same week as historical data..."

THE SAME WEEK

The EA ran for four days in real time on a demo account and lost money.

Then I ran it on Strategy Tester selecting those exact same four days  as historical data and made a good profit.

Same period, very different results.
 
Ahmet Metin Yilmaz:

mt5 tester more reliable than mt4 

which one you use?

MT4.
 
whoowl:
MT4.

so, It depends on your codes ( It doesnt means your codes wrong or bad ) and your platform's historical datas.

 
whoowl:

Is Strategy Tester that useless?

Yes.

Please try MT5.

 
My code is MQL4. It won't run on MT5.
 
whoowl:
My code is MQL4. It won't run on MT5.

So recode it into MQl5.

 
whoowl:

Please pay attention.

"...then I run it against the same week as historical data..."

THE SAME WEEK

The EA ran for four days in real time on a demo account and lost money.

Then I ran it on Strategy Tester selecting those exact same four days  as historical data and made a good profit.

Same period, very different results.


MT4 does not keep ticks in the database. Tester generates them based on bar OHLC when required. Algorithm is not published. 

So, again:

Did you check that trades EA opened on the demo account follow your strategy?  

If not - fix your EA.

If so - your strategy sucks and probably will not make you money. Fix your strategy. 


Result you got: 

- if price action repeats, great - you'll make money (but then you don't need an EA)

- if price action changes, your account is fried

 
Drazen Penic:


MT4 does not keep ticks in the database. Tester generates them based on bar OHLC when required.

Algorithm is not published. 

The Algorithm is well known see Here.

The Algorithm of Ticks' Generation within the Strategy Tester of the MetaTrader 5 Terminal
The Algorithm of Ticks' Generation within the Strategy Tester of the MetaTrader 5 Terminal
  • www.mql5.com
The MetaTrader 5 terminal contains an integrated development environment for the development of fully automated strategies (trading robots), which can perform trading without any human intervention. Another name for these trading robots is Expert Advisors. Expert Advisors and technical indicators for the MetaTrader 5 terminal are written using...
Reason: