John Carter coloured momentum candles
Forums › ProRealTime English forum › ProBuilder support › John Carter coloured momentum candles
- This topic has 8 replies, 3 voices, and was last updated 1 year ago by Alfy.
-
-
02/15/2023 at 9:17 AM #209701
Good morning guys, I’m trying to colour the candlesticks in my charts using a momentum indicator and although it is working
John Carter Momentum candles123456789101112131415161718192021222324DonchianMidline = (Highest[20](high)+Lowest[20](low)+Average[20](close) )/3sma=close-(DonchianMidline)Delta = linearregression[20](sma)if delta>0 and delta>delta[1] ThenDRAWCANDLE(open, high, low, close)COLOURED(0,245,255)colour=1endifif delta>0 and delta<delta[1] thenDRAWCANDLE(open, high, low, close)COLOURED(0,0,255)colour=2endifif delta<0 and delta<delta[1] thenDRAWCANDLE(open, high, low, close)coloured(255,0,0)colour=3endifif delta<0 and delta>delta[1] thenDRAWCANDLE(open, high, low, close)coloured(255,255,0)colour=4endifRETURN colouron the monthly and weekly charts, on the daily charts its doing something strange with all the prices squashed. Can someone take a look at my code and let me know what I’m doing wrong please?
Best regards and thank you
02/15/2023 at 9:47 AM #20970702/15/2023 at 9:48 AM #20970902/15/2023 at 9:53 AM #20971002/15/2023 at 9:55 AM #20971102/15/2023 at 10:25 AM #209717Maybe your scale on your daily chart isn’t set up the same way as in the other charts, you can check with right click on price scale on right margin, then in the menu pick the one at the end about “configuration of the zone” (not sure the exact english name of it), then as in attached image you are in “scale” menu (left side) and on the right side of the panel check the box about using price only is checked, it will avoid making visible the values 1 to 4 of the returned “colour” variable of your indicator added to price, assuming it was that kind of squashing.
Maybe it wasn’t the problem at all, but the absence of screen capture also means absence of clues for those willing to help, we have to make hypothesis of what “squashed” means in the first place before wondering what might have done this. So maybe I got the wrong “squash”, and the wrong solution…
1 user thanked author for this post.
02/15/2023 at 10:36 AM #209721All fixed. If interested please see attached fixed code.
John Carter Momentum candles123456789101112131415161718192021222324DonchianMidline = (Highest[20](high)+Lowest[20](low)+Average[20](close) )/3sma=close-(DonchianMidline)Delta = linearregression[20](sma)if delta>0 and delta>delta[1] ThenDRAWCANDLE(open, high, low, close)COLOURED(0,245,255)endifif delta>0 and delta<delta[1] thenDRAWCANDLE(open, high, low, close)COLOURED(0,0,255)endifif delta<0 and delta<delta[1] thenDRAWCANDLE(open, high, low, close)coloured(255,0,0)endifif delta<0 and delta>delta[1] thenDRAWCANDLE(open, high, low, close)coloured(255,255,0)endifRETURN02/15/2023 at 11:28 AM #209732values 1 to 4 of the returned “colour” variable of your indicator
To close the loop and so we all know for future on similar ‘squashings’ 🙂 … the amended code has removed the refs to colour 1 to 4.
1 user thanked author for this post.
02/15/2023 at 11:34 AM #209734 -
AuthorPosts
Find exclusive trading pro-tools on