rlohmeyer
Active member
I am not a coder, but I dabble.....I have been dabbling with various code snippets for day trying to get code to plot a horizontal line off the PREVIOUS RTH session close that extends through the next RTH session and still be able to show overnight session. I have code, share by a friend, that does this nicely for the PRESENT RTH session open, see attached image and code.
If anyone can point me in the direction of how to modify this code to incude a PREVIOUS RTH session close line, it would be greatly appreciated.
# JimmyMack 2018
input aggregationPeriod = AggregationPeriod.DAY;
input showOnlyLastPeriod = yes;
def prevPrice = open(period = aggregationPeriod)[-1];
def price = open(period = aggregationPeriod);
plot DailyOpen = if showOnlyLastPeriod and !IsNaN(prevPrice) then Double.NaN else price;
DailyOpen.SetDefaultColor(GetColor(2));
DailyOpen.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
The image below shows the Yellow PRESENT RTH Session open line.
If anyone can point me in the direction of how to modify this code to incude a PREVIOUS RTH session close line, it would be greatly appreciated.
# JimmyMack 2018
input aggregationPeriod = AggregationPeriod.DAY;
input showOnlyLastPeriod = yes;
def prevPrice = open(period = aggregationPeriod)[-1];
def price = open(period = aggregationPeriod);
plot DailyOpen = if showOnlyLastPeriod and !IsNaN(prevPrice) then Double.NaN else price;
DailyOpen.SetDefaultColor(GetColor(2));
DailyOpen.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
The image below shows the Yellow PRESENT RTH Session open line.
