beerguyster
New member
I cant seem to find a renko compatible indicator that draws previous day high/low and globex. I found a Mobius code that does globex and is renko compatible and tried to add previous high/low with my limited knowledge. It works great afterhours but after the open it draws current days high/low. Dont know how to change this line and make it still work with renko brinks. "def RTH =GetTime() > RegularTradingstart(GetYYYYMMDD());" Ideal code would be something I can copy/paste/edit and get to print separate high/low lines going back more then one day. Thanks in advance.
#Renko Compatible
#Over Night High/Low and Previous High/Low
#Mobius Code Modified
def o = open;
def h = high;
def l = low;
def c = close;
def v = volume;
def bar = BarNumber();
def GlobeX = GetTime() < RegularTradingStart(GetYYYYMMDD());
def RTH =GetTime() > RegularTradingstart(GetYYYYMMDD());
def ONhigh = if GlobeX and !GlobeX[1]
then h
else if GlobeX and
h > ONhigh[1]
then h
else ONhigh[1];
def ONhighBar = if GlobeX and h == ONhigh
then bar
else Double.NaN;
def ONlow = if GlobeX and !GlobeX[1]
then l
else if GlobeX and
l < ONlow[1]
then l
else ONlow[1];
def ONlowBar = if GlobeX and l == ONlow
then bar
else Double.NaN;
def OverNightHigh = if BarNumber() == HighestAll(ONhighBar)
then ONhigh
else OverNightHigh[1];
def OverNightLow = if BarNumber() == HighestAll(ONlowBar)
then ONlow
else OverNightLow[1];
plot ONH = if OverNightHigh > 0
then OverNightHigh
else Double.NaN;
ONH.SetPaintingStrategy(PaintingStrategy.DASHES);
ONH.SetDefaultColor(createColor(153,255,153));
ONH.HideBubble();
ONH.HideTitle();
ONH.SetLineWeight (3);
plot ONL = if OverNightLow > 0
then OverNightLow
else Double.NaN;
ONL.SetPaintingStrategy(PaintingStrategy.DASHES);
ONL.SetDefaultColor(Color.pink);
ONL.HideBubble();
ONL.HideTitle();
ONL.SetLineWeight (3);
def PreHigh = if RTH and !RTH[1]
then h
else if RTH and
h > PreHigh[1]
then h
else PreHigh[1];
def HighBar = if RTH and h == PreHigh
then bar
else Double.NaN;
def PreLow = if RTH and !RTH[1]
then l
else if RTH and
l < PreLow[1]
then l
else PreLow[1];
def LowBar = if RTH and l == PreLow
then bar
else Double.NaN;
def DayHigh = if BarNumber() == HighestAll(HighBar)
then PreHigh
else DayHigh[1];
def DayLow = if BarNumber() == HighestAll(LowBar)
then PreLow
else DayLow[1];
plot PREV_High = if DayHigh > 0
then DayHigh
else Double.NaN;
PREV_High.SetPaintingStrategy(PaintingStrategy.DASHES);
PREV_High.SetDefaultColor(Color.DARK_GREEN);
PREV_High.HideBubble();
PREV_High.HideTitle();
PREV_High.SetLineWeight (3);
plot PREV_Low = if DayLow > 0
then DayLow
else Double.NaN;
PREV_Low.SetPaintingStrategy(PaintingStrategy.DASHES);
PREV_Low.SetDefaultColor(Color.DARK_RED);
PREV_Low.HideBubble();
PREV_Low.HideTitle();
PREV_Low.SetLineWeight (3);