Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 00:40:44 +0000



[User Discussion] - How to determine candle width (in pixels) in study ?

View Count: 261

[2023-10-04 11:27:35]
erwinbeckers - Posts: 22
I'm using a GDI custom drawing function in my study and i'm trying to draw a rectangle around the current bar
To do this I need to be able to determine the candle width in pixels

I did find the sc.ChartBarSpacing which gives me the spacing between 2 bars, but I cannot find any documentation on how to get the actual width of the candles



regards
Erwin
Date Time Of Last Edit: 2023-10-04 11:28:30
[2023-10-07 18:49:11]
ForgivingComputers.com - Posts: 960
You could do what the rectangle tool does, draw from the midpoints of the adjacent bars, so your box width will always be twice the sc.ChartBarSpacing. You could also tweak that width to be more or less percentage-wise.

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

Login

Login Page - Create Account