
When conducting robot tests, each of us assumes that the results will be accurate. However, the accuracy of the results depends on many factors. And tests can and will generate errors. Testing errors are inevitable.
You must understand that any testing has its margin of error. Furthermore, these errors can vary across different trading platforms. By developing a trading robot in OsEngine, MT4, TsLab, we risk obtaining completely different final results.
What can cause this error in tests:
Let's discuss this.
The trading logic of the robot, which generates logical nonsense.
Let's consider an example. Inputs:
Very simple logic. However, without understanding the testing logic and how data is fed into it, one can simply create a profitable equity curve in this way.
What actually happens in the example:
IMPORTANT!
In this example, when subscribing to the position opening event and setting stop/take profit orders within it, in order to avoid errors and logical mistakes, tests should be conducted ON TICK DATA. Alternatively, you should change your logic so that the robot takes action with stop loss and take profit orders only after the candlestick is closed. Simultaneously, you should place ONLY a stop loss or ONLY a take profit order.
Logical nonsense is the most frequent and dangerous misuse of the tester/optimizer that can occur. Within this misuse, without understanding the inner workings of the tester, users can simply DRAW profits for themselves.
Idiosyncrasies in order execution.

Fig. 1. Order execution settings.
Limit orders can generally be executed in the following ways:
Market orders can be executed in the following ways:
Data for testing.
Candlesticks contain only four values. And if tests are conducted on them, certain types of orders in candlestick testing introduce a significant margin of error:
Tick data generally yield better results when using the above-mentioned scenarios, but they are also not a 100% guarantee that your orders are executed exactly where they would be in real trading. Problems with tick data:
Architecture of testing module (vector/event-based).
Vector-based testing architecture is a way of conducting tests where data is taken for the entire period, and the trading algorithm runs through this data in a loop, making certain trading actions.
Features:
Event-based testing architecture is a way of conducting tests where a so-called exchange emulator is created. It tries to make the robot not understand whether it is trading in the tester or in real life, based on the available data by sequentially delivering them.
Features:
So what should be done?
Accept this fact as it is. Understand that there will be errors in any case. And for mass tests, you will still have to use candles, allowing for the possibility that the test results may differ from what will happen in reality with some error.
If you have any difficulties or questions, please write to the support chat. Link