Indicators: Ping

 

Ping:

A real-time indicator showing the lag of quotes inside the terminal.

Two variants of indicator visualization

Author: fxsaber

 

There is a logical issue with your indicator.

Ping = PrevTime ? MathAbs(Tick.time_msc - PrevTick.time_msc - (NowTime - PrevTime) / 1e3) : 0;

You can't just take the absolute value and count it as a delay. A -250 ms "in advance" will be counted as a 250 delay, that's not good.

Ticks are often received by packets by MT5, that's why there are negative values.

I don't think it's possible to calculate something precise about it. I removed the MathAbs() and allow negative values, all is well balanced between plus and minus values.


 
Alain Verleyen #:

There is a logical issue with your indicator.

Any deviation from zero is not ideal.