Why have the difference between real market and backtesting?

 

After my EA is connected to the VPS, there is a certain difference between the order opened in the real market and the backtest of the original strategy the next day. I use the ticks backtest.

Some orders are very accurate,from one second or one point , but some orders are not opened. The VPS I use has a delay of 1ms,  and  the order to open a position is not a time period when the market is running at a high speed.  so the problem of delay can be ruled out.

Does anyone know what might be the reason?

Thank you for you kindness!

Testing trading strategies on real ticks
Testing trading strategies on real ticks
  • www.mql5.com
The article provides the results of testing a simple trading strategy in three modes: "1 minute OHLC", "Every tick" and "Every tick based on real ticks" using actual historical data.
 
Blur Darkness :

After my EA is connected to the VPS, there is a certain difference between the order opened in the real market and the backtest of the original strategy the next day. I use the ticks backtest.

Some orders are very accurate,from one second or one point , but some orders are not opened. The VPS I use has a delay of 1ms,  and  the order to open a position  is not a time period when the market is running at a high speed.  so the problem of delay can be ruled out.

Does anyone know what might be the reason?

Requotes, lack of free funds ...

In general, you must document all attempts to trade operations and the results of the trade operation.

 
Vladimir Karputov #:

Requotes, lack of free funds ...

In general, you must document all attempts to trade operations and the results of the trade operation.

Thank you,but what mean is " lack of free funds  "?

 
Blur Darkness #:

Thank you,but what mean is " lack of free funds  "?

There are not enough free funds on the trading account to open a new position (no money)
 
Vladimir Karputov # :
There are not enough free funds on the trading account to open a new position (no money)

Okay, but that shouldn't be the problem. I'm still testing, extracting tick data on the same day every day, and comparing it with the day before the next day's extraction.

 
Blur Darkness #:

Okay, but that shouldn't be the problem. I'm still testing, extracting tick data on the same day every day, and comparing it with the day before the next day's extraction.

Forum on trading, automated trading systems and testing trading strategies

Why have the difference between real market and backtesting?

Vladimir Karputov, 2022.04.21 09:09

***

In general, you must document all attempts to trade operations and the results of the trade operation.

If you do not have detailed logs, you will never know the exact picture of trading processes. Without detailed logs, you will constantly try to guess something ...
 
Vladimir Karputov # :
If you do not have detailed logs, you will never know the exact picture of trading processes. Without detailed logs, you will constantly try to guess something ...

Thanks for sharing, how should a novice start to build a detailed log in general?

 
Blur Darkness # :

Thanks for sharing, how should a novice start to build a detailed log in general?

1. Checking if the lot size is correct

2. Checking limits on the number of open lots

3. Free Margin Check

4. Checking the result of sending a trade request

5. Analysis of the error.


All this is in the article An attempt at developing an EA constructor and in the 'Trading engine 4' code.

An attempt at developing an EA constructor
An attempt at developing an EA constructor
  • www.mql5.com
In this article, I offer my set of trading functions in the form of a ready-made EA. This method allows getting multiple trading strategies by simply adding indicators and changing inputs.
Reason: