AntMan
New member
I need help with a study.. below is the code.. when it's set opentime 0930 and ORend 1600 it draws the lines all the way across the chart, but when I set it to an intraday range, like 0930-1030, the lines stop at 1030 and do not draw to the end of day at 1600.. how do I code it so that the lines draw to end of day no matter what?
also, if anyone can tell me how to post an image, I'd appreciate that too.. I pasted the link but I get a message "Image cannot be loaded from passed link" and I'm unable to just copy & paste an image, so I included a link to the screenshot below.. thanks in advance..
screenshot link
declare hide_on_daily;
input opentime = 0930;
input ORend = 1600;
def na = Double.NaN;
#
# Check if the RTH opening time is now
#
def ORActive = if GetLastDay() == GetDay() and SecondsFromTime(opentime) >= 0 and SecondsFromTime(ORend) < 0 then 1 else 0;
#
# Track the intraday high and low
#
def ORHigh = if ORActive then high else na;
def ORLow = if ORActive then low else na;
#
# Plot the intraday high and low
#
plot ORAH = if GetLastDay() != GetDay() or !ORActive then na else HighestAll(ORHigh);
plot ORAL = if GetLastDay() != GetDay() or !ORActive then na else LowestAll(ORLow);
# Formatting
#
ORAH.SetStyle(Curve.LONG_DASH);
ORAL.SetStyle(Curve.LONG_DASH);
ORAH.SetDefaultColor(Color.RED);
ORAL.SetDefaultColor(Color.GREEN);
also, if anyone can tell me how to post an image, I'd appreciate that too.. I pasted the link but I get a message "Image cannot be loaded from passed link" and I'm unable to just copy & paste an image, so I included a link to the screenshot below.. thanks in advance..
screenshot link
declare hide_on_daily;
input opentime = 0930;
input ORend = 1600;
def na = Double.NaN;
#
# Check if the RTH opening time is now
#
def ORActive = if GetLastDay() == GetDay() and SecondsFromTime(opentime) >= 0 and SecondsFromTime(ORend) < 0 then 1 else 0;
#
# Track the intraday high and low
#
def ORHigh = if ORActive then high else na;
def ORLow = if ORActive then low else na;
#
# Plot the intraday high and low
#
plot ORAH = if GetLastDay() != GetDay() or !ORActive then na else HighestAll(ORHigh);
plot ORAL = if GetLastDay() != GetDay() or !ORActive then na else LowestAll(ORLow);
# Formatting
#
ORAH.SetStyle(Curve.LONG_DASH);
ORAL.SetStyle(Curve.LONG_DASH);
ORAH.SetDefaultColor(Color.RED);
ORAL.SetDefaultColor(Color.GREEN);