Ping - MetaTrader 5 Script | Forex Indicator Download - MT4/MT5 Resources - MetaTrader 5 Resources



An important parameter in trading is the correlation of current prices. This depends on many factors, one of the most common being the network ping between the terminal and the trading server.
However, another parameter is often ignored: the so-called "internal terminal ping", which is an additional lag in the internal quotes of the terminal (platform) . Even if the network ping is zero, this lag can be significant.

This indicator shows the dynamic changes of this parameter and is calculated as follows:
#include// https://www.mql5.com/en/code/16280 // Get new quotes using internal quote lag value in milliseconds Boolean symbol information tick ( constant & string, MQTick & tick, double &flat ) { static constant boolean tester = ( MQLInfo Integer ( MQL_Tester ) || MQLInfo Integer ( MQL_Optimization )); static MQTick previous tick = { 0 }; Stationary Oolong last time = 0 ; const Oolong now time = IsTester? 0 : Get microsecond count (); const boolean resolution = symbol_info_check (symbol, tick); if ((!IsTester) && Res) { if (_R(check) != previous check) { Ping = Previous time? math antibody (Tick.time_msc - PrevTick.time_msc - (NowTime - PrevTime) / 1 e3): 0 ; Previous time = current time; previous tick = tick; } else flat = 0 ; } return (research); }
The screenshot above shows that the calculated value is far from small (a clean terminal, a chart) and the pursuit of zero ping can be deceptive in trading and certain types of analysis in MetaTrader 5.
Indicator calculation requires a library for comparing structures when MQTick calculates lags:
#include // https://www.mql5.com/en/code/16280 This indicator has two display types, depending on the following lines:
#Define histogram view // Comment this line to change the indicator view from histogram to candlesticks
The current indicator shows price lag ( flat ), connected with calculated events. In fact, there are many factors that have a significant impact on ping, so the appropriateness of using any indicator in trading systems and analysis seems questionable. Of course, new tick events are less sensitive to negative effects, but their ping value is also quite large (if measured in an Expert Advisor), which can sometimes minimize the importance of certain platform speed characteristics .
Attachment download
📎 ping.mq5 (7.45 KB)
📎 typetobytes.mqh (19.12 KB)
Source: MQL5 #19422
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •