indicator with exrem function (Pine script)

Forums ProRealTime English forum ProBuilder support indicator with exrem function (Pine script)

Viewing 2 posts - 1 through 2 (of 2 total)
  • #225979
    #226001

    //below my conversion of your indicator :

    once signal=0
    //EMA
    fastema = ExponentialAverage[9](close)
    slowema = ExponentialAverage[18](close)

    //MACD
    macdl=MACDline[12,26,9](close)
    //Supertrend
    ST=Supertrend[3,10]
    // Conditions
    conditionA =st>=ST[1] and fastema > slowema and macdL > MACDSignal[12,26,9](close) and close > supertrend
    conditionb=st<ST[1]and fastema < slowema and macdL < MACDSignal[12,26,9](close) and close < supertrend
    if conditionA and not conditionA[1] then
    signal=1
    endif
    if conditionB and not conditionB[1] then
    signal=2
    endif
    if signal=1 and signal[1]=2 then
    DRAWARROWUP(barindex,ST)coloured(0,0,255)
    endif
    if signal=2 and signal[1]=1 then
    DRAWARROWDOWN(barindex,ST)coloured(255,0,0)
    endif
    return ST as “supertrend”

    3 users thanked author for this post.
Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login