Cant find the bug with my candlesticks indicator
Forums › ProRealTime English forum › ProBuilder support › Cant find the bug with my candlesticks indicator
- This topic has 15 replies, 4 voices, and was last updated 7 years ago by paddan.
-
-
08/29/2017 at 1:04 PM #44842
Hi, i have got this indicator to detect and put a dot under every candle that has a body which is 50% or lower than the whole range. Problem is that it is in consequent, some candles it misses and some candles are not 50% or less that get a dot. Robertogozzi which wrote the code cant find the bug either. I would really be thankful if someone could help me solve this. Best!
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)ENDIFRETURN08/29/2017 at 1:18 PM #44845I think the problem could be that the conditions you are testing for are “on-going”; only when the bar closes you can know for sure if that bar needs a dot
08/29/2017 at 1:21 PM #44848Line 15… would get rid of the “/2” to make it “IF Body <= Shadows THEN”, so that you get a 50% frontier of body vs range
2 users thanked author for this post.
08/29/2017 at 2:08 PM #4485008/29/2017 at 2:22 PM #4485408/29/2017 at 3:12 PM #4486108/29/2017 at 3:32 PM #44863Is this attachment on a weekly timeframe by any chance? There’s a platform bug for graphical instructions in weekly (and x weeks) timeframes only, that display any text or arrow one candle too early… All other timeframes are without this bug.
So even if you didn’t say what timeframe this graph is, all dots look furiously in the wrong place to me, but at the right height if shifting all of them to the right by one candle, which is a strong match for the weekly graphical bug. So am I guessing right, your graph here is weekly but other smaller timeframes are ok?
08/29/2017 at 5:51 PM #4486908/29/2017 at 6:01 PM #4487408/30/2017 at 7:14 AM #4489308/30/2017 at 8:05 AM #44895I tried it on DAX & EURUSD, daily charts, and it seems to be working fine!
I did not take the the time to check each candle and do the math, but could not find any odd result.
08/30/2017 at 8:16 AM #4489808/30/2017 at 8:33 AM #44899What instrument is in your screenshot?
08/30/2017 at 12:37 PM #4491808/30/2017 at 1:46 PM #44931It works perfectly on GOLD daily chart, as from the attached screenshot. I highlighted the same candles you circled.
Here is the code, in case mine and yours mismatch, aside from where you want a dot plotted:
12345678910111213141516171819DEFPARAM CalculateOnLastBars = 1000R=0G=255B=0F=255IF close > open THENUpperShadow = high - closeLowerShadow = open - lowELSEUpperShadow = high - openLowerShadow = close - lowENDIFShadows = UpperShadow + LowerShadowBody = range - ShadowsIF Body <= Shadows THENDotVal = low - (10 * pipsize)DRAWTEXT("•",barindex,DotVal,Dialog,Bold,12) coloured(R,G,B,F)ENDIFRETURNIf it’s the same…. maybe a graphical issue, the numer of pixels…. I really couldn’t tell!
-
AuthorPosts
Find exclusive trading pro-tools on