I finally got around to trying out the rectangle functionality new in release 12 and ran into my usual multiple data stream difficulty. Not having code-based rectangle drawing, some years ago I used three lines to define volume zones (vertical start line, a top line, and a bottom line). It looked like this with the indicator based on data2:
Here are the relevant rectangle key word parts of the code:
This does the initial plot of the green rectangles--
Code: Select all
VZ_G_ID[VG_Count] = RectangleNew_BN(VZ_G_Signal_Bar[VG_Count], VZ_GH[VG_Count],
This updates the rectangle end point as time marches on--
Code: Select all
for value1 = 1 to VG_Count begin
RectangleSetEnd_BN(VZ_G_ID[value1], VZ_G_Break_Bar[value1] , VZ_GL[value1]);
Also: the 3rd parameter of RectangleSetEnd_BN doesn't make any sense to me. It seems to me that this function should only need two parameters: 1) the rectangle ID and 2) the bar number of the desired end.
Any insights / ideas would be greatly appreciated.
It worked but I always disliked the look of it. So, using identical logic with new rectangle keywords, I implemented rectangles and it gives a much better, easier to work with look: Here's how that same data looks using rectangles. However, in this picture the indicator is based on data1....
...because unfortunately, the indicator does not work when it is pointed at the 8 range data stream in data2. Instead, I get this:
Instead of rectangles I get what appears to be only the bottom lines of the rectangles. Maybe it has to do with MaxBarsBack being different on the two charts? Doesn't make sense to me.
- How_it_should_look.png (60.54 KiB) Viewed 310 times
Last edited by PD Quig
on 18 Jan 2019, edited 4 times in total.