Basing candle indicator
Forums › ProRealTime English forum › ProBuilder support › Basing candle indicator
- This topic has 13 replies, 5 voices, and was last updated 6 years ago by Vonasi.
-
-
08/21/2017 at 12:48 PM #4429808/21/2017 at 1:35 PM #44308
This piece of code does what you want, displaying a green dot below each candle that meets your requirements:
12345678910111213141516171819DEFPARAM CalculateOnLastBars = 500 //just to speed up thingsR=0G=255B=0F=255IF close > open THENUpperShadow = high - closeLowerShadow = open - lowELSEUpperShadow = high - openLowerShadow = close - lowENDIFShadows = UpperShadow + LowerShadowBody = range - ShadowsIF Body <= (Shadows / 2) THENDotVal = low - (3 / pipsize)DRAWTEXT("•",barindex,dotval,Dialog,Bold,12) coloured(R,G,B,F)ENDIFRETURN08/21/2017 at 3:38 PM #4431008/21/2017 at 4:47 PM #44313You should add it to the price, not below.
As shown in the pic:
- 1 – click on the PRICE WRENCH in the upper left corner
- 2 – with your cursor on the tag PRICE click on “add indicator”
- 3 – tht’s the outcome
I changed the code to modify display, as follows:
12345678910111213141516171819DEFPARAM CalculateOnLastBars = 1000R=0G=255B=0F=255IF close > open THENUpperShadow = high - closeLowerShadow = open - lowELSEUpperShadow = high - openLowerShadow = close - lowENDIFShadows = UpperShadow + LowerShadowBody = range - ShadowsIF Body <= (Shadows / 2) THENDotVal = low - (100 * pipsize)DRAWTEXT("•",barindex,DotVal,Dialog,Bold,12) coloured(R,G,B,F)ENDIFRETURNI attach the code so that you can import it, if you don’t want to copy and paste it.
1 user thanked author for this post.
08/21/2017 at 5:53 PM #44320Oh I see! Thank you very much! You are a very kind person!
1 user thanked author for this post.
08/21/2017 at 6:48 PM #4432208/21/2017 at 11:04 PM #44328My pic was on GbpJpy monthly chart and it works, I also tried it on DAX both 1 hr and monthly and it displays correctly all candles whose body is less than 50% of their range.
You may try to modify this part of line 16:
1(100 * pipsize)replacing 100 with 10. This should not affect computations but only the place where dots are displayed.
08/22/2017 at 9:32 AM #4433408/22/2017 at 11:30 AM #44348Indeed it’s somewhat odd!
I wrote this strategy (on DAX weekly chart) to debug the values of variables:
123456789101112131415161718192021222324DEFPARAM CumulateOrders = falseIF close > open THENUpperShadow = high - closeLowerShadow = open - lowELSEUpperShadow = high - openLowerShadow = close - lowENDIFShadows = UpperShadow + LowerShadowBody = range - Shadows//IF Body <= (Range / 2) THEN//DotVal = low - (20 * pipsize)//ENDIFIF close < 0 THEN //useless, it is compulsory to have at least one BUYBUY AT MARKETENDIFGRAPH UpperShadow AS "uSH"GRAPH LowerShadow AS "lSH"GRAPH Shadows AS "Shs"GRAPH Body AS "Bdy"//GRAPH Body <= (Shadows / 2) AS "%"//GRAPH DotVal AS "Dot"GRAPH Range AS "rng"the attached pic shows that variable “rng” (range) retains a value of 277.5, while the ProOrder box on the chart says the distance High-Low is 280.2!
I don’t know why, I hope someone can help spot the bug!
09/03/2017 at 5:21 PM #4530808/19/2018 at 6:47 AM #78585sir need Basing Candle Indicator for mt4 please code for it
in above post Dot shows for Basing candle , sir i need blue colur for basing candle instead of Dot …
plz check attachment ….like this i need
08/19/2018 at 11:38 AM #78591sir need Basing Candle Indicator for mt4 please code for it
in above post Dot shows for Basing candle , sir i need blue colur for basing candle instead of Dot …
plz check attachment ….like this i need
Please update your country flag! Thank you.
Only conversions TO ProRealTime are possible, as from this link https://www.prorealcode.com/topic/free-conversion-mt4-indicators-mql4/.
If you meant to change my code so that it mirrors your screenshot, there you go:
123456789DEFPARAM CalculateOnLastBars = 1000UpperShadow = high - max(close,open)LowerShadow = min(close,open) - lowShadows = UpperShadow + LowerShadowBody = range - ShadowsIF Body <= (Shadows / 2) THENDRAWCANDLE(open,high,low,close) COLOURED(255,215,0,255) BORDERCOLOR(255,0,255,255)ENDIFRETURNYou can choose different colours https://www.prorealcode.com/wp-content/uploads/2015/09/P1jHlnG.jpg.
1 user thanked author for this post.
08/24/2018 at 5:59 PM #78994sir how to make it indicator for mt4 , i don’t know how can , please make it for me and send to my mail [deleted]
thanks…..
08/24/2018 at 6:10 PM #79002sir how to make it indicator for mt4 , i don’t know how can , please make it for me and send to my mail
thanks…..
You need to go to an MT4 forum site and ask someone there to convert it.
This is a Pro Real Time forum where you can get code converted from MT4 to PRT but not the other way around.
You have repeatedly asked for the same thing which is making us despair a little. Please stop asking.
Also it is not wise to post email addresses on forums so I have deleted it for you.
-
AuthorPosts
Find exclusive trading pro-tools on