draw vertical segment for reversal bar ?
Forums › ProRealTime English forum › ProBuilder support › draw vertical segment for reversal bar ?
- This topic has 12 replies, 2 voices, and was last updated 1 year ago by sharteel.
-
-
01/21/2023 at 11:15 AM #207814
Hello,
timeframe: 1 tick
i start a new challenge and for that i m looking if someone has a code for drawing a vertical segment in tick timeframe where the high or low is moving with tick value (price) only. dont care about the time.
ex:
- tick reversal: +10ticks
- the price start at 11000, the price up, the green segments drawing up until the price down to value = to 10 tick and it is the start for drawginf the new bar, red here as the price move down. if the price move up again to +10 tick, the draw a new green bar.
it is reversal bar.
thanks.
S.T
01/24/2023 at 11:47 AM #20808201/24/2023 at 7:50 PM #208153Hello Nicolas,
the goal is to draw a bar (vertical segment) until the retracement. it is same thing of renko but with reversal mecanism.
ex:
a bar is created in tick chart at time 090000 and move up until price down to 10 ticks. if not, the segment is drawing by following the price. if the price move down for 10 ticks, a new segment is drawing and continue to draw until the price move up agin and reach last price +10 ticks. etc.
in attachment with mecanism.
cheers.
01/25/2023 at 10:52 AM #20818301/25/2023 at 11:11 AM #208190Quickly, I coded this:
1234567891011121314size = 10once s=size*pointsizeonce iprice = closewhile close>iprice+s doiprice=closewendwhile close<iprice-s doiprice=closewendreturn ipriceBut I have a doubt, I go back there.. I believe that the line must continue in the same direction until a reversal of X (10) points, is not it?
01/25/2023 at 11:20 AM #208197New version, I think it’s the closest to your query.
1234567891011121314151617181920212223242526size = 10once s=size*pointsizeonce iprice = closewhile high>iprice+s doiprice=closedir = 1r=0g=255wendwhile low<iprice-s doiprice=closedir = -1r=255g=0wendif dir=1 theniprice=max(iprice,high)elsif dir=-1 theniprice=min(iprice,low)endifreturn iprice coloured(r,g,0) style(line,2)01/25/2023 at 2:48 PM #20822401/25/2023 at 3:03 PM #208230ok, but since we can’t modify the time line of the platform (X-axis), I have to build arrays of candlesticks and plot them back in the past, more tricky but will do. So you will not be able to compare the price chart with the new candlesticks the code will plot, they will be both out of sync.
If you encounter infinite loop, I think it’s because you are using a timeframe too high to get a 10 points retracement in the same bar, please try with DAX / 5 ticks for example. What instrument are you trying?
01/25/2023 at 3:33 PM #208233Here is a more complete version where you can select the display of the bars in 2 different modes: line mode (like previous code) or bars mode.
In bars mode (mode = 1), you can select if the bars are anchored on the time of their creation or like a classic chart (one bar per time period). See pictures attached for a better understanding.
1 user thanked author for this post.
01/25/2023 at 8:31 PM #20828201/26/2023 at 4:35 PM #20838501/31/2023 at 2:27 PM #20886202/16/2023 at 9:22 AM #209801 -
AuthorPosts
Find exclusive trading pro-tools on