Interesting topic for many: what's new in MetaTrader 4 and MQL4 - big changes on the way - page 55

 

Forum on trading, automated trading systems and strategy testing

How does the initial historical data affect the speed and accuracy of testing?

hrenfx, 2013.08.10 07:23

It will:

Spread = Low_Ask - Low_Bid; // во время формирования бара вычислятся не только Low_Bid, но и Low_Ask. В поле Spread пишется их разница. Low_Ask напрямую не запоминается.
// Spread = Max(Low_Ask - Low_Bid, 0); // вариант, если не хочется снимать ограничение отрицательного спреда (в агрегаторах иногда бывает моментальный/текущий спред в отрицательной зоне)

Wondering how often M1 LowAsk < LowBid (HighAsk < HighBid). Most noticeable results of attached script:

2013.03.15 20:37 EURUSD LowAsk (1.30579) < LowBid (1.30580)
2013.03.20 12:06 EURUSD LowAsk (1.28874) < LowBid (1.28875)
2013.04.26 19:05 EURUSD LowAsk (1.30258) < LowBid (1.30270)
2013.05.28 19:47 EURUSD LowAsk (1.28629) < LowBid (1.28630)
2013.06.20 16:04 EURUSD HighAsk (1.32210) < HighBid (1.32211)

2013.04.26 19:11 GOLD LowAsk (1453.06) < LowBid (1453.10)
2013.05.10 06:09 GOLD LowAsk (1460.86) < LowBid (1460.96)
2013.05.15 16:04 GOLD LowAsk (1413.09) < LowBid (1413.14)
2013.07.29 02:45 GOLD HighAsk (1330.73) < HighBid (1330.74)

2013.04.08 05:54 EURJPY HighAsk (127.797) < HighBid (127.798)
2013.04.29 17:02 EURJPY HighAsk (128.180) < HighBid (128.181)
2013.06.13 15:12 EURJPY HighAsk (125.383) < HighBid (125.385)
2013.08.08 07:20 EURJPY LowAsk (129.047) < LowBid (129.048)

On some characters there are no such cases recorded at all.

In short, they are so few that I can safely calculate the bar spread using the formula:

Spread = Max(Low_Ask - Low_Bid, 0);

P.S. It's been a long time since I looked. It turns out that now the average real EURUSD spread is ~ 0. If the commission is $10 per mio (LMAX offers it, for example), the costs are < 3 pips (EURUSD). All in all, FOREX trading conditions are getting better and better.

Files:
 
hrenfx:

Wondering how often M1 LowAsk < LowBid (HighAsk < HighBid). The most noticeable results of the attached script:

On some characters there are no such cases recorded at all.

In short, they are so few that I can safely calculate the bar spread using the formula:

P.S. It's been a long time since I looked. It turns out that now the average real EURUSD spread is ~ 0. If the commission is $10 per mio (LMAX offers it, for example), the costs are < 3 pips (EURUSD). In general, trading conditions on FOREX are getting better and better.

Yeah, like better and better, that's what Dmitriy Rannev says:

I can easily make the spread even zero on the news, just the slippage will increase. I think I don't need to explain how this is done technically?
Do you know a company that does not slip on the news?

By the way, good idea, we should try to make an account type with zero spread and put the spread in slippage. To show people how things really are (and how many do). Spread is now measured by everyone, but slippage is measured by few.


And slippages and gaps can be controlled (seen) only on a real tick history in a tick tester.

 

serferrer:

Slippages and gaps can be controlled (seen) only on a real tick history in a tick tester.

With gaps I understand, but how can the tester help to see the slippage?
 
serferrer:

Yeah, like it gets better and better, that's what Dmitriy Rannev says, for example:


But slippage and gaps can be controlled (seen) only on the real tick history in the tick tester.

It couldn't be simpler. Before the Expert Advisor (script) sends a market order, we memorize the bid (for selling) and ask (for buying) prices, and after opening a trade, we compare its open price with the memorized one.

This is how we control (after the fact) the slippage.

 
olyakish:

This is as easy as it gets. Before the Expert Advisor (script) sends a market order, we memorize the bid (to sell) and ask (to buy) prices, and after opening a trade, we compare its open price with the memorized one.

This is how slippage is controlled (after the fact).

In the tester?
 
MetaDriver:
With gaps is clear, but how does the tester help to see the slippage?

It is tested on the real tick history in the tick tester, the previous traded day (week), for example, and the average, maximum, slippage and their frequency (+ on the news) and distribution uniformity are revealed.

I.e. there is a comparison (search of nuances) of real trade, and in the tester, as close to the real one as possible.

Then you can, all this information can be applied in the analysis of expected past and future slippages.

 
olyakish:

This is as easy as it gets. Before the Expert Advisor (script) sends a market order, we memorize the bid (to sell) and ask (to buy) prices, and after opening a trade, we compare its open price with the memorized one.

This controls (after the fact) the slippage.

Yeah, that's how slippage is monitored in real trading, in the tester (i.e. future, past) only on ticks.

The past means the past that was not really monitored.

 
serferrer:

Yeah, like better and better, that's what Dmitriy Rannev says:

And if you read it carefully?

hrenfx:

P.S. It's been a while since I looked. It turns out that now the average real EURUSD spread is ~0. If the commission is $10 per mio (LMAX, for example, offers on the fly), the costs are < 3 pips (EURUSD). In general, trading conditions on FOREX are getting better and better.

 
MetaDriver:
In a tester?

In order to catch slippage on tick data in the tester, you need to set an approximate time lag (lag) for the data transmission between the dc and the client. 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's clear that partial order execution cannot be simulated in this way, we need data on liquidity there.

p.s. One of the fundamentals of the hft industry - colocation aims to minimise this lag. People pay millions of quid to put their equipment closer to the exchange's servers. There's a microsecond count there.

 
MetaDriver:
With gaps I see, but how does the tester help to see the slippage?
Each TS has its own custom story.
Reason: