DayOfWeek_v1
Download scriptThis tool is designed to help traders visually identify specific days of the week on their trading charts. Rather than cluttering the screen with complex data, it serves as a simple visual marker to highlight recurring weekly patterns or specific trading sessions.
How it Works
The core logic of this script revolves around monitoring the date of every price candle on your chart. It checks the day of the week for every historical point and compares it against a specific setting you choose (for example, identifying only Mondays, Tuesdays, etc.).
Key Features
- Customizable Day Selection: You can define which specific day of the week you want to track through the input settings.
- Visual Mapping: When the script identifies a candle that matches your chosen day, it places a distinct visual marker (an arrow) above that price point.
- Automatic Filtering: If a candle does not fall on the day you selected, the script ignores it entirely, ensuring that only the relevant days are highlighted.
- Historical Analysis: The logic scans backward through your chart history, allowing you to see where these specific days occurred in the past, which can help in recognizing weekly trends or cyclical behaviors.
Practical Use
By using this indicator, you can quickly spot "Day of the Week" effects without having to manually check dates on every candle. It is ideal for traders who notice that certain days (like Mondays or Fridays) exhibit unique price movements or volatility patterns and want to isolate those specific moments for easier analysis.
//+------------------------------------------------------------------+
//| 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