MACD Histogram Color
Forums › ProRealTime English forum › ProBuilder support › MACD Histogram Color
- This topic has 12 replies, 3 voices, and was last updated 3 years ago by satini.
-
-
06/24/2021 at 3:48 PM #172317
Hi,
I’m looking for a MACD indicator that changes the Histogram color with reference to the last bar eg. current bar higher than previous bar= green and lower than previous bar= red). I tried downloading the MACD histogram color indicator but notice that it behaves completely different from the built-in MACD. I would really appreciate if someone could point me to a solution or alternative indicator if available.
Thank you
06/24/2021 at 4:30 PM #172319There you go:
12345678910111213// MACD 12,26,9//MyMACD = ExponentialAverage[12](close) - ExponentialAverage[26](close)MySignalLine = ExponentialAverage[9](MyMACD)MyHisto = MyMACD - MySignalLiner = 0g = 255 //Greenb = 0IF high < high[1] THENr = 255 //Redg = 0ENDIFRETURN MyMACD coloured(0,0,238,255) Style(Line,1) AS "Macd",MySignalLine coloured(238,99,99,255) Style(Line,1) AS "Signal",MyHisto coloured(r,g,b,255) Style(Histogram,1) AS "Histogram"06/25/2021 at 8:08 AM #172388Thank you Sir. I’ve tried the indicator and noticed that it still doesn’t color all the bars correctly. I’ve attached a sample screen shot with the default MACD on top and the MACD histogram color at the bottom. I’ve marked some of the bars where the color is off. Really appreciate some help to solve this.
Best Regards
06/25/2021 at 8:09 AM #17238906/25/2021 at 9:52 AM #172399They are ALL correct, as per your request “eg. current bar higher than previous bar= green and lower than previous bar= red“.
Any bar higher than the previous one is GREEN, otherwise it’s RED.
06/30/2021 at 4:22 PM #172831Hi Sir ,
My apologies for the confusion. What I meant is that if the macd histogram bar is increasing with respect to the last one, it should color the forming bar green. Conversely, if its is declining with respect to the previous bar, then the bar should paint red.
Regards
06/30/2021 at 4:40 PM #172833If the higher is higher than before it must be green, if the low is lower than before it’s red, is this correct!
In all other cases what colour should it have?
To check for ascending and descending prices shall I use CLOSE or HIGH/LOW?
07/02/2021 at 3:13 PM #172984Hi Sir, please refer to the attached chart from MT4. I’m trying to get the indicator to do the same in PRT.
When a bar is above 0 line and increasing in value ie becoming more postive wrt previous bar, it should paint green and signal a change to red if it go lower than previous bar.
When a bar is below 0 line and becoming more negative wrt previous bar , the bar should paint red. If it’s below o line and becoming more positive wrt last bar, it should paint green.
07/02/2021 at 4:28 PM #172995There you go:
123456789101112131415// MACD 12,26,9//MyMACD = ExponentialAverage[12](close) - ExponentialAverage[26](close)MySignalLine = ExponentialAverage[9](MyMACD)MyHisto = MyMACD - MySignalLineONCE b = 0IF (MyMACD > MyMACD[1]) AND (MyMACD > 0) THENr = 0g = 255 //GreenENDIFIF (MyMACD < MyMACD[1]) AND (MyMACD <= 0) THENr = 255 //Redg = 0ENDIFRETURN MyMACD coloured(0,0,238,255) Style(Line,1) AS "Macd",MySignalLine coloured(238,99,99,255) Style(Line,1) AS "Signal",MyHisto coloured(r,g,b,255) Style(Histogram,1) AS "Histogram"07/03/2021 at 4:00 PM #17305707/03/2021 at 5:12 PM #173064What is strange?
07/27/2021 at 2:05 PM #174226Create Variables called ShortTermMA, LongTermMA and SignalNBRPeriods, and set them to your liking, e.g. 14, 32 and 9
12345678910111213141516171819202122232425262728293031323334353637383940MyMACD = ExponentialAverage[ShortTermMA](close) - ExponentialAverage[LongTermMA](close)MySignalLine = ExponentialAverage[SignalNBRPeriods](MyMACD)MyHisto = MyMACD - MySignalLiner = 0g = 0b = 0IF MyHisto > 0 THEN// Normal GreenIF MyHisto[1] < MyHisto THENr = 38g = 166b = 154ENDIF// Light GreenIF MyHisto[1] > MyHisto THENr = 178g = 223b = 202ENDIFENDIFIF MyHisto < 0 THEN// Normal RedIF MyHisto[1] > MyHisto THENr = 255g = 82b = 82ENDIF// Light RedIF MyHisto[1] < MyHisto THENr = 255g = 205b = 210ENDIFENDIFRETURN MyHisto coloured(r,g,b,255) Style(Histogram,1) AS "Histogram", MyMACD coloured(0,0,238,255) Style(Line,1) AS "Macd",MySignalLine coloured(238,99,99,255) Style(Line,1) AS "Signal"1 user thanked author for this post.
07/27/2021 at 4:11 PM #174241 -
AuthorPosts
Find exclusive trading pro-tools on