HMA bi coloured – how to do it
Forums › ProRealTime English forum › ProBuilder support › HMA bi coloured – how to do it
- This topic has 3 replies, 2 voices, and was last updated 8 years ago by
mastro.
-
-
03/15/2017 at 10:28 PM #28713
Hi guys,
sorry to bother you again, but as I said in my previous topic (that was the very first one), I am an absolute beginner ….
I am currently using the Hull Moving Average indicator that I coded after the code which is available in the prorealcode library.
The code is like this123456Period=20inner = 2*weightedaverage[ round( Period/2 ) ](close)-weightedaverage[Period](close)HMA=weightedaverage[ round( sqrt(Period) ) ]( inner )return HMA COLOURED(255,255,255) as "Hull Moving Average"as you can see, the line will be visible in the screen as a “white line”, regardless its own trend ..
It would he nice and helpful if the line could be colored in green, when the HMA is indicating a trend up, while colored in red when indicating a trend down.
Can you plese help me showing me how to modify the script so that the line shows up green or red according to the trend going on ?Thanks again for your help !
Bye03/15/2017 at 10:30 PM #2871503/16/2017 at 5:18 PM #28779Firstly, remove the coloured function in the code:
1return HMA as "Hull Moving Average"Then you only need to change the color of the HMA according to its slope (up/down), in the indicator parameters window (attached screenshot).
03/16/2017 at 7:22 PM #28793 -
AuthorPosts
Find exclusive trading pro-tools on