Help: Building a Delta Divergence Indicator

Forums ProRealTime English forum ProBuilder support Help: Building a Delta Divergence Indicator

Viewing 6 posts - 1 through 6 (of 6 total)
  • #230497

    Hi everyone,

    I have a delta indicator and an RSI divergence indicator that show divergences in different ways. I’d like to build a new indicator that combines these functionalities. Ideally, the new indicator would display labels directly on the price chart for both regular and hidden delta divergences.

    Has anyone created a similar indicator before? Any guidance or code snippets would be greatly appreciated!

    #230500

    If you post their code I can try to combine them.

     

    1 user thanked author for this post.
    #230501

    Thank you so much I really appreciate it. 🙂

    here you go:

    this is the Delta script:

    if(close>=open and (close-open+2*(high-close)+2*(open-low)))>0 then
    U1= volume*(high-low)/(close-open+2*(high-close)+2*(open-low))
    else
    U1=0.0
    endif
    //D1
    if(close<open and (open-close+2*(high-open)+2*(close-low)))>0 then
    D1 = volume*(high-low)/(open-close+2*(high-open)+2*(close-low))
    else
    D1=0.0
    endif
    //Delta
    if(close>=open) then
    Delta= U1
    else
    Delta= -D1
    endif

    if barindex>1 then
    cumDelta=(cumDelta[1])+Delta

    if close>=open then
    hi= cumDelta
    else
    hi =cumDelta[1]
    endif
    if close<=open then
    lo= cumDelta
    else
    lo=cumDelta[1]
    endif

    drawcandle(cumDelta[1], hi, lo, cumDelta)

    endif

    RETURN

     

     

    and then the RSI Divergence

     

    Rge = averagetruerange[10](close)
    MyRSI = rsi[RsiPeriod](Close)

    ONCE ShiftText = 3

    RsiMax = MyRSI < MyRSI[1] and MyRSI[1] > MyRSI[2] and MyRSI[1] > RsiOverBought
    RsiMin = MyRSI > MyRSI[1] and MyRSI[1] < MyRSI[2] and MyRSI[1] < RsiOverSold

    if RsiMax then
    RSIMax1 = MyRSI[1]
    High1 = High[1]

    for I = MinBarRange to 80
    if RsiMax[I] then
    RSIMax2 = MyRSI[I + 1]
    High2 = High[I + 1]
    If High1 > High2 and RSIMax1 < RSIMax2 then
    DRAWARROWDOWN(barindex, High + Rge / ShiftText)coloured(255,192,203,255)
    DRAWTEXT(“dd”, barindex, High + Rge / ShiftText / 0.3,SansSerif,Italic,10)coloured(0,0,255,255)
    elsif High1 < High2 and RSIMax1 > RSIMax2 then
    DRAWARROWDOWN(barindex, High + Rge / ShiftText)coloured(255,192,203,255)
    DRAWTEXT(“hd”, barindex, High + Rge / ShiftText / 0.2,SansSerif,Italic,10)coloured(0,0,255,255)
    endif
    break
    endif
    next
    endif

    if RsiMin then
    RSIMin1 = MyRSI[1]
    Low1 = Low[1]
    for I = MinBarRange to 80
    if RSIMin[I] then
    RSIMin2 = MyRSI[I + 1]
    Low2 = Low[I + 1]
    If Low1 < Low2 and RSIMin1 > RSIMin2 then
    DRAWARROWUP(barindex, lOW – Rge / ShiftText)coloured(0,0,255,255)
    DRAWTEXT(“dd”, barindex, lOW – Rge / ShiftText / 0.3,SansSerif,Italic,10)coloured(0,0,255,255)
    elsif Low1 > Low2 and RSIMin1 < RSIMin2 then
    DRAWARROWUP(barindex, lOW – Rge / ShiftText)coloured(0,0,255,255)
    DRAWTEXT(“hd”, barindex, lOW – Rge / ShiftText / 0.2,SansSerif,Italic,10)coloured(0,0,255,255)
    endif
    break
    endif
    next
    endif

    return

     

    #230862

    The divergence indicator already plots signals on the price chart.

    How would you like to have the other indicator be plotted on the chart?

     

    #230969

    Well it will be great if is the same as RSI signals print on the price. Thank you in advance 🙂

    #231500

    The DELTA indicator cannot be properly plotted on the chart, as its scale is quite different fom that of the price.

    As you can see from the attached pic, to be able to spot the indicator you need to shrink the chart so that the price is similar to a flat line.

     

    1 user thanked author for this post.
Viewing 6 posts - 1 through 6 (of 6 total)

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