Directional Movement
Forums › ProRealTime English forum › ProBuilder support › Directional Movement
- This topic has 9 replies, 3 voices, and was last updated 7 years ago by Eduardo M.
-
-
05/12/2016 at 3:50 PM #6902
Hi, I’m new in the ProRealCode.
I’m looking for the Directional Movement formula to Prorealotime.
If someone can help me..
Alessandro.
Buongiorno, sono appena iscritto a ProRealCode sto cercando la formula per prorealtime del Directional Movment, purtroppo non la riesco a reperire in rete. Se qualcuno può darmi indicazioni.. grazie
05/14/2016 at 10:33 AM #705505/14/2016 at 10:40 AM #705605/16/2016 at 10:08 AM #715805/26/2016 at 11:57 AM #8110Hello Alex,
At least, here is the code of DMI (which is part of ADX):
1234567891011121314151617181920212223242526272829REM Let's compute +DM & -DMplusDM = max(high-high[1], 0)minusDM = max(low[1]-low, 0)IF plusDM > minusDM THENminusDM = 0ENDIFIF plusDM < minusDM THENplusDM = 0ENDIFIF plusDM = minusDM THENplusDM = 0minusDM = 0ENDIFREM Let's compute the directional indicatorsplusDI = wilderAverage[p](plusDM)minusDI = wilderAverage[p](minusDM)REM Let's compute the ADX indicatorDX = ABS(plusDI - minusDI) / (plusDI + minusDI) * 100myADX = wilderAverage[p](DX)RETURN myADX as "ADX", 25This code is already embedded into the platform (ADX code example). Hope it helps.
12/01/2016 at 8:07 PM #1767912/02/2016 at 7:45 AM #1768912/02/2016 at 12:37 PM #1771012/02/2016 at 12:50 PM #17711Just add :
1p = 7000At the top of the code and verify you have at least 7000 bars already loaded to calculate the ADX indicator:
12345if barindex>p then// all codesendifPlease find below the whole code modified:
123456789101112131415161718192021222324252627282930313233p = 7000 //calculation periodsif barindex>p thenREM Let's compute +DM & -DMplusDM = max(high-high[1], 0)minusDM = max(low[1]-low, 0)IF plusDM > minusDM THENminusDM = 0ENDIFIF plusDM < minusDM THENplusDM = 0ENDIFIF plusDM = minusDM THENplusDM = 0minusDM = 0ENDIFREM Let's compute the directional indicatorsplusDI = wilderAverage[p](plusDM)minusDI = wilderAverage[p](minusDM)REM Let's compute the ADX indicatorDX = ABS(plusDI - minusDI) / (plusDI + minusDI) * 100myADX = wilderAverage[p](DX)endifRETURN myADX as "ADX", 25Of course you’ll need to have at least 7000+ units (candlesticks) displayed on your chart. Let me know if it’s ok.
12/02/2016 at 4:44 PM #17729 -
AuthorPosts
Find exclusive trading pro-tools on