ShowTime

This script is designed as a diagnostic monitoring tool to help traders understand the time synchronization between their local computer and the trading server. It serves as a real-time visual reference for identifying time discrepancies that could affect trade execution or data analysis.

Core Functionality

The logic operates by continuously calculating three distinct time markers and displaying them simultaneously on your trading chart:

  • Server Time: The actual current time provided by the trading platform (the "market time").
  • Local Time: The current clock time on your personal computer or device.
  • Simulated Server Time: A calculated reference point derived from a specific offset applied to your local machine's clock.

How it Works

Once activated, the script enters an infinite monitoring loop. Every fraction of a second, it refreshes a text display on your screen to show:

  1. Real-Time Tracking: It constantly updates the current seconds for both your computer and the server.
  2. The Time Gap: It automatically calculates and displays the exact number of seconds separating your local clock from the market's clock.
  3. Continuous Update: Because it runs on a loop with a very brief pause between updates, the information stays live, allowing you to see the time moving in real-time rather than as a static snapshot.

Purpose for the User

The primary goal of this tool is transparency. By providing a clear view of the "Seconds Difference," it allows traders to quickly verify if their trading platform is properly synced with the global market time or to understand how much of a delay exists between their local environment and the exchange.

6 Views
0 Downloads
0 Favorites
ShowTime
//+----------------------------------------------------------+
//| expert initialization function |
//+----------------------------------------------------------+
extern double GMTShift=0;

int init()
{
  //----
  double RunningTime = TimeCurrent();
  double Different = 0;

  while (true)
  {
     Comment("Last Server Time     : ",TimeToStr(TimeCurrent(),TIME_SECONDS),
           "\nSimulated ServerTime : ",TimeToStr(TimeLocal()-17876,TIME_SECONDS),
           "\nLocal Time : ",TimeToStr(TimeLocal(),TIME_SECONDS), 
           "\nSeconds Difference : ", TimeLocal()-TimeCurrent()
             );
     //RunningTime++;
     Sleep(100);
  }
//----
return(0);
}

Comments