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
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 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).
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).
A serious problem has been discovered:
Duplicate ticks with different start_time :(
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
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:
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.
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:
Receive:
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)
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?