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:
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.
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],
VZ_G_Break_Bar[VG_Count], VZ_GL[VG_Count]);
RectangleSetFillColor(VZ_G_ID[VG_Count], Demand_Zone_Color);
RectangleSetColor(VZ_G_ID[VG_Count], Color_VZ_Green_Outline);
RectangleSetStyle(VZ_G_ID[VG_Count], tool_solid);
RectangleSetSize(VZ_G_ID[VG_Count], 0.5);
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]);
end;
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.
-pdq