Download MetaTrader 5

What are the differences between backtest and forward test?

To add comments, please log in or register
Yourock Acrew
74
Yourock Acrew  

Hi guys,


I have created an EA and backtest satisfied my criteria. However, in terms of stability of the EA, I don't think it's quite reliable since I don't use deviation at the moment.

Now I started a forward test but it will take me several months before I can compare results.


So my questions for now are:

1. How different could be results between back and forward tests?

2. What is the importance of the deviation and why do we need it (or don't)?

3. I tried to handle any error messages in every possible place of my code. Is there any other concerns that I should be aware of? 


Thanks for the brainstorm,

Yourock.

Rogerio Figurelli
Moderator
41842
Rogerio Figurelli  
Yourock:

Hi guys,


I have created an EA and backtest satisfied my criteria. However, in terms of stability of the EA, I don't think it's quite reliable since I don't use deviation at the moment.

Now I started a forward test but it will take me several months before I can compare results.


So my questions for now are:

1. How different could be results between back and forward tests?

2. What is the importance of the deviation and why do we need it (or don't)?

3. I tried to handle any error messages in every possible place of my code. Is there any other concerns that I should be aware of? 


Thanks for the brainstorm,

Yourock.

Yourock, good point, my answers to your questions are (for sure, my personal point of view):

1. How different could be results between back and forward tests?

No limit here, it depends on future market conditions compared to your backtesting period and market data you use against your broker market data.

2. What is the importance of the deviation and why do we need it (or don't)?

Backtesting it's nice to adjust your strategy but just forward testing will double check if this strategy is future proof.

3. I tried to handle any error messages in every possible place of my code. Is there any other concerns that I should be aware of?  

This is another good utility of backtesting, but be aware because forward test can repeat or  bring different messages.

Hope this information can help you. 

Yourock Acrew
74
Yourock Acrew  
figurelli:

Yourock, good point, my answers to your questions are (for sure, my personal point of view):

1. How different could be results between back and forward tests?

No limit here, it depends on future market conditions compared to your backtesting period and market data you use against your broker market data.

2. What is the importance of the deviation and why do we need it (or don't)?

Backtesting it's nice to adjust your strategy but just forward testing will double check if this strategy is future proof.

3. I tried to handle any error messages in every possible place of my code. Is there any other concerns that I should be aware of?  

This is another good utility of backtesting, but be aware because forward test can repeat or  bring different messages.

Hope this information can help you. 

Thanks for the response! Yeah, I want to make sure everything goes smoothly with my EA before I can run it on a real account.

In terms of slippage: does backtesting incorporate it? It would be nice if it is.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Account Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Account Properties - Documentation on MQL5
Rogerio Figurelli
Moderator
41842
Rogerio Figurelli  
Yourock:

Thanks for the response! Yeah, I want to make sure everything goes smoothly with my EA before I can run it on a real account.

In terms of slippage: does backtesting incorporate it? It would be nice if it is.

You are welcome, note that slippage is an order parameter but real orders latency of your broker is something that just forward testing can check.

Another suggestion is separate forward test in three stages: demo account (play money), real account (micro lot) and real account (leverage lot). 

Anyway, a black swan, that your money and risk management are not ready to face, can just happen in the third stage, if you are unlucky! 

By the way, I think these three stages are very useful also for testing trading signals. 

Yourock Acrew
74
Yourock Acrew  
figurelli:

You are welcome, note that slippage is an order parameter but real orders latency of your broker is something that just forward testing can check.

Another suggestion is separate forward test in three stages: demo account (play money), real account (micro lot) and real account (leverage lot). 

Anyway, a black swan, that your money and risk management are not ready to face, can just happen in the third stage, if you are unlucky! 

By the way, I think these three stages are very useful also for testing trading signals. 

That is a very good suggestion! I will employ it. For now, I will run a test with a little slippage on demo for a couple of month and then will run the same test on historical data to compare the difference. Then will go for a micro lot.

Thanks a lot!

Rogerio Figurelli
Moderator
41842
Rogerio Figurelli  
Yourock:

That is a very good suggestion! I will employ it. For now, I will run a test with a little slippage on demo for a couple of month and then will run the same test on historical data to compare the difference. Then will go for a micro lot.

Thanks a lot!

So, if possible, give us a feedback about this methodology. Thanks.
Yourock Acrew
74
Yourock Acrew  
figurelli:
So, if possible, give us a feedback about this methodology. Thanks.
I surely will write an article about it!
Alain Verleyen
Moderator
32376
Alain Verleyen  
Yourock:

Thanks for the response! Yeah, I want to make sure everything goes smoothly with my EA before I can run it on a real account.

In terms of slippage: does backtesting incorporate it? It would be nice if it is.

You can use the Random Delay execution mode when backtesting.
Yourock Acrew
74
Yourock Acrew  
angevoyageur:
You can use the Random Delay execution mode when backtesting.
Thanks! Tried it 10 minutes ago - my profits are down in half :D I like it, brings me back to Earth :)
Dua Yong Rew
5475
Dua Yong Rew  

1. How different could be results between back and forward tests?

Volume, slippage, delay

Simon Gniadkowski
Moderator
18023
Simon Gniadkowski  
Yourock:

Hi guys,

I have created an EA and backtest satisfied my criteria. However, in terms of stability of the EA, I don't think it's quite reliable since I don't use deviation at the moment.

Now I started a forward test but it will take me several months before I can compare results.

Bear in mind that once a Forward test is completed it is effectively a real time Backtest. A Forward test of 2 months is no more accurate at telling you how your EA will perform during the following 2 months than a 2 month Backtest.

If you really have an EA that can predict the market,  and this is what all EAs are designed to do,  then it will show consistency from month to month during a long Backtest of several years. 

12
To add comments, please log in or register