Welcome to the BEST forum for traders

Did you know we're sharing tons of exclusive content here?
Our community is growing quickly. Take a look around and say "Hello".

indicator

Jan 28, 2023 - 9:31 AM

Viewed 614 times

https://best-trading-indicator.com/community/bti/forums/4180/topics/1623732 COPY
  • Hello everyone, I want to write an indicator. I want to show A on top of red candles and B on top of green candles. Then, if the combination of ABAA occurs, I want a red line to appear on that combination.
    I print the characters A and B on the candles like this:
    //@version=4
    study('Example', overlay=true)
    B = close >= open
    plotchar(B, char='B')
    A = close <= open
    plotchar(A, char='A')

    but I don't know how the red line code will be on ABAA combinations. Please help me!!!

    0
  • //@version=4
    study('Example', overlay=true)
    B = close >= open
    plotchar(B, char='B', location = location.abovebar)
    A = close <= open
    plotchar(A, char='A', location = location.belowbar)
    
    // detect ABAA
    ABAA_cond = A and A[1] and B[2] and A[3]
    
    plot(ABAA_cond and not ABAA_cond[1] ? close : na, color = color.red, title = "ABAA", style=plot.style_linebr, linewidth=2)
    
    
    0
  • Dave Dave (@davedave):

    thank you

    0
CONTENTS