candle pair count pine script trading view

60 views Asked by At

`why pair counter in my code not working

pine script v5

Example:
GGGG RR should be count as 1 Pair the if it again happen say GG RRRR then that should be (previous pair+1) Candle body should be more than 5 (abs(open-close)>5) Close should be above (10,3)

If close goes below supertrend then pair counter reset to 0 again then start again as pair 1,2.. as the case may be.

@vitruvius I am looking similar solution in my post with few tweaks.

Here is your post count the number of green candles after each red candle untill we reach to the next green candle?

I also want to put counter on string of same color candle streak which increase to +1 as the candle streak change color and also meet few other conditions listed below.

Close (0) > Supertrend
ABS(Open-Close)>5
Counter reset to 0 if Close<Supertrend

` Screenshot reference: https://postimg.cc/T5YpyxPD

Code reference at pastebin https://pastebin.com/aHshdTkG
0

There are 0 answers