dailybreakm1

Download script
Author: Bill Sica
dailybreakm1

This tool is designed to provide traders with a clear visual representation of key price boundaries based on recent historical data. Specifically, it identifies and plots the highest and lowest price points reached over a rolling five-day period, allowing you to see where the market "broke out" or "held steady" in the immediate past.

How the Logic Works

The script operates by scanning the previous several days of trading activity to establish two specific boundaries:

  • The 5-Day High: The logic looks back at the price action over the last five days and identifies the single highest price point reached during that entire timeframe.
  • The 5-Day Low: Similarly, it scans the same five-day period to locate the single lowest price point achieved.

Visual Implementation

Once the script calculates these two critical values, it performs the following actions on your chart:

  1. Dynamic Tracking: The tool automatically updates its calculations as new data comes in, ensuring the "High" and "Low" lines always reflect the most recent five-day window.
  2. Visual Markers: It draws two horizontal lines across your current chart—one for the high and one for the low. These are styled in an Aqua color with a solid line type to make them easily distinguishable from other price action elements.
  3. Real-Time Feedback: In addition to the visual lines, the script provides a text readout on the screen that displays the exact numerical values of the 5-day high and low.

Purpose for the Trader

By identifying these boundaries, the script helps you visualize "resistance" (the high) and "support" (the low). Traders often use these levels to identify breakout opportunities; if the current price moves above the 5-day high or below the 5-day low, it may signal a significant shift in market momentum.

15 Views
0 Downloads
0 Favorites
dailybreakm1
//+------------------------------------------------------------------+
//|                                                 5dayBreakout.mq4 |
//|                                                        Bill Sica |
//|                                         http://www.tetsuyama.com |
//+------------------------------------------------------------------+
#property copyright "Bill Sica"
#property link      "http://www.tetsuyama.com"

#property indicator_chart_window
//---- input parameters
extern int       DAYS=5;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+

int init()
  {
//---- indicators

//---- indicators

   

//----
   return(0);
  }

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   double daily_high[20];
   double daily_low[20];
   double yesterday_close;
   double phigh,plow;
   int i=1;

//---- TODO: add your code here
ArrayResize(daily_high,DAYS);
ArrayResize(daily_low,DAYS);
ArrayInitialize(daily_high,0);
ArrayInitialize(daily_low,0);

ArrayCopySeries(daily_low, MODE_LOW, Symbol(), PERIOD_M1);
ArrayCopySeries(daily_high, MODE_HIGH, Symbol(), PERIOD_M1);

/* initialise */
plow=daily_low[1];
phigh=daily_high[1];

for(i=1;i<DAYS;i++)
{
   if(plow>daily_low[i])
   {
      plow =daily_low[i];
   }
}

for(i=1;i<DAYS;i++)
{
   if(phigh<daily_high[i])
   {
      phigh =daily_high[i];
   }
}

Comment("\n5dayH ",phigh,"\n5dayL ",plow);

ObjectDelete("5dayHigh");
ObjectDelete("5dayLow");

ObjectCreate("5dayHigh", OBJ_HLINE,0, CurTime(),phigh);
ObjectSet("5dayHigh",OBJPROP_COLOR,Aqua);
ObjectSet("5dayHigh",OBJPROP_STYLE,STYLE_SOLID);

ObjectCreate("5dayLow", OBJ_HLINE,0, CurTime(),plow);
ObjectSet("5dayLow",OBJPROP_COLOR,Aqua);
ObjectSet("5dayLow",OBJPROP_STYLE,STYLE_SOLID);

ObjectsRedraw();

   return(0);
  }
//+------------------------------------------------------------------

Comments