Hello, I have a script that paint a 2 hour line on the chart and it works well. I also use the same script for a watchlist and trying to place the price but seems to use the top of the hour (meaning 9 am , 11 AM, 1PM and 3 PM). I was looking for the 9:30, 11:30, 1:30, and 3:30 prices.
Here is the script I hope it's an easy fix as I can't figure it out. Thank you in advance.
def agg = AggregationPeriod.two_HOURS;
def o = open(period = agg)[0];
plot open_horizontal = if Between(GetTime(), RegularTradingStart(GetYYYYMMDD()), RegularTradingEnd(GetYYYYMMDD())) and GetDay() == GetLastDay() then o else Double.NaN;
open_horizontal.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#------------------------------------
# LABEL SECTION
#------------------------------------
AddLabel(yes, "" + o, Color.black );
assignbackgroundColor(
if
o < close then color.green else if
o > close then color.red else color.white);
Here is the script I hope it's an easy fix as I can't figure it out. Thank you in advance.
def agg = AggregationPeriod.two_HOURS;
def o = open(period = agg)[0];
plot open_horizontal = if Between(GetTime(), RegularTradingStart(GetYYYYMMDD()), RegularTradingEnd(GetYYYYMMDD())) and GetDay() == GetLastDay() then o else Double.NaN;
open_horizontal.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#------------------------------------
# LABEL SECTION
#------------------------------------
AddLabel(yes, "" + o, Color.black );
assignbackgroundColor(
if
o < close then color.green else if
o > close then color.red else color.white);