question about drawing arrows from conditions?
Forums › ProRealTime English forum › ProBuilder support › question about drawing arrows from conditions?
- This topic has 7 replies, 3 voices, and was last updated 5 years ago by Scubatron5000.
Tagged: drawarrow, drawarrowdown, drawarrowup
-
-
01/29/2019 at 12:32 PM #89927
Hey
I am playing about trying to write some simple code. I want to have a arrow up below the candle on the chart when Close > Close[1]And (Close > High[1]) and a arrow down when Close < Close[1] And (Close < Low[1]) but I want to write the code so it does not keep printing arrows on subsequent candles as price rises or falls but I honestly can’t seem to get it to work. I just want to pick up the swings at top and bottom according to the rules above. I am sure this is a really basic thing to ask but if someone could show me how you would write this I would be so grateful.
Thank you for any help you can give me.
You guys are the best
Steve
01/29/2019 at 12:56 PM #89931I moved your topic to the english forum.
There you go:
123456789DEFPARAM CalculateOnLastBars = 100Offset = 5 * pipsize //distance from low/high to plot arrowIF close > high[1] THEN //which is also > close[1]DRAWARROWUP(barindex,low - Offset) COLOURED(0,128,0,255)ENDIFIF close < low[1] THEN //which is also < close[1]DRAWARROWDOWN(barindex,high + Offset) COLOURED(255,0,0,255)ENDIFRETURN1 user thanked author for this post.
01/29/2019 at 1:15 PM #89933Ah wow so I even posted in the wrong part of the forum!!
You are probably wondering how I even managed to turn my computer on!
Thank you for the quick reply and the help
I actually managed to write something similar to the above but what I was meaning was I did not want the arrows to keep printing on the subsequent candles I don’t think I explained myself properly.
So it would look something like the picture attached only drawing the arrows circled and not the ones in between. Hopefully this makes sense
Thanks again for your help
Steve
01/29/2019 at 1:49 PM #89938- For a new topic, your title should be explicit enough to prompt the community to read your discussion.
“noob question” is not an appropriate title. It will not help any members to find relevant topics for their questions in the future.
01/29/2019 at 2:03 PM #89940You just have to let me know the features the circled candkesticks have to tell them from those not circled.
01/29/2019 at 2:38 PM #89944Oh sorry Nicolas I did not mean to cause any problems.
So what I mean is the circled candle is the first candle that close is greater than the last candles high or a close is lower than the last candles low.
Hopefully that makes sense, sorry for the confusion.
Steve
01/29/2019 at 3:28 PM #89950There you go, you can set Offset and LookBack to whatever value suits you best:
12345678910DEFPARAM CalculateOnLastBars = 100Offset = 5 * pipsize //distance from low/high to plot arrowLookBack = 15 //number of bars to scan to make sure it's the most recent low/highIF close > highest[LoookBack](high[1]) THENDRAWARROWUP(barindex,low - Offset) COLOURED(0,128,0,255)ENDIFIF close < lowest[LoookBack](low[1]) THENDRAWARROWDOWN(barindex,high + Offset) COLOURED(255,0,0,255)ENDIFRETURN2 users thanked author for this post.
01/29/2019 at 3:46 PM #89957Ah mate thank you so much.
I was really struggling with this. Thank you for your help and all you patience
All the best
Steve
-
AuthorPosts
Find exclusive trading pro-tools on