Horizontal lines between the specific dates

Hi,
I am looking to draw mean horizontal lines on regular intervals between specific days. For example, there are two intervals, from the 25th date of the month to the 10th day of next month, 11th to 24th date of the month.
Part 1 ) Taking the example of the 25th date of the month to the 10th day of next month, I would be calculating the mean line for the date range by using Open and low of the first trading day and High and close of the last trading day between 19th and 24th of the same month.

Part 2) Similarly, we will calculate the date range of 11th and 24th of the month.

I would like this to automatically add mean lines for all the days on my chart.

Could someone please assist me with it?

Kind regards,
Priyesh

``````start_day = 11;
end_day = 24;

dd = Day();

// 11th / 24th
start1 = dd >= start_day AND Ref(dd,-1) < start_day;
end1 = dd >= end_day AND Ref(dd,-1) < end_day;

// 25th / 10th
start2 = NOT end1 AND Ref(end1,-1);
end2 = NOT start1 AND Ref(start1,1);
``````

As for getting values at start marker being available at end marker... see ValueWhen function.

apologies for the delayed response. Thank for the code. I would apply the code today.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.