would you be able to assist with coding an arrow where these two lines cross? I realize it might be something simple, but i'm struggling to get the code to work.
and adding an arrow where this line coded above crosses the MovAvgWeighted (OHLC4, 8,0)
Code:
convergence line:
plot MA1 = Average(ohlc4, 16);
plot MA2 = Average(ohlc4, 8);
def DivergenceUp = if MA2 crosses above MA1
then MA2-MA1
else if MA2 > MA1 and MA2-MA1 > DivergenceUp[1]
then MA2-MA1
else DivergenceUp[1];
def halfBack = if MA2-MA1 == DivergenceUp
then barNumber()+1
else halfBack[1];
AddVerticalLine(BarNumber() == HalfBack, "SELL");
and adding an arrow where this line coded above crosses the MovAvgWeighted (OHLC4, 8,0)
Last edited by a moderator: