Can somone please help me to change this code to remove the chart bubles and replace them with .BOOLEAN_ARROW so it will display the arrows on mobile platform, I know the label wont work but I really want the arrows.
def RTH = getTime() >= regularTradingStart(getYYYYMMDD()) and
getTime() <= regularTradingEnd(getYYYYMMDD());
def o = if RTH and !RTH[1]
then open("$ADndd")
else o[1];
def c = if isNaN(close("$ADndd"))
then c[1]
else close("$ADndd");
def x = barNumber();
def sumx = if RTH and !RTH[1]
then 1
else if RTH then sumx[1] + 1
else if !RTH
then sumx[1]
else sumx[1];
def sumAD = if RTH and !RTH[1]
then c
else if RTH
then sumAD[1] + c
else sumAD[1];
def h = if isNaN(high("$ADndd", "DAY"))
then h[1]
else high("$ADndd", "DAY");
def ADHighBar = if high("$ADndd") == h
then x
else double.nan;
AddChartBubble(barNumber() == HighestAll(ADHighBar),
high + (2 * TickSize()),
"AD",
color.cyan);
def l = if isNaN(low("$ADndd", "DAY"))
then l[1]
else low("$ADndd", "DAY");
def ADLowBar = if low("$ADndd") == l
then x
else double.nan;
AddChartBubble(barNumber() == HighestAll(ADLowBar),
low - (2 * TickSize()),
"AD",
color.orange,
no);
def Avg = Round(sumAD / sumx, 0);
addLabel(1, "AD open " + o +
" high " + h +
" low " + l +
" close " + c +
" Avg " + Avg, if c < 0
then color.red
else color.green);
# End Code AD Label
def RTH = getTime() >= regularTradingStart(getYYYYMMDD()) and
getTime() <= regularTradingEnd(getYYYYMMDD());
def o = if RTH and !RTH[1]
then open("$ADndd")
else o[1];
def c = if isNaN(close("$ADndd"))
then c[1]
else close("$ADndd");
def x = barNumber();
def sumx = if RTH and !RTH[1]
then 1
else if RTH then sumx[1] + 1
else if !RTH
then sumx[1]
else sumx[1];
def sumAD = if RTH and !RTH[1]
then c
else if RTH
then sumAD[1] + c
else sumAD[1];
def h = if isNaN(high("$ADndd", "DAY"))
then h[1]
else high("$ADndd", "DAY");
def ADHighBar = if high("$ADndd") == h
then x
else double.nan;
plot bullishArrow = barNumber() == HighestAll(ADHighBar);
bullishArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_down);
bullishArrow.SetDefaultColor(Color.CYAN);
def l = if isNaN(low("$ADndd", "DAY"))
then l[1]
else low("$ADndd", "DAY");
def ADLowBar = if low("$ADndd") == l
then x
else double.nan;
plot bearishArrow = barNumber() == HighestAll(ADLowBar);
bearishArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_up);
bearishArrow.SetDefaultColor(Color.ORANGE);
def Avg = Round(sumAD / sumx, 0);
# End Code AD Label
def RTH = getTime() >= regularTradingStart(getYYYYMMDD()) and
getTime() <= regularTradingEnd(getYYYYMMDD());
def o = if RTH and !RTH[1]
then open("$ADndd")
else o[1];
def c = if isNaN(close("$ADndd"))
then c[1]
else close("$ADndd");
def x = barNumber();
def sumx = if RTH and !RTH[1]
then 1
else if RTH then sumx[1] + 1
else if !RTH
then sumx[1]
else sumx[1];
def sumAD = if RTH and !RTH[1]
then c
else if RTH
then sumAD[1] + c
else sumAD[1];
def h = if isNaN(high("$ADndd", "DAY"))
then h[1]
else high("$ADndd", "DAY");
def ADHighBar = if high("$ADndd") == h
then x
else double.nan;
AddChartBubble(barNumber() == HighestAll(ADHighBar),
high + (2 * TickSize()),
"AD",
color.cyan);
def l = if isNaN(low("$ADndd", "DAY"))
then l[1]
else low("$ADndd", "DAY");
def ADLowBar = if low("$ADndd") == l
then x
else double.nan;
AddChartBubble(barNumber() == HighestAll(ADLowBar),
low - (2 * TickSize()),
"AD",
color.orange,
no);
def Avg = Round(sumAD / sumx, 0);
addLabel(1, "AD open " + o +
" high " + h +
" low " + l +
" close " + c +
" Avg " + Avg, if c < 0
then color.red
else color.green);
# End Code AD Label
I changed it to this and it works but still not on mobile tosCan somone please help me to change this code to remove the chart bubles and replace them with .BOOLEAN_ARROW so it will display the arrows on mobile platform, I know the label wont work but I really want the arrows.
def RTH = getTime() >= regularTradingStart(getYYYYMMDD()) and
getTime() <= regularTradingEnd(getYYYYMMDD());
def o = if RTH and !RTH[1]
then open("$ADndd")
else o[1];
def c = if isNaN(close("$ADndd"))
then c[1]
else close("$ADndd");
def x = barNumber();
def sumx = if RTH and !RTH[1]
then 1
else if RTH then sumx[1] + 1
else if !RTH
then sumx[1]
else sumx[1];
def sumAD = if RTH and !RTH[1]
then c
else if RTH
then sumAD[1] + c
else sumAD[1];
def h = if isNaN(high("$ADndd", "DAY"))
then h[1]
else high("$ADndd", "DAY");
def ADHighBar = if high("$ADndd") == h
then x
else double.nan;
AddChartBubble(barNumber() == HighestAll(ADHighBar),
high + (2 * TickSize()),
"AD",
color.cyan);
def l = if isNaN(low("$ADndd", "DAY"))
then l[1]
else low("$ADndd", "DAY");
def ADLowBar = if low("$ADndd") == l
then x
else double.nan;
AddChartBubble(barNumber() == HighestAll(ADLowBar),
low - (2 * TickSize()),
"AD",
color.orange,
no);
def Avg = Round(sumAD / sumx, 0);
addLabel(1, "AD open " + o +
" high " + h +
" low " + l +
" close " + c +
" Avg " + Avg, if c < 0
then color.red
else color.green);
# End Code AD Label
def RTH = getTime() >= regularTradingStart(getYYYYMMDD()) and
getTime() <= regularTradingEnd(getYYYYMMDD());
def o = if RTH and !RTH[1]
then open("$ADndd")
else o[1];
def c = if isNaN(close("$ADndd"))
then c[1]
else close("$ADndd");
def x = barNumber();
def sumx = if RTH and !RTH[1]
then 1
else if RTH then sumx[1] + 1
else if !RTH
then sumx[1]
else sumx[1];
def sumAD = if RTH and !RTH[1]
then c
else if RTH
then sumAD[1] + c
else sumAD[1];
def h = if isNaN(high("$ADndd", "DAY"))
then h[1]
else high("$ADndd", "DAY");
def ADHighBar = if high("$ADndd") == h
then x
else double.nan;
plot bullishArrow = barNumber() == HighestAll(ADHighBar);
bullishArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_down);
bullishArrow.SetDefaultColor(Color.CYAN);
def l = if isNaN(low("$ADndd", "DAY"))
then l[1]
else low("$ADndd", "DAY");
def ADLowBar = if low("$ADndd") == l
then x
else double.nan;
plot bearishArrow = barNumber() == HighestAll(ADLowBar);
bearishArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_up);
bearishArrow.SetDefaultColor(Color.ORANGE);
def Avg = Round(sumAD / sumx, 0);
# End Code AD Label
Last edited by a moderator: