Hello Usethink team,
I am trying for a script that can count number crosses below adaptive MA while RSI > 55 and plot accordingly if count is some number , egxample if count is 2 then arrorw yellow and count is >= 3 arrow Red,
I have tried the below but it created the arrow for every cross and it messes the chartOne
if u see the yellow arrow on every close below adaptive , thats what I want to get rid off , instead am looking to count those crosses and create a condtion if they sum up to some number
I am trying for a script that can count number crosses below adaptive MA while RSI > 55 and plot accordingly if count is some number , egxample if count is 2 then arrorw yellow and count is >= 3 arrow Red,
I have tried the below but it created the arrow for every cross and it messes the chartOne
if u see the yellow arrow on every close below adaptive , thats what I want to get rid off , instead am looking to count those crosses and create a condtion if they sum up to some number
Code:
def AdapDnX = if RSIRef > 55 within 13 bars and close crosses below AdaptiveMARef then 1 else 0;
def DnXCount = CompoundValue(1, if AdapDnX then DnXCount[1] + 1 else 0, 0);
plot DnXCount2 = if DnXCount < 2 then DnXCount else double.nan;
DnXCount2.setPaintingStrategy(PaintingStrategy.BooLEAN_ARROW_DOWN);
DnXCount2.setDefaultColor(Color.Yellow);
plot DnXCount3 = if DnXCount >3 then DnXCount else double.nan;
DnXCount3.setPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
DnXCount3.setDefaultColor(Color.RED);