Draw horizontal High & Low line based on the predefined values

 

Hi,

I want to create an indicator where I am able to define the daily high and low values of each currency pair. This indicator I will be placing in the 15 min and 1 hr chart.

Please find attached an indicator that I have prepared for the same. When I load the indicator for the first time it shows the High and Low horizontal lines correctly as defined in the variables. However the next day when I redefine the variable values the horizonal lines does not update and still shows the previous day High and Low predefined values.

Can you please review the indicator and help me to update this indicator so that when I update the High and Low values in the indicator, the horizontal lines of High and Low value updates on the chart of the respective currency pair accordingly.

Thank you so much for reviewing my request and providing your valuable suggestions.

Regards,

Bharat

Files:
 

HiLo

bharatw:
Hi,

I want to create an indicator where I am able to define the daily high and low values of each currency pair. This indicator I will be placing in the 15 min and 1 hr chart.

Please find attached an indicator that I have prepared for the same. When I load the indicator for the first time it shows the High and Low horizontal lines correctly as defined in the variables. However the next day when I redefine the variable values the horizonal lines does not update and still shows the previous day High and Low predefined values.

Can you please review the indicator and help me to update this indicator so that when I update the High and Low values in the indicator, the horizontal lines of High and Low value updates on the chart of the respective currency pair accordingly.

Thank you so much for reviewing my request and providing your valuable suggestions.

Regards,

Bharat

This indicator should do what you want, I have added a few extra inputs to make the indicator more versatile, as it is currently set up it will automatically select the previous daily High and low however you can use the High_Price / Low_Price inputs to put in a manual price if required plus select any time frame and any number of days/bars back as required and load several different time frame Highs and lows onto the same chart if required. The line colors/width and style are now accessible through the inputs. This gives the indicator the ability to be used to find highs and lows or to place horizontal lines at any point on a chart.

CJA

x_my_high_low_v1.mq4

Files:
 

Thank you

Hi CJA,

Thank you very much for your assistance in improving this further. Much appreciated. Keep up the good work.

Regards,

Bharat

 

Thanks

cja:
This indicator should do what you want, I have added a few extra inputs to make the indicator more versatile, as it is currently set up it will automatically select the previous daily High and low however you can use the High_Price / Low_Price inputs to put in a manual price if required plus select any time frame and any number of days/bars back as required and load several different time frame Highs and lows onto the same chart if required. The line colors/width and style are now accessible through the inputs. This gives the indicator the ability to be used to find highs and lows or to place horizontal lines at any point on a chart.

CJA

x_my_high_low_v1.mq4

Thanks and Regards for your kind help

 

HiLo update

I realized that the version 1 in the above post does not update automatically unless you change timeframes ( I must have been half asleep when I coded it ) so I have altered the indicator to update automatically, some traders may prefer the version 1 as the levels do not update every candle however this now gives you the another option, sorry for any inconvenience.

CJA

x_my_high_low_v2.mq4

Files:
 

Any way to customize the indicator further so one could plot the 55 day high and low?

 
cja:
I realized that the version 1 in the above post does not update automatically unless you change timeframes ( I must have been half asleep when I coded it ) so I have altered the indicator to update automatically, some traders may prefer the version 1 as the levels do not update every candle however this now gives you the another option, sorry for any inconvenience. CJAx_my_high_low_v2.mq4

Thank you very much...this is what I have been looking for.

 

Hello Sir,Its been a long time. Could you please update this indicator to also have weekly and monthly high/low? It only ended in daily high/low. Thank you so much.

Files:
 
romotly007:
Hello Sir,Its been a long time. Could you please update this indicator to also have weekly and monthly high/low? It only ended in daily high/low. Thank you so much.

romotly007

It already can draw those time frames

Set the HiLo_TimeFrame to 10080 for weekly or 43200 for monthly high lows

 
mladen:
romotly007

It already can draw those time frames

Set the HiLo_TimeFrame to 10080 for weekly or 43200 for monthly high lows

u

Okay thank you.

 

Please Sir, can you add a wav alert so that it will sound an alarm when price CLOSES above/below the high/low? Thank you.

Reason: