Table of all trades. Accessed via MQL5 - page 3

 
prostotrader:

Does anyone know what the error is?

The indicator works correctly, but more bars are displayed,

than it was set up for.

I did not look at the code, but I assume that after each new bar, it does not take into account that the indicator lines are also automatically shifted to the left (if you look at the chart). In other words, it is necessary to shift the indicator lines to the right (when looking at the chart).
 
Karputov Vladimir:
I did not look at the code, but I assume that after the appearance of each new bar, it does not take into account the fact that the indicator lines are also automatically shifted to the left (if you look at the chart). In other words, when a new bar appears, shift indicator lines to the right (when looking at the chart).
Thank you, I have found the bug.
Files:
DealsLent.mq5  10 kb
 
prostotrader:
The final touch...

Turns out not the last ....

Need some more optimisation.

I'll finish it and test it...

 
If this is the case, keep the tick indicator - open interest indicator (run on a real account connected to the exchange).
 
Karputov Vladimir:
If this is the case, keep the tick indicator - open interest indicator (run on a real account connected to the exchange).
I'll be glad to hear it.
 

A serious problem has been discovered:

Duplicate ticks with different start_time :(

int copied=CopyTicks(Symbol(),ticks,COPY_TICKS_ALL,start_time,0);

start_time is different and the ticks are copied repeatedly if

they have the same time

I'll describe it in detail tomorrow.

Latest build

Files:
DealsLent.mq5  12 kb
 

Can't sleep, so I thought I'd write down what's going on.

(Full indicator code is in the post above.)

Ticks from the exchange do not come to the terminal strictly by time intervals,

but in blocks (see screenshot) Block 1, Block 2 etc.

The terminal "stores" and displays them in the table, as it receives them from the exchange (block by block).

Inboth blocks there may be transactions with the same time.

If we call CopyTicks() NOT in real time (say the next day or a few seconds),

then the CopyTicks() function will return the exact data.

But in real time, the following happens:

int copied=CopyTicks(Symbol(),ticks,COPY_TICKS_ALL,start_time,0);

If start_time = (23:49:58.114), we get Block 1 completely (circled in red).

Then, we wait for the time change to get Block 2 (circled in green).

To avoid duplicating Block 1 (OnBookEvent can trigger very quickly)

we introduce a check to make sure that the time has changed

if(start_time==ulong(ticks[copied-1].time_msc)) return;

When start_time = (23:49:58.596), we should have gotten Block 2,

but the CopyTicks() function returns both Block 2 and all ticks with time (23:49:58.114),

if Block 2 has at least one tick with the same time(23:49:58.114).

This is such very sad news.... :(

Unless the developers fix this, it's impossible to get a Real Time Tape of trades.


 
prostotrader:


And why do you think that ticks are downloaded from a given time and FUTURE to history when you query by time? In fact, when requesting ticks by time, the ticks are downloaded from a given time and into the FUTURE. For example:

Input data (request 20000 ticks), time 2016.08.25 20-00-00:

request 20,000 ticks, time 2016.08.25 20-00-00:


Receive:

2016.08.26 07:22:06.852 CopyTicks_1_02 (SBRF-9.16,M1)   Получено тиков: 10823 код ошибки: 0
2016.08.26 07:22:06.852 CopyTicks_1_02 (SBRF-9.16,M1)   Тик: 2016.08.25 20:00:00 bid: 14377.0 ask: 0.0 last: 0.0 [0]
2016.08.26 07:22:06.852 CopyTicks_1_02 (SBRF-9.16,M1)   Тик: 2016.08.26 00:02:08 bid: 0.0 ask: 0.0 last: 0.0 [10822]
2016.08.26 07:22:06.852 CopyTicks_1_02 (SBRF-9.16,M1)   Size 0 Mb

That is, the ticks are received from the requested time2016.08.25 20:00:00 towards the FUTURE (the last tick has the time2016.08.26 00:02:08)

Files:
 
Karputov Vladimir:

And why do you think that ticks are downloaded from a given time and FUTURE to history when querying by time? In fact, when requesting ticks by time, the ticks are downloaded from a given time and into the FUTURE. For example:

Input data (request 20000 ticks), time 2016.08.25 20-00-00:



Receive:

That is, the ticks are received from the requested time2016.08.25 20:00:00 towards FUTURE (last tick has time2016.08.26 00:02:08)

I don't think in depth, I see "tacked on" from depth.

Why think?

Run the indicator and see for yourself!

And do you even read what is written?

Если мы вызываем CopyTicks() НЕ в реальном времени (скажкем, на следующий день),

то функция CopyTicks() будет возвращать точные данные.
 
I noticed it quite by accident when, in the evening, there were fewer deals.