Help: Building a Delta Divergence Indicator
Forums › ProRealTime English forum › ProBuilder support › Help: Building a Delta Divergence Indicator
- This topic has 5 replies, 2 voices, and was last updated 7 months ago by robertogozzi.
-
-
03/26/2024 at 2:41 PM #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!
03/26/2024 at 3:01 PM #23050003/26/2024 at 3:19 PM #230501Thank 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
endifif barindex>1 then
cumDelta=(cumDelta[1])+Deltaif close>=open then
hi= cumDelta
else
hi =cumDelta[1]
endif
if close<=open then
lo= cumDelta
else
lo=cumDelta[1]
endifdrawcandle(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] < RsiOverSoldif 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
endifif 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
endifreturn
04/01/2024 at 9:21 PM #230862The divergence indicator already plots signals on the price chart.
How would you like to have the other indicator be plotted on the chart?
04/03/2024 at 9:50 AM #23096904/14/2024 at 4:04 PM #231500The 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.
-
AuthorPosts
Find exclusive trading pro-tools on