Interesting topic for many: what's new in MetaTrader 4 and MQL4 - big changes on the way - page 56
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
To catch slippage in the tick data tester, you need to set an approximate time delay in data transmission between the broker and the client (lag). Each tick has its time when it occurred to the millisecond, for example. In the tester, if the time of placing a market order + lag>the time of the next tick, then we execute at the prices of the new tick. It is clear that partial execution cannot be simulated in this way, we need liquidity data there.
Yes, that's right.
+ You can also specify in time, i.e. increase the lag at the time of news release (by pre-monitoring it on the real).
In order to catch slippage on tick data in the tester, you need to set an approximate time lag between the broker and the client (lag).
Everyone knows that the MetaTrader 5 Strategy Tester has the Random Delay mode. Help in MetaTrader 5 → Strategy Tester → Settings?
Arbitrary Delay
The Arbitrary Delay mode is intended for testing Expert Advisors in a near-realistic environment. From the moment an order is sent until it is executed, the price can change. Depending on the deviation set in the order, it can either be executed at the current price (if it is within the deviation limits) or requoting. Testing in this mode allows you to correctly program the Expert Advisor to handle such situations.
A delay is imitated for all trade requests sent from the terminal (placing of orders, change of stop levels, etc.). The delay in execution is implemented according to the following principle: a random number from 0 to 9 is selected and the delay is implemented for the same number of seconds; if the selected number is 9, another number from the same range is randomly selected and added to the first one. Thus, the probability of a delay of 0-8 seconds is 90%, and the probability of a delay of 9-18 seconds is 10%.
Everyone knows that the MetaTrader5 tester has a random delay mode Help in MetaTrader 5 → Strategy Tester → Settings?
This is only relevant if you are able to test on real ticks and that with nuances (as lag sometimes changes over time).
I think most people are aware that the MetaTrader5 tester has an arbitrary delay mode Help in MetaTrader 5 → Strategy Tester → Settings:
The random delay is a crude tool. This is the only way to seriously test:
Indicative history (the robot in the tester sees only it - like in real life) + its own custom history created for a particular TS (the tester executes on it).
When creating a custom history, the LiveTime-price (+ ping), liquidity (Level2 and the volumes operated by the TS), etc. are taken into account. And still we cannot achieve an ideal match, though it's possible to get much closer. There is just subtleties need to feel - to probe the reality of their TS.
P.S. Note that after creating such a custom build, you still need to apply a filter to it. Therefore, such a custom history can be in the form of M1 HighBid+LowAsk. I.e. it is not necessary (almost always) to test by a tick history or Level2 - history. We should only create a preliminary Execution-history out of that huge history. And then the pattern continues.
The random delay is a crude tool. This is the only way to seriously test:
Indicative history (the robot in the tester sees only it - like in real life) + its own custom history created for a particular TS (the tester executes on it).
When creating a custom history, the LiveTime-price (+ ping), liquidity (Level2 and the volumes operated by the TS), etc. are taken into account. And still we cannot achieve an ideal match, though it's possible to get much closer. There is just subtleties need to feel - to probe the reality of their TS.
P.S. Note that after creating such a custom build, you still need to apply a filter to it. Therefore, such a custom history can be in the form of M1 HighBid+LowAsk. I.e . it is not necessary (almost always) to test by a tick history or Level2 - history. We should only create a preliminary Execution-history out of that huge history. And then the pattern will run its course.
I assume that only FOREX is meant?
Because in futures, 1 tick (4-digit) = 10 ticks (5-digit mostly) in FOREX.
The random delay is a crude tool. This is the only way to seriously test:
Indicative history (the robot in the tester sees only it - like in real life) + its own custom history created for a particular TS (the tester executes on it).
When creating a custom history, the LiveTime-price (+ ping), liquidity (Level2 and the volumes operated by the TS), etc. are taken into account. And still we cannot achieve an ideal match, though it's possible to get much closer. There is just subtleties need to feel - to probe the reality of their TS.
P.S. Note that after creating such a custom build, you still need to apply a filter to it. Therefore, such a custom built history can be in the form of M1 HighBid+LowAsk. I.e. it is not necessary (almost always) to test by a tick history or Level2 - history. We should only create a preliminary Execution-history out of that huge history. And then the pattern continues.
This is the task of an adequate algotrader, not a tester. In the MT5-tester there is no data about the peculiarities of the tested TS and the same Level2-history to create an Execution-history for your TS.
Random delay is the first thing that comes to mind when writing your tester. Rough - yes, but with sense. Sometimes such roughness is done for limiters as well - Random Reject.
It's not about super accuracy, it's always about the golden mean between accuracy and speed. Only in very specific situations does it make sense to finesse.
So for MT5 the idea of an arbitrary delay mode (I haven't seen the implementation) is quite adequate.
This is the task of an adequate algotrader, not a tester.
well)) I.e. if I want to test with a larger lot, or another entry/exit method, I need to manually generate a new custom history))
A rough example of a custom history is different testing modes in MT4. By opening prices - one array of history (opening prices) is prepared, in other modes - others.
Indicators are used and an array with a calculated value for each bar (if optimized, several indicators are used).
We should consider the liquidity and type of orders used and the history can be automatically built/preprocessed accordingly. The most important thing is the initial raw material.