All parameters of each tick are always filled in, regardless of whether the data has changed since the previous tick. This allows you to always have the current price status at any moment of time without looking up the previous values in the tick history. For example, with a tick only the bid price might have changed, but the structure will contain other parameters in addition to the new price: previous ask price, volume, etc. To find out which data has changed with the current tick, analyse its flags:
TICK_FLAG_BID - the tick has changed the bid price
TICK_FLAG_ASK - the tick has changed the ask price
TICK_FLAG_LAST - tick has changed the price of last deal
TICK_FLAG_VOLUME - Tick has changed volume
TICK_FLAG_BUY - Tick occurred as a result of a buy deal
TICK_FLAG_SELL - a tick occurred as a result of a sell deal
I have attached an EA that prints out these codes in OnInit():
Print(TICK_FLAG_BID," - тик изменил цену бид");
Print(TICK_FLAG_ASK," - тик изменил цену аск");
Print(TICK_FLAG_LAST," - тик изменил цену последней сделки");
Print(TICK_FLAG_VOLUME," - тик изменил объем");
Print(TICK_FLAG_BUY," - тик возник в результате сделки на покупку");
Print(TICK_FLAG_SELL," - тик возник в результате сделки на продажу")
and the result:
2015.10.2315:12:33.274 CopyTicks_1_5_0 (USDCAD,M5) 2 - тик изменил цену бид
2015.10.2315:12:33.274 CopyTicks_1_5_0 (USDCAD,M5) 4 - тик изменил цену аск
2015.10.2315:12:33.274 CopyTicks_1_5_0 (USDCAD,M5) 8 - тик изменил цену последней сделки
2015.10.2315:12:33.274 CopyTicks_1_5_0 (USDCAD,M5) 16 - тик изменил объем
2015.10.2315:12:33.274 CopyTicks_1_5_0 (USDCAD,M5) 32 - тик возник в результате сделки на покупку
2015.10.2315:12:33.274 CopyTicks_1_5_0 (USDCAD,M5) 64 - тик возник в результате сделки на продажу
It is understandable. But how long does it take to swap? In the example above the request is for 50 ticks and if the ticks are not loaded immediately it takes 30 seconds.
It gets worse. I give a request for 500 ticks - ticks are loaded almost instantly (I think it's only because I requested this amount earlier), and then I give a request for 5000 - four minutes have already passed, and I have just under 2000 ticks out of 5000 loaded and this number is not growing.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
The flags field of the MqlTicks structure often contains values of "24" (display mode "all ticks"):
- what does this value mean?
I have attached an EA that prints out these codes in OnInit():
and the result:
There is no "24" value among the results.
There is no value of "24" among the results.
8 || 16 = 24
I have attached an EA that prints out these codes in OnInit():
and the result:
There is no value "24" among the results.
Bitwise OR operation
Can anyone else test the indicator from the post on methodology:
Forum on trading, automated trading systems and trading strategy testing
Tick history
Karputov Vladimir, 2015.10.22 15:07
It is understandable. But how long does it take to swap? In the example above the request is for 50 ticks and if the ticks are not loaded immediately it takes 30 seconds.
It gets worse. I give a request for 500 ticks - ticks are loaded almost instantly (I think it's only because I requested this amount earlier), and then I give a request for 5000 - four minutes have already passed, and I have just under 2000 ticks out of 5000 loaded and this number is not growing.
...
In the tester, the ticks are not downloaded until we complete the full integration of ticks in the Strategy Tester in the next release.
The build 1200 is out. In the tester the ticks are not downloaded, but in the tester in the Market Watch the ticks look like real ticks:
Figured out how to get ticks from a certain date. It's simple: you have to specify the time in milliseconds.
Bild 1200. There is an indicator attached to the chart which calls CopyTicks. Everything works. But after breaking the connection:
and then when the connection is restored, CopyTicks stubbornly refuses to give back ticks. And it's either 50 ticks or 500.
Bild 1200. There is an indicator attached to the chart which calls CopyTicks. Everything works. But after the connection is severed:
and then when the connection is restored, CopyTicks stubbornly refuses to give back ticks. And it's either 50 ticks or 500.