Support Board
Date/Time: Tue, 26 Aug 2025 03:46:34 +0000
[Programming Help] - ACSIL: All methods to draw a rectangle that clips when intersected by price
View Count: 1321
[2023-03-08 15:41:23] |
User907967 - Posts: 54 |
Dear Support Team, I am considering the most efficient option to draw a rectangular shape at a specific event while ensuring it gets clipped when the price overlaps completely (the second time). So far, I have the following alternatives: 1. sc.AddLineUntilFutureIntersection() or sc.AddLineUntilFutureIntersectionEx() -- both functions facilitate the clipping, which is excellent, but they draw a line, not a rectangular shape. 2. s_UseTool -- handles the creation of the rectangular shape nicely, but the clipping needs a separate implementation by transitioning from the original Extending Rectangle type to the Rectangle shape type. 3. Subgraph/DRAWSTYLE -- I cannot find any styles that extend until price intercepts (the clipping described above), and I am surprised because plenty of types are implemented, so perhaps I am not searching in the right place. Can anyone help with a reference? Questions: 1. Are there any other methods apart from the above three? 2. Do we have any thoughts on the 3rd point, i.e. which DRAWSTYLE would be best suited? In summary - the aim is to draw a rectangle that clips when the price overlaps entirely at a later point in time. Date Time Of Last Edit: 2023-03-08 15:42:10
|
[2024-05-19 18:48:35] |
PS - Posts: 42 |
+1 to this. I'm looking for a way to draw rectangles that can be clipped once price exceeds the further bound of the rectangle, but can't find any sort of solution. Is there any implementation to support this?
|
[2024-05-20 14:39:51] |
John - SC Support - Posts: 41464 |
There is not a built-in way to do this. You would have to create a custom study to do this and adjust the rectangle based on the situation. Refer to the following: Using Drawing Tools From an Advanced Custom Study List of Third Party Sierra Chart Study and System Programmers For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2025-08-24 22:25:13] |
User688525 - Posts: 298 |
Hi John, Has there been any development on drawing and extending a rectangle until intersection similar how this is done with the Singles Area on TPO charts? If not, are there any current studies, or custom code, that adjust the rectangle based on the situation, i.e., until intersection with the remaining extending? Thank you |
[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... |
To post a message in this thread, you need to log in with your Sierra Chart account: