Code for trending candlesticks?
Forums › ProRealTime English forum › ProBuilder support › Code for trending candlesticks?
- This topic has 15 replies, 3 voices, and was last updated 4 years ago by DAVE50.
-
-
03/16/2019 at 5:23 PM #93860
Hi, is it possible to code the candlesticks to color code for trends? For example, a formula is once price has crossed up and remains over the 8 SMA the candlesticks then all get painted in green as long as still above 8 sma and then the exact opposite ( red) for sells?
Thanks
03/16/2019 at 11:20 PM #93874Maybe these links may be of help:
https://www.prorealcode.com/reply/88141/
https://www.prorealcode.com/topic/aiuto-per-piccola-modifica-codice/#post-65525
03/17/2019 at 12:04 AM #9387703/17/2019 at 8:29 PM #93904Hi Vonasi, basically yes it should be ok. But when I tried to load on the candlesticks don’t display correctly and how do I get them to go on to my main price window?
Any way to fix?
I will attach screenshot to try explain.
Thanks again
03/17/2019 at 8:39 PM #9390603/17/2019 at 10:40 PM #93907I don’t understand why you are getting that result. It looks like you have the open,high,low,close mixed up in the code.
I forgot to include the last line of the code which should be RETURN but I guess you added it yourself!
To get the candles on the price chart click on the spanner on the price chart and add the indicator from there. When I do this I get this:
03/19/2019 at 12:56 AM #9398503/19/2019 at 9:22 AM #9399503/20/2019 at 12:14 PM #9415303/20/2019 at 1:51 PM #94161Yes copy and paste should work just fine. Create a new indicator with the copy and paste and then apply that indicator to the price chart via the spanner in th ecorner of it. The candles should simply be drawn over the top of the ones in the price chart.
I have also just noticed that this is an indicator question but you posted in the ProScreener forum. I will move it to the correct forum. Please try to post in the correct forum with future topics.
03/20/2019 at 6:06 PM #9418303/20/2019 at 6:44 PM #94188It is difficult to see the candles as you are using a black background and I set the outline colour to be black so it also makes the tails this colour. Try this code:
123456789r = 128g = 0if close > average[8] thenr = 0g = 128endifDRAWCANDLE(open,high,low,close) COLOURED(r,g,0) BORDERCOLOR(r,g,0)You can also add the indicator as a separate indicator and so be able to directly compare how the candles look compared to the normal price chart candles.
03/20/2019 at 9:01 PM #9419911/05/2020 at 5:51 PM #149566Hi, further to your excellent help with displaying “trending candlesticks” i.e when price is staying above 8 moving average to stay green regardless of actual sell or buy and red below the 8 MA for sells…
Is it possible to display a brighter green candle for the candles that actually close bullish/ buy and brighter red for the proper sell candles?
Thanks very much in advance.
11/05/2020 at 8:25 PM #149588Try this (not tested):
123456789101112131415161718192021r = 128g = 0if close > average[8] and close < open thenr = 0g = 128endifif close > average[8] and close > open thenr = 0g = 255endifif close < average[8] and close < open thenr = 255g = 0endifDRAWCANDLE(open,high,low,close) COLOURED(r,g,0) BORDERCOLOR(r,g,0)return -
AuthorPosts
Find exclusive trading pro-tools on