Meatpye
Pine Script Rookie
Pine Script Rookie
Posts: 1
Joined: February 13th, 2022

Drawing a continous box between 2 Earning dates with HIgh/Low for the period

Hi,

I would like to draw boxes between the Earning Dates.

X1 = The box starts at the previous earning date
X2 = The box finishes at the following earning date
Y1 = The Top of the box is the Highest High between the 2 earning dates
Y2 = The Bottom of the box is the Lowest Low between the 2 earning dates

I would like this to be continuous for as much data that is available.

or X can be series of dates that I nominate for example
X1 = 2018-01-25
X2 = 2018-06-20
X3 = 2018-12-30
X4 = 2019-03-30

Any idea on how to this can be achieved?

Here is an example of what I am trying to achieve (the colour Blue and Yellow are just alternating)
https://www.tradingview.com/x/58f2lERs/

I am currently calculating the above in Excel and hard-coding this into my pine script (box.new).
Any pointers will be greatly appreciated.

Thank you in advance,
Meatpye

processingclouds
Pine Script Master
Pine Script Master
Posts: 115
Joined: January 30th, 2022

Re: Drawing a continous box between 2 Earning dates with HIgh/Low for the period

Hey Meatpye,

I have published the above script, to highlight earning periods and alternate their colors. Sorry for the delay, my internet had been up and down since this week.

You can check out the indicator on. https://www.tradingview.com/script/43Om ... -Earnings/

If you have any other expansion to it, please let me know. You can use the indicator directly from tradingview.

Return to “Request Scripts”