hazmat8039
New member
I have this indicator for the ORB and i was wondering why this does not work on mobile, anway someone can tell me why? and possibly help me to convert it to be mobile friendly?
Code:
input openingRangeStartTimeEST = 930;
input openingRangeEndTimeEST = 1000;
def openingRange = if SecondsTillTime(openingRangeStartTimeEST) <= 0 and SecondsTillTime(openingRangeEndTimeEST) >= 0 then 1 else 0;
input entryType = {default wickTouch, closeAbove};
input tradeEntryStartTimeEST = 930;
input tradeEntryEndTimeEST = 1600;
def tradeEntryRange = if SecondsTillTime(tradeEntryStartTimeEST) <= 0 and SecondsTillTime(tradeEntryEndTimeEST) >= 0 then 1 else 0;
def openingRangeHigh = if SecondsTillTime(openingRangeStartTimeEST) == 0 then high else if openingRange and high > openingRangeHigh[1] then high else openingRangeHigh[1];
def openingRangeLow = if SecondsTillTime(openingRangeStartTimeEST) == 0 then low else if openingRange and low < openingRangeLow[1] then low else openingRangeLow[1];
plot tradeEntryHighExtension = if tradeEntryRange then openingRangeHigh else double.nan;
plot tradeEntryLowExtension = if tradeEntryRange then openingRangeLow else double.nan;
tradeEntryHighExtension.setPaintingStrategy(PaintingStrategy.Horizontal);
tradeEntryLowExtension.setPaintingStrategy(PaintingStrategy.Horizontal);
tradeEntryHighExtension.setStyle(Curve.FIRM);
tradeEntryLowExtension.setStyle(Curve.FIRM);
tradeEntryHighExtension.setDefaultColor(Color.CYAN);
tradeEntryLowExtension.setDefaultColor(Color.CYAN);
def bullEntryCondition;
def bearEntryCondition;
switch(entryType){
case wickTouch:
bullEntryCondition = tradeEntryRange and high > openingRangeHigh and high[1] <= openingRangeHigh;
bearEntryCondition = tradeEntryRange and low < openingRangeLow and low[1] >= openingRangeLow;
case closeAbove:
bullEntryCondition = tradeEntryRange and close > openingRangeHigh and close[1] <= openingRangeHigh;
bearEntryCondition = tradeEntryRange and close < openingRangeLow and close[1] >= openingRangeLow;
}
def bullishORB = if bullEntryCondition then 1 else if !tradeEntryRange then 0 else bullishORB[1];
def bearishORB = if bearEntryCondition then 1 else if !tradeEntryRange then 0 else bearishORB[1];
def range = openingRangeHigh - OpeningRangeLow;
def halfRange = range / 2;
def midRange = openingRangeLow + halfRange;
plot midRangePlot = if tradeEntryRange then midRange else double.nan;
midRangePlot.setPaintingStrategy(PaintingStrategy.Horizontal);
midRangePlot.setStyle(Curve.Short_Dash);
midRangePlot.setDefaultColor(Color.VIOLET);
#-------------------------
def P1 = openingRangehigh + halfRange;
plot P1Plot = if bullishORB and tradeEntryRange then P1 else double.nan;
P1Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
P1Plot.setDefaultColor(Color.Light_Green);
#-------------------------
def P2 = openingRangehigh + range;
plot P2Plot = if bullishORB and tradeEntryRange then P2 else double.nan;
P2Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
P2Plot.setDefaultColor(Color.Light_Green);
#-----------------------------------
def P3 = openingRangehigh + range + halfrange;
plot P3Plot = if bullishORB and tradeEntryRange then P3 else double.nan;
P3Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
P3Plot.setDefaultColor(Color.Green);
#-----------------------------------
def P4 = openingRangehigh + range + range;
plot P4Plot = if bullishORB and tradeEntryRange then P4 else double.nan;
P4Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
P4Plot.setDefaultColor(Color.Green);
#-----------------------------------
def P5 = openingRangehigh + range + range + halfrange;
plot P5Plot = if bullishORB and tradeEntryRange then P5 else double.nan;
P5Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
P5Plot.setDefaultColor(Color.Green);
#------------------------------------
def P6 = openingRangehigh + range + range + range;
plot P6Plot = if bullishORB and tradeEntryRange then P6 else double.nan;
P6Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
P6Plot.setDefaultColor(Color.DARK_Green);
#------------------------------------
def P7 = openingRangehigh + range + range + range + halfRange;
plot P7Plot = if bullishORB and tradeEntryRange then P7 else double.nan;
P7Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
P7Plot.setDefaultColor(Color.DARK_Green);
#-----------------------------------
def P8 = openingRangehigh + range + range + range + range;
plot P8Plot = if bullishORB and tradeEntryRange then P8 else double.nan;
P8Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
P8Plot.setDefaultColor(Color.DARK_Green);
#-----------------------------------
def D1 = openingRangelow - halfRange;
plot D1Plot = if bearishORB and tradeEntryRange then D1 else double.nan;
D1Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
D1Plot.setDefaultColor(Color.ORANGE);
#---------------------------------
def D2 = openingRangelow - range;
plot D2Plot = if bearishORB and tradeEntryRange then D2 else double.nan;
D2Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
D2Plot.setDefaultColor(Color.ORANGE);
#---------------------------
def D3 = openingRangelow - range - halfrange;
plot D3Plot = if bearishORB and tradeEntryRange then D3 else double.nan;
D3Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
D3Plot.setDefaultColor(Color.Red);
#-----------------------------
def D4 = openingRangelow - range - range;
plot D4Plot = if bearishORB and tradeEntryRange then D4 else double.nan;
D4Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
D4Plot.setDefaultColor(Color.Red);
#-----------------------------
def D5 = openingRangelow - range - range - halfRange;
plot D5Plot = if bearishORB and tradeEntryRange then D5 else double.nan;
D5Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
D5Plot.setDefaultColor(Color.Red);
#------------------------------
def D6 = openingRangelow - range - range - range;
plot D6Plot = if bearishORB and tradeEntryRange then D6 else double.nan;
D6Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
D6Plot.setDefaultColor(Color.Red);
#-------------------------------
def D7 = openingRangelow - range - range - range - halfRange;
plot D7Plot = if bearishORB and tradeEntryRange then D7 else double.nan;
D7Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
D7Plot.setDefaultColor(Color.DARK_Red);
#------------------------------------
def D8 = openingRangelow - range - range - range - range;
plot D8Plot = if bearishORB and tradeEntryRange then D8 else double.nan;
D8Plot.setPaintingStrategy(PaintingStrategy.Horizontal);
D8Plot.setDefaultColor(Color.DARK_Red);