Author: 2005 Free software for trader
Daily HL

This tool is designed to provide traders with a clear visual reference of previous market boundaries by identifying and plotting the high and low price points from the preceding trading day. By highlighting these levels, the script helps users understand where significant price action occurred in the past, which can serve as key areas of interest for current market analysis.

Core Functionality

The script automatically scans historical data to find the specific peak (highest price) and trough (lowest price) reached during each full day of trading. Instead of requiring the user to manually identify these levels, the tool identifies them dynamically based on the daily timeframe.

How it Works

  • Data Collection: The logic begins by gathering price data for the "Daily" period. It specifically looks for the highest and lowest values recorded between the start and end of each previous day.
  • Day-by-Day Tracking: The script iterates through the history of the chart bar by bar. Every time it detects a change in the calendar day, it updates its reference to the high and low prices of the day that just concluded.
  • Visual Mapping: Once these values are identified, the tool projects them onto your current chart. It draws two distinct lines:
    • A Blue Line representing the previous day's highest price.
    • A Red Line representing the previous day's lowest price.
  • Continuous Updating: As time moves forward and new days conclude, the script automatically shifts its focus, ensuring that the lines always reflect the most recent completed daily boundaries.

Key Benefits for Traders

This indicator simplifies technical analysis by providing immediate "Support" and "Resistance" context. By seeing where yesterday's price action peaked and bottomed out, traders can more easily spot potential reversal zones or breakout points in real-time market movement.

Miscellaneous
Implements a curve of type %1
7 Views
0 Downloads
0 Favorites
Daily HL
//+------------------------------------------------------------------+
//| DailyHL.mq4 |
//| These are the days highest high and lowest low |
//| Written by: Ice |
//| |
//+------------------------------------------------------------------+
#property copyright "2005 Free software for trader"

#property indicator_chart_window
#property indicator_buffers 2

#property indicator_color1 Blue
#property indicator_color2 Red


//---- input parameters\

datetime BT[];
double YesterdayHigh[50];
double YesterdayLow[50];
double YesterdayClose[50];
//---- buffers

double HighArray[];
double LowArray[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
// Pivot
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,HighArray);
IndicatorShortName("High Line");

// Resistance 1
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,LowArray);
SetIndexLabel(3,"Low Line");

return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();

ArrayResize(BT, Bars); Print("Bars = " + Bars);
// Fill BT with bar open TIME
ArrayCopySeries(BT, MODE_TIME);
// Fill temp arrays with High, Low and Close prices per day
ArrayCopySeries(YesterdayHigh, MODE_HIGH, Symbol(), PERIOD_D1);
ArrayCopySeries(YesterdayLow, MODE_LOW, Symbol(), PERIOD_D1);
ArrayCopySeries(YesterdayClose, MODE_CLOSE, Symbol(), PERIOD_D1);

int od = 0;
int dd = 0;


double HighLine;
double LowLine;

//Cycle through all the bars and fill the indicator bars with the Pivot point values
for (int i = 0; i <= Bars; i++) {
if (TimeDay(BT[i]) != od) {
dd++;
HighLine = YesterdayHigh[dd-1];
LowLine = YesterdayLow[dd-1];
od = TimeDay(BT[i]);
}

HighArray[i] = HighLine;
LowArray[i]=LowLine;
}

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

Comments