DOSR

The Daily Open-SR Technique is a visual trading tool designed to simplify chart analysis by automatically identifying key price levels based on the previous day's market activity. Instead of requiring manual plotting, this script analyzes daily price data to provide traders with immediate context regarding potential supply (resistance) and demand (support) zones.

How the Logic Works

The script operates by evaluating three specific types of price data from the daily timeframe:

1. Previous Day Analysis The tool looks back at the completed candle of the previous trading day to determine the overall sentiment. It specifically checks whether the market closed higher or lower than it opened:

  • Bullish Sentiment: If the previous day closed higher than it opened, the script identifies the highest price reached that day as a Resistance level and the opening price as a Support level.
  • Bearish Sentiment: If the previous day closed lower than it opened, the script reverses this logic, marking the opening price as a Resistance level and the lowest price reached that day as a Support level.

2. Current Day Tracking In addition to the historical levels, the script automatically identifies and displays the Today's Open price. This serves as a vital "anchor" point for traders to see how the current price is reacting relative to where the market started this morning.

Visual Presentation

To ensure clarity on your trading screen, the script manages three distinct horizontal lines:

  • Resistance Line: Placed at the calculated upper boundary (traditionally colored in Red).
  • Support Line: Placed at the calculated lower boundary (traditionally colored in Blue).
  • Today's Open Line: Placed at the current day's starting price (traditionally colored in Yellow).

Key Benefits for Traders

  • Automated Precision: By pulling data directly from the daily timeframe, the script removes the guesswork of manually identifying where "Support" or "Resistance" might be.
  • Dynamic Updates: The script automatically clears old markings and redraws the lines based on the most recent data, ensuring your chart remains clean and up-to-date.
  • Contextual Awareness: It helps traders instantly see if the current price action is trading above or below the previous day's key boundaries, allowing for faster decision-making during live market sessions.
Price Data Components
Series array that contains close prices for each barSeries array that contains open prices of each barSeries array that contains the highest prices of each barSeries array that contains the lowest prices of each bar
10 Views
0 Downloads
0 Favorites
DOSR
//+------------------------------------------------------------------+
//|                  Daily Open-SR Technique                         |
//|                                                         DOSR.mq4 |
//|                                              Developed by mqldev |
//|                                            http://www.mqldev.com |
//+------------------------------------------------------------------+

#property link      "http://www.mqldev.com"


#property indicator_chart_window

extern color   ResistanceColor = Red;
extern color   SupportColor    = Blue;
extern color   TodayOpenColor  = Yellow;

int init()
{
   DelObjs();
   return(0);
}
int deinit()
{
   DelObjs();
   return(0);
}

void start()
{
   double c = iClose(NULL,PERIOD_D1,1);
   double o = iOpen(NULL,PERIOD_D1,1);
   double h = iHigh(NULL,PERIOD_D1,1);
   double l = iLow(NULL,PERIOD_D1,1);
   double to = iOpen(NULL,PERIOD_D1,0);
   
   
   Print("close:",c," open:",o," high:",h," low:",l);
   
   if (c>=o)
   {
      DrawLine(h,"Resistance",ResistanceColor);
      DrawLine(o,"Support",SupportColor);
   }
   else
   {
      DrawLine(o,"Resistance",ResistanceColor);
      DrawLine(l,"Support",SupportColor);
   }
      DrawLine(to,"Today Open",TodayOpenColor);

   return(0);
}

int DrawLine(double price  , string Obj , color clr)
{

   int objs = ObjectsTotal();
   string name;
   for(int cnt=ObjectsTotal()-1;cnt>=0;cnt--)
   {
      name=ObjectName(cnt);
      if (StringFind(name,Obj,0)>-1) 
      {
         ObjectMove(Obj,0,Time[0],price);
         ObjectsRedraw();
         return(1);
      }
   }
   ObjectCreate(Obj,OBJ_HLINE,0,0,price);
   ObjectSet(Obj,OBJPROP_COLOR,clr);
   WindowRedraw();
   return(0);
}

void DelObjs()
{
   int objs = ObjectsTotal();
   string name;
   for(int cnt=ObjectsTotal()-1;cnt>=0;cnt--)
   {
      name=ObjectName(cnt);
      if (StringFind(name,"L",0)>-1) ObjectDelete(name);
      WindowRedraw();
   }
}

Comments