Intra Minute tick data in the history charts

 
I download history data from a broker. Can be the "universal" MetaQuotes Software Corp history data in the MT4 > Tools > History Center or data from a broker specific like for example FXCM. The data in the 1 min history are 1 line per minute. But when I put the Back Tester in visual mode, I see intra minute tick activity (see video). The chart on the video is from 2013! and recorded last week.
https://www.youtube.com/watch?v=k-IOl3_hoLE
Where is this tick data coming from ???
 

Hi , MT4 generates tick data from larger timeframes (starting with M1 first) . see lots of information here .

 https://www.mql5.com/en/articles/1490 

https://www.mql5.com/en/articles/1511 

https://www.mql5.com/en/articles/mt4/strategy_tester 

 

MT4 (and I am guessing MT5 as well) "fakes" the tick data based on the minute values, as ydrol stated slightly differently above.  Basically, they are actually an "educated guess" based on within which minute they would be expected to appear.


Edit:

(adding this to further explain the idea of how I think the fake ticks are made)

Because the tick data I am talking about is a specific time value of less than 1 minute, they are basically (depending on your source) one price value (no OHLC like the other timeframes) and one volume value for that specific instant they represent.  In real operation, those ticks that appear within minute X then are calculated together to ultimately become the OHLC and full volume for minute X.  The lowest time frame value that the tester uses is the one minute time frame, not the ticks, so to recreate the ticks, they have to use some method to do so.  So what I think they do is extrapolate the tick data given that the minute data is known.  For price, they basically "forge" false tick data based on what the minute information actually is.  Obviously, within that minute there is a "tick" value that corresponds to the all 4 major points of a bar, so they have those guaranteed to be within it, one tick each.  And based on the volume, they spread it out through some specific method to make it so the entire volume is distributed among those fake ticks, usually well more than just the 4 "known" ones.  But if they were all combined, would accurately reflect the minute bar they are derived from.  The same is basically true to calculate the higher time frames, except the opposite direction.  The minute bar values are known, and 5 are added for the 5 min, 10 for the 10 min, etc., as Pipperoni shows below.

 

In this article:  Tester in the Terminal MetaTrader 4 that you can read here: https://www.mql5.com/en/articles/1490 (thanks ydrol)

I find this:
Important: before starting the testing make sure that all necessary price data of other timeframes is pumped, and that this data is correct. Standard History Center provides the correctness of all timeframes, because it automatically recalculates from the minute data all other periods. 




Considered that we go from a high definition 1 min to lower definition 5 min ...and that the 5 min is "Calculated from the minute data (to all other periods)" how can than the tick data be "recreated" ?

We see also that in the higher TF we have only 1 entry per bar and they contain thus no other info than open high low close.
Unless somebody can enlighten us ... I am afraid that JD4 is correct and that the BT can not now the ticks. In this way back testing a Trailing SL is a USELESS.

 

If the 1 min bar can as well be A or B ... than the Back test becomes very imprecise. Because an execution like I see on FXCM takes about 1 to several seconds. And don't believe the promotional blabla, because I have run a high frequency EA from a VPS with a 1ms latency connection to the broker ... and I see how much delay real time execution has .... So if we don't know if a minute bar is A or B ... than we are testing in the dark ! The broker will NOT execute your order when the spike is to narrow, because there is not enough time or/and because your order is in a queue and the liquidity at the spike is insufficient . All EA's need precise data to be able to back test them.



 

-. The tick data generated by MT4 is 'fake' data.  This is mentioned in the article..

 To generate price movements between control points, interpolation based on the predefined templates is used

It's a fancy way of saying 'guess'.

 

-. You can get real tick data from external sources ( Search Dukascopy, TickStory, Birts ) and 'force' the real ticks into MT4. I say 'force' rather than 'import' because MT4 has no support for this. The external programs have to push the real 'tick' files  into MT4 and make them read only so MT4 will not overwrite them with 'fake' ticks, when you click '[Start]'

 

-There is still an issue with variable spreads during backtesting with MT4. The spread is fixed at present in MT4. Some external programs have ways to deal with this. Not sure how. I suspect Birts TDS has some MQL wrappers around the broker inputs (Ask,Bid ,Series ) and outputs ( OrderSend, OrderModify) that must be used? (just a guess)

 

-.Also you must pay attention to timezones of imported data vs that of the broker. Import tools can take care of that for you.

 

The cynic in me thinks that, as MQ customers are the brokers and not the users, there is no urgency to support full accurate backtesting out of the box.

 
ydrol:

 

The cynic in me thinks that, as MQ customers are the brokers and not the users, there is no urgency to support full accurate backtesting out of the box.

I would agree with this, as I think it is highly unlikely that brokers have any need to backtest.
 
I found a possible solution for this lack of accuracy of MT4. If you use a Trailing Stop in your EA ... the result of your Back tests will be VERY different from the real trades. Also if you use a fixed spread in your BT while (nearly) all brokers have a variable spread ... well now you can forget all EAs with a small TP target, that need a fast broker execution. There are people out there that have made programs to improve on the rough BT that is included in MT4. But I am not allowed to give here links because commercial, so Google for tick data backtesting and you will find. They will very much improve the results of a BT ... BUT...There might be an other issue to consider. Even when using ticks to BT, we should have a criteria in the Back Tester to tell the tester how long a price has existed, in order for the broker to be able to, reasonably spoken, execute your order. Even if the price was for 0.1sec at a certain level ... the broker will for sure ignore that tick (unless he chases your stop ...hahahah). So Back Testing and understanding the realism of the results ... is anyway complex.
 
Pipperoni: Where is this tick data coming from ???
Tester generated 'Strategy Tester: Modes of Modeling during Testing - MQL4 Articles
 
Hi WHRoeder. Tick data per currency pair are available from many sources, however they should come from your broker. The one where you want to run your EA on, because brokers have there specific spikiness or hairiness of the candles. Also the day to the next day can differ a lot, etc. Oanda and FXCM have tick data available for there clients for example. If needed I can help with this. You might encounter also compatibility troubles with the format of delivery. In that case find a coder who can write a script to correct the data. Or I can help.
 

Here is a detailed explanation on the MQL5 website about "Algorithm of ticks' generation" in the back tester.


Reason: