Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 16:11:05 +0000



[Programming Help] - Question about the RectangleHighlight example in Studies.cpp

View Count: 646

[2020-03-28 14:18:54]
Yoda - Posts: 106
Currently the scsf_UseToolExampleRectangleHighlight in Studies.cpp draws a Rectangle starting in the middle of a candlestick and ends in the middle of the final candlestick. As a result, the rectangle is shifted by half a bar. This is particularly noticeable if you are drawing the rectangle on just one bar. The rectangle starts at the wick of the first bar and continues on to the next bar's wick.

I'm not sure if this is an issue with SC or if this can be fixed inside the study.

Does anyone have any suggestions on how can I start the rectangle at the left side of a candlestick and end it at the right side of the final candlestick so that the rectanglehightlight covers the full body of the candlesticks and does not leak into the following bar?
[2020-03-29 09:19:33]
Sierra Chart Engineering - Posts: 104368
This is just how Chart Drawings work. There is not a way to change this. You cannot set a Rectangle drawing on a single bar.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2020-03-29 14:33:53]
Yoda - Posts: 106
This is just how Chart Drawings work. There is not a way to change this. You cannot set a Rectangle drawing on a single bar.

It appears that I may not have explained myself sufficiently because I've seen examples of this working.

To provide further explanation, I don't require a rectangle on a single bar. However, I do require that the rectangles start on the left side of a bar and end on the right side of the final bar.

Here is an example using OHLC bars in SC: https://mboxwave.com/sierra-chart-indicator-settings

And here is an example of the rectangles being correctly drawn in real time on candlestick bars in SC: https://www.youtube.com/watch?v=dsVclmg7M4U

So I'm concluding that what I'm looking for is possible since others have this working in SC. Ideally, the best solution would be for SC to adjust the code such that the rectangles did not use the wicks of the bars but their bodies. If SC is not able/willing to do this, I should be grateful if someone could explain how I can do this.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account