ATM_Regular_News_Times

Download script
Author: Copyright � 2006, MetaQuotes Software Corp.
ATM_Regular_News_Times

This tool is designed to provide traders with a clear visual map of significant market sessions and news events directly on their trading charts. Instead of forcing you to constantly monitor the clock or manually calculate time zone differences, this script automatically identifies and marks key global trading windows—specifically those for the Asian, European, London, and USA markets.

How it Works

The logic of the script revolves around "Time Awareness." It takes the current market time and cross-references it with specific user-defined times that signify high-activity periods or news releases.

When you load this onto your chart:

  • Automatic Mapping: The script identifies the exact dates and times for the sessions you want to track.
  • Visual Identification: It draws distinct visual markers (trend lines) on your chart to highlight where these sessions begin and end. Each session is assigned a unique color, allowing you to instantly distinguish between different market behaviors at a glance.
  • Dynamic Calculation: The script automatically calculates the "High" and "Low" price points for the specific time frames provided. This means it doesn't just mark a random point on your screen; it identifies the price boundaries reached during those specific windows.

Key Features

  • Customizable Time Zones: You can adjust the broker's GMT offset to ensure the markers align perfectly with your specific trading platform’s clock.
  • Toggleable Visibility: You have full control over which regions to display. If you only trade the London and USA sessions, you can turn off the Asian and European markers to keep your chart clean.
  • Color-Coded Organization: By using different colors for each region (such as Yellow for Asia, Lime for Europe, Red for London, and Blue/Yellow for the USA), the tool provides an organized, easy-to-read environment that helps you stay oriented during the trading day.

In short, this script acts as a visual "timetable" for your charts, highlighting the most important moments of the global trading day so you can better understand the rhythm of the market.

13 Views
0 Downloads
0 Favorites
ATM_Regular_News_Times
//+------------------------------------------------------------------+
//|                                       Dolly_Trading Times #3.mq4 |
//|                      Copyright © 2006, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
#property link      " Code used from  i-ParamonWorkTime.mq4 " 
#property indicator_chart_window

extern string Broker_GMT_Offset = "03:00";

int    TradingTimes_NumberOfDays = 1; 
extern string ASIAN_News       = "23:29";
extern color  ASIAN_Color      = Yellow; 
color  ASIAN_TEXT_Color = Yellow;
bool Show_ASIAN_News = true;

extern string EUROPE_News      = "06:59";  
extern color  EUROPE_Color      = Lime;
color  EUROPE_TEXT_Color = Lime;
bool Show_EUROPE_News  = true;

extern string LONDON_News       = "07:29";
extern color  LONDON_Color      = Red;
color  LONDON_TEXT_Color = Red;
bool Show_LONDON_News = true;

extern string USA_News       = "12:29";
extern color  USA_Color      = Blue;
color  USA_TEXT_Color = Yellow;
bool Show_USA_News = true;






//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void init() {
  DeleteObjects();
  for (int i=0; i<TradingTimes_NumberOfDays; i++) {
    CreateObjects("TradeTIME1"+i, ASIAN_Color);
    CreateObjects("TradeTIME2"+i, EUROPE_Color);
    CreateObjects("TradeTIME3"+i, LONDON_Color);
    CreateObjects("TradeTIME4"+i, USA_Color);
    
    
  }
  
}

//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
void deinit() {
  DeleteObjects();
  ObjectDelete("TT1");ObjectDelete("TT2");ObjectDelete("TT3");
  ObjectDelete("TT4");ObjectDelete("TT5");ObjectDelete("TT6");
  ObjectDelete("TT7");ObjectDelete("TT8");
}
void CreateObjects(string TRADETIMES, color cl) {
  ObjectCreate(TRADETIMES, OBJ_TREND, 0, 0,0, 0,0);
  ObjectSet(TRADETIMES, OBJPROP_STYLE, STYLE_DASHDOT);
  ObjectSet(TRADETIMES, OBJPROP_WIDTH,0);
  ObjectSet(TRADETIMES, OBJPROP_COLOR, cl);
  ObjectSet(TRADETIMES, OBJPROP_BACK, True);
}

void DeleteObjects() {
  for (int i=0; i<TradingTimes_NumberOfDays; i++) {
    ObjectDelete("TradeTIME1"+i);
    ObjectDelete("TradeTIME2"+i);
    ObjectDelete("TradeTIME3"+i);
    ObjectDelete("TradeTIME4"+i);
   
  }
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
void start()
 {  
 
  datetime dt=CurTime();

  for (int i=0; i<TradingTimes_NumberOfDays; i++) {
  if (Show_ASIAN_News==true)
  {
    DrawObjects(dt, "TradeTIME1"+i, ASIAN_News, ASIAN_News);}
   if (Show_EUROPE_News==true)
   {
    DrawObjects(dt, "TradeTIME2"+i, EUROPE_News, EUROPE_News);}
   if (Show_LONDON_News==true)
   { 
    DrawObjects(dt, "TradeTIME3"+i, LONDON_News, LONDON_News);}
   if (Show_USA_News==true)
   { 
    DrawObjects(dt, "TradeTIME4"+i, USA_News, USA_News);}
    
  }
}

void DrawObjects(datetime dt, string TRADETIMES, string tb, string te) {
  datetime t1, t2;
  double   p1, p2;
  int      b1, b2;

  t1=StrToTime(TimeToStr(dt, TIME_DATE)+" "+tb);
  t2=StrToTime(TimeToStr(dt, TIME_DATE)+" "+te);
  b1=iBarShift(NULL, 0, t1);
  b2=iBarShift(NULL, 0, t2);
  p1=High[Highest(NULL, 0, MODE_HIGH, b1-b2, b2)];
  p2=Low [Lowest (NULL, 0, MODE_LOW , b1-b2, b2)];
  
  ObjectSet(TRADETIMES, OBJPROP_TIME1 , t1);
  ObjectSet(TRADETIMES, OBJPROP_PRICE1, p1);
  ObjectSet(TRADETIMES, OBJPROP_TIME2 , t2);
  ObjectSet(TRADETIMES, OBJPROP_PRICE2, p2);

}  

Comments