Does anyone know how to plot RTH Highs, Lows and Mid for ES, NQ futures?? So high and lows and mid should be calculated after market open 9:30 AM EST till Close of market at 4:00 PM EST.
Below code is closest but it's not calculating correct values for Futures..
AutoFib
Click above link and click on expand to see the code. Appreciate your help.
Here is the code ... its picking Globex highs and lows too. I would need the values only for RTH open to close.
Below code is closest but it's not calculating correct values for Futures..
AutoFib
Click above link and click on expand to see the code. Appreciate your help.
Here is the code ... its picking Globex highs and lows too. I would need the values only for RTH open to close.
Code:
input display_rthrs_only = yes;
input ShowTodayOnly = { default "No", "Yes"};
def s = ShowTodayOnly;
input period = {default "Day", "Week", "Month"};
def closeByPeriod = close(period = period)[-1];
def rthrs = SecondsFromTime(0930) >= 0 and SecondsTillTime(1600) > 0;
input Fpos236 = .236;
input Fpos382 = .382;
input Fpos50 = .5;
input Fpos618 = .618;
input Fpos786 = .786;
def rhi = if display_rthrs_only then if !rthrs then Double.NaN else high(period = period) else high(period = period);
def rlo = if display_rthrs_only then if !rthrs then Double.NaN else low(period = period) else low(period = period);
def range = rhi - rlo;
def F236 = rhi - (range * Fpos236);
def F382 = rhi - (range * Fpos382);
def F50 = rhi - (range * Fpos50);
def F618 = rhi - (range * Fpos618);
def F786 = rhi - (range * Fpos786);
plot ORH;
plot ORL;
plot Fib50;
plot Fib236;
plot Fib382;
plot Fib618;
plot Fib786;
if ShowTodayOnly and !IsNaN(closeByPeriod)
then {
ORH = Double.NaN;
ORL = Double.NaN;
Fib50 = Double.NaN;
Fib236 = Double.NaN;
Fib382 = Double.NaN;
Fib618 = Double.NaN;
Fib786 = Double.NaN;
} else {
ORH = rhi;
ORL = rlo;
Fib50 = F50;
Fib236 = F236;
Fib382 = F382;
Fib618 = F618;
Fib786 = F786;
}
;
ORH.SetDefaultColor(Color.GREEN);
ORH.SetStyle(Curve.LONG_DASH);
ORH.SetLineWeight(2);
ORL.SetDefaultColor(Color.RED);
ORL.SetStyle(Curve.LONG_DASH);
ORL.SetLineWeight(2);
Fib50.SetDefaultColor(Color.WHITE);
Fib50.SetStyle(Curve.LONG_DASH);
Fib50.SetLineWeight(1);
Fib236.SetDefaultColor(Color.CYAN);
Fib236.SetStyle(Curve.LONG_DASH);
Fib236.SetLineWeight(1);
Fib382.SetDefaultColor(Color.MAGENTA);
Fib382.SetStyle(Curve.LONG_DASH);
Fib382.SetLineWeight(1);
Fib618.SetDefaultColor(Color.YELLOW);
Fib618.SetStyle(Curve.LONG_DASH);
Fib618.SetLineWeight(1);
Fib786.SetDefaultColor(Color.DARK_RED);
Fib786.SetStyle(Curve.LONG_DASH);
Fib786.SetLineWeight(2);
input showbubbles = yes;
input bubblemover = 5;
def m = bubblemover;
def m1 = m + 1;
AddChartBubble(showbubbles and IsNaN(ORH[m]) and !IsNaN(ORH[m1]), ORH[m1], "H", ORH.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(ORL[m]) and !IsNaN(ORL[m1]), ORL[m1], "L", ORL.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(Fib50[m]) and !IsNaN(Fib50[m1]), Fib50[m1], "50", Fib50.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(Fib236[m]) and !IsNaN(Fib236[m1]), Fib236[m1], "236", Fib236.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(Fib382[m]) and !IsNaN(Fib382[m1]), Fib382[m1], "382", Fib382.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(Fib618[m]) and !IsNaN(Fib618[m1]), Fib618[m1], "618", Fib618.TakeValueColor());
AddChartBubble(showbubbles and IsNaN(Fib786[m]) and !IsNaN(Fib786[m1]), Fib786[m1], "786", Fib786.TakeValueColor());