kvant
Download scriptThis tool is designed to track and visualize the amount of time that passes between each update on your trading platform. Rather than showing standard price movements or market data, it focuses entirely on the "heartbeat" of the data feed.
How It Works
The script functions by constantly measuring the elapsed time (in milliseconds) between one platform tick and the next.
- Time Measurement: Every time the market moves or the platform receives a new piece of information, the script captures a timestamp.
- Calculation: It subtracts the previous timestamp from the current one to determine exactly how much time has passed since the last update.
- Data Processing: The script then performs a mathematical transformation (a logarithmic calculation) on this time interval. This is often done to smooth out extreme spikes in data, making it easier to visualize trends in timing consistency.
- Visual Output: These calculated values are plotted as a continuous line on a separate window in your trading interface. Additionally, the script provides an instant pop-up alert that displays the exact number of milliseconds elapsed for each new update.
Purpose
The primary goal of this logic is to monitor the "fluidity" of the data feed. By watching the resulting line, you can see how quickly your platform is receiving information. If the line shows large jumps or inconsistencies, it indicates delays in data transmission; a steady, consistent line suggests a smooth and responsive connection to the market provider.
//+------------------------------------------------------------------+
//| ProjectName |
//| Copyright 2012, CompanyName |
//| http://www.companyname.net |
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Aqua
double x[];
double time1,time2;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(1);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,x);
SetIndexDrawBegin(0,0);
SetIndexLabel(0,"x");
SetIndexShift(0,0);
time1=GetTickCount();
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
double t;
time2=GetTickCount();
t=time2-time1;
time1=time2;
Alert("Âðåìÿ ìåæäó òèêàìè(ìñåê) = ",t);
if(t>0) x[0]=MathLog(t);
else x[0]=1;
for(int j=ArraySize(x)-1;j>=1;j--){x[j]=x[j-1];}
return(0);
}
//+------------------------------------------------------------------+
Comments