Author: Copyright c 2006, Gordago Software Ltd.
DayOfWeek

This specialized technical tool is designed to work with MetaTrader trading platforms to highlight specific days of the week on your price charts. Instead of cluttering your screen with complex data, it serves as a visual marker to help traders identify recurring weekly patterns or specific trading sessions based on the calendar.

How the Logic Works

The script functions by scanning through your historical price data and comparing each candle's date against a specific setting you choose. Here is the step-by-step logic:

  • User Customization: The tool includes a primary setting that allows you to select a specific day of the week. This gives you the flexibility to isolate the exact day you want to monitor (for example, identifying every Monday or every Friday).
  • Automated Scanning: Once activated, the script automatically looks back through your chart's history. It examines every price bar to determine which day of the week that specific price action occurred.
  • Visual Identification: When the script finds a candle that matches your chosen day, it places a visual arrow directly above the highest price point of that period. This makes it easy to see at a glance which sections of the chart represent your target days.
  • Data Filtering: For any days that do not match your selection, the script remains silent and leaves no marks on the chart. This ensures that your workspace stays clean and only displays the specific information you are looking for.

Practical Use

By using this logic, traders can quickly identify historical trends, such as "Monday opens" or "Friday closes," without having to manually scroll through the calendar. It provides a clear, visual map of weekly price behavior, helping you spot recurring market behaviors more efficiently.

Miscellaneous
Implements a curve of type %1
14 Views
0 Downloads
0 Favorites
DayOfWeek

//+------------------------------------------------------------------+
//|                                                    DayOfWeek.mq4 |
//|                          Copyright c 2006, Gordago Software Ltd. |
//|                                           http://www.gordago.com |
//+------------------------------------------------------------------+
#property copyright "Copyright c 2006, Gordago Software Ltd."
#property link      "http://www.gordago.com"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 SpringGreen
//---- input parameters
extern int       prmWeek=0;
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,108);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexEmptyValue(0,0.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
   int pos=Bars-counted_bars;
   while(pos>=0){
		if (prmWeek == TimeDayOfWeek(Time[pos]))
   		ExtMapBuffer1[pos] = High[pos]+Point*3;
	   else
         ExtMapBuffer1[pos] = 0.0;
 	   pos--;   
   }
   return(0);
  }
//+------------------------------------------------------------------+
	

Comments