ADX Line on MA Line
- This topic has 3 replies, 2 voices, and was last updated 7 years ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
Similar topics:
Forums › ProRealTime English forum › ProBuilder support › ADX Line on MA Line
Good Day
Is it possible to return two different types of lines in one indicator i.e. an MA and an ADX?
I tried below but obviously, only the MA line is returned as ProBuilder probably doesn’t know against what reference to draw the ADX line;
Was thinking maybe to use the MA line itself a the ‘zero’ line and let the ADX line rise of the MA? Any ideas how to do that?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
//variables to add: //RSIPeriod (Default: 2) //MAPeriod (Default: 21) //MAType (Default: 2) //RSIUpperThreshold (Default: 95) //RSILowerThreshold (Default: 5) //ADXPeriod (Default: 21) myrsi=RSI[RSIPeriod](close) myma=Average[MAPeriod,MAType](close) If myrsi>RSIUpperThreshold then r=255 g=0 b=0 Elsif myrsi<RSILowerThreshold then r=0 g=255 b=0 Else r=0 g=0 b=0 endif myADX = ADX[ADXPeriod] return myma coloured(r,g,b) as "Hybrid MA", myADX coloured(0,0,0) as "Average Directional Index" |
I found a temporary solution playing around with colors:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
//variables to add: //RSIPeriod (Default: 2) //MAPeriod (Default: 21) //MAType (Default: 2) //RSIUpperThreshold (Default: 95) //RSILowerThreshold (Default: 5) //ADXPeriod (Default: 21) //ADXRef (Default: 2) //ADXMinThreshold (Default: 10) myrsi=RSI[RSIPeriod](close) myma=Average[MAPeriod,MAType](close) myADX = ADX[ADXPeriod] If myrsi>RSIUpperThreshold then r=255 g=0 b=0 Elsif myrsi<RSILowerThreshold then r=0 g=255 b=0 Elsif myrsi>RSIUpperThreshold and myADX > myADX[ADXRef] and myADX >= ADXMinThreshold then //ADX Rising and Overbought r=139 g=0 b=255 Elsif myrsi<RSILowerThreshold and myADX > myADX[ADXRef] and myADX >= ADXMinThreshold then //ADX Falling and Oversold r=3 g=192 b=60 Elsif myrsi<RSIUpperThreshold and myrsi>RSILowerThreshold and (myADX > myADX[ADXRef] and myADX >= ADXMinThreshold) then //ADX Rising r=0 g=0 b=255 Elsif myrsi<RSIUpperThreshold and myrsi>RSILowerThreshold and (myADX < myADX[ADXRef] or myADX < ADXMinThreshold) then //ADX Falling r=0 g=0 b=0 endif return myma coloured(r,g,b) as "Hybrid MA" |
Suppose I am happy with the colors one:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
//variables to add: //RSIPeriod (Default: 2) //MAPeriod (Default: 21) //MAType (Default: 2) //RSIUpperThreshold (Default: 95) //RSILowerThreshold (Default: 5) //ADXPeriod (Default: 21) //ADXRef (Default: 2) //ADXMinThreshold (Default: 10) myrsi=RSI[RSIPeriod](close) myma=Average[MAPeriod,MAType](close) myADX = ADX[ADXPeriod] If myrsi>RSIUpperThreshold and myADX <= myADX[ADXRef] then r=255 g=0 b=0 Elsif myrsi<RSILowerThreshold and myADX <= myADX[ADXRef] then r=0 g=255 b=0 Elsif myrsi>RSIUpperThreshold and myADX > myADX[ADXRef] and myADX >= ADXMinThreshold then //ADX Rising and Overbought r=206 g=32 b=41 Elsif myrsi<RSILowerThreshold and myADX > myADX[ADXRef] and myADX >= ADXMinThreshold then //ADX Falling and Oversold r=3 g=192 b=60 Elsif myrsi<RSIUpperThreshold and myrsi>RSILowerThreshold and (myADX > myADX[ADXRef] and myADX >= ADXMinThreshold) then //ADX Rising r=0 g=0 b=255 Elsif myrsi<RSIUpperThreshold and myrsi>RSILowerThreshold and (myADX < myADX[ADXRef] or myADX < ADXMinThreshold) then //ADX Falling r=0 g=0 b=0 endif return myma coloured(r,g,b) as "Hybrid MA" |
Find exclusive trading pro-tools on