Login Page - Create Account

Support Board


Date/Time: Tue, 26 Aug 2025 05:22:35 +0000



Post From: ACSIL: All methods to draw a rectangle that clips when intersected by price

[2025-08-25 15:10:45]
HumblyTrading - Posts: 208
One workaround which I use for this is to get the look of a rectangle by extending lines from the CBBOAC study.
I use 20 or more studies, and I reference an increment of n-ticks in a separate study.

For example, ID2 is the Top of the Area for whatever alert you are setting , and ID3 is the Bottom of the Area, ID1 is the increment:

Then ID4 would be set up like this to draw an extension line at the first increment:
=IF(AND(ID2.SG1 > ID3.SG1, ID2.SG1 - (ID1.SG1 * 1 * (1/ROUND(1/TICKSIZE, 0))) >= ID3.SG1), ID2.SG1 - (ID1.SG1 * 1 * (1/ROUND(1/TICKSIZE, 0))), 0)

The Round operator is needed because certain instruments such as the 6 series do weird things when dealing with different value formats, tick sizes, and floating point precisions, etc.

Then just repeat that, such that ID5 continues:
=IF(AND(ID2.SG1 > ID3.SG1, ID2.SG1 - (ID1.SG1 * 2 * (1/ROUND(1/TICKSIZE, 0))) >= ID3.SG1), ID2.SG1 - (ID1.SG1 * 2 * (1/ROUND(1/TICKSIZE, 0))), 0)

And so on.
On some settings of charts, I would set the Incrementer ID1 to just 1, while on others it gets as high as 10...