DDFX 1 B-clock_v3

Download script
Author: Copyright � 2005, Nick Bilak
DDFX 1 B-clock_v3

This script is a visual utility designed for the MetaTrader platform to help traders keep track of real-time price movement within a specific time frame. Its primary purpose is to act as a live countdown timer that shows exactly how much time remains before the current candle (or "bar") closes.

How it Works

The logic follows a simple three-step process to provide you with real-time information:

1. Time Calculation The script constantly monitors the current market time and compares it against the scheduled closing time of the active price bar. It calculates the difference between these two points to determine the remaining duration in both minutes and seconds.

2. On-Screen Notification (Text) To ensure you can see the countdown immediately, the script generates a text comment in the top-left corner of your trading chart. This provides a quick, readable summary of the "minutes and seconds left" for the current period.

3. Visual Chart Marker In addition to the text in the corner, the script places a dynamic visual label directly on the price chart. This label is positioned at the current closing price of the active bar. As time passes and the price fluctuates, this label moves automatically with the price, displaying the remaining time in a bold, customizable color.

Key Features for the User

  • Real-Time Updates: The countdown refreshes automatically as every second passes, ensuring you always have an accurate view of the remaining trading window.
  • Visual Clarity: By placing the time directly on the chart near the current price, it allows you to coordinate your entries and exits with the closing of the candle without having to look away from the price action.
  • Customization: The tool includes a setting that allows you to choose the color of the countdown text on the chart, making it easier to read against different background themes or high-contrast setups.
14 Views
0 Downloads
0 Favorites
DDFX 1 B-clock_v3
/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "Copyright © 2005, Nick Bilak"
#property link      "http://metatrader.50webs.com/"

#property indicator_chart_window

extern color ClockColor = Fuchsia;


int deinit() {
   ObjectDelete("time");
   return (0);
}

int init() {
   return (0);
}

int start() {
   int li_8 = Time[0] + 60 * Period() - TimeCurrent();
   double ld_0 = li_8 / 60.0;
   int li_12 = li_8 % 60;
   li_8 = (li_8 - li_8 % 60) / 60;
   Comment(li_8 + " minutes " + li_12 + " seconds left to bar end");
   ObjectDelete("time");
   if (ObjectFind("time") != 0) {
      ObjectCreate("time", OBJ_TEXT, 0, Time[0], Close[0] + 0.0005);
      ObjectSetText("time", "                  <" + li_8 + ":" + li_12, 8, "Arial", ClockColor);
   } else ObjectMove("time", 0, Time[0], Close[0] + 0.0005);
   return (0);
}

Comments