Login Page - Create Account

Support Board


Date/Time: Fri, 14 Mar 2025 19:13:32 +0000



Pixel vs Tick position of studies on chart

View Count: 648

[2022-07-01 09:18:51]
BenjFlame - Posts: 335
Hi,
I find it very annoying that the placement of items on screens is based on ticks instead of pixels.
For example, when I stack several numbers on top of a bar and the volatility changes.... the numbers either overlap or are stretched farther apart.

Is there any way to place items on charts relative to each other based on pixel instead of ticks, or any other smart way of accomplish this?
Date Time Of Last Edit: 2022-07-01 09:21:58
[2022-07-01 11:46:21]
Sierra Chart Engineering - Posts: 104368
We do not know specifically what you are referring to. We need an image of the chart and you need to point out specifically what you are referring to.

But what you would need to do is obtain the text height of the text and then convert that into a vertical scale amount. All vertical scale positioning of items on a chart will always be based upon values, never pixels.

So we need to understand what you are referring to and then we will let you know how to accomplish the above.
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
[2022-07-01 11:57:57]
BenjFlame - Posts: 335
Ok so please look at image.
I calculate and display several numbers that I place at the right of the close price.

As you can see in this case, the 3 texts with backgrounds overlap vertically. And because position is based on value, depending on the volatility of price, the vertical space between numbers might increase or shrink. I have no effective way of keeping a stable vertical distance between those text with background numbers and would like to know how to solve this.
Date Time Of Last Edit: 2022-07-01 14:01:06
imageScreenshot 2022-07-01 075459.png / V - Attached On 2022-07-01 11:57:51 UTC - Size: 1.49 KB - 123 views
[2022-07-01 14:35:04]
John - SC Support - Posts: 38669
It looks like you are drawing into the DOM, in which case refer to the following, which also gives a link to how to draw directly into the graph using pixels:
ACSIL Interface Members - Functions: sc.GetDOMColumnLeftCoordinate()

But, if what you are drawing has a direct relationship to price, then you should be tying the data to the appropriate price levels.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2022-07-01 14:39:37]
BenjFlame - Posts: 335
Hi John, no it's not in the dom. It's on the chart. Just at the right of it.

It's more a relation among the drawings. How could I position them so they remain equally vertically spaced?
Is there for example, a way to define like 2 ticks between each of my text with background drawings?
Date Time Of Last Edit: 2022-07-01 14:41:32
[2022-07-01 15:15:07]
John - SC Support - Posts: 38669
Yes, you can specify that a drawing is 2 ticks higher than another. The Tick Size is readily available within ACSIL. Refer to the following:
ACSIL Interface Members - Variables and Arrays: sc.TickSize

Then set one image at a price point and the others at an offset from that price using the Tick Size (price + 2 * Tick Size) for example.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2022-07-01 15:26:47]
BenjFlame - Posts: 335
Unless I misunderstand what you suggest, this will not solve the issue and is precisely what I try to solve:

If I set 2 drawings at a distance from a common level, there is no guarantee that there will be spacing between the 2 drawings: as the price expands or contract vertically, the tick per pixel will change, and the drawings will overlap.

What I need is to be able to specify a space between 1 drawing's edge and another, like: keep 2 pixels between top of Text drawing with background 1, and the bottom of text drawing with background 2.
[2022-07-01 15:45:10]
John - SC Support - Posts: 38669
Then refer to the following:
ACSIL Programming Concepts: Custom Free Form Drawing into Chart Window Using GDI (Graphics Device Interface)
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2022-07-01 16:00:38]
BenjFlame - Posts: 335
Thanks, indeed this seems a way to do it.
But I think SC should support pixel coordinate system from ASCIL right out of the box. So distance can be set in pixels and not ticks. So for example we could set drawing at high + x pixels.

This will solve many many placement issues with drawings.

Of course this should not replace the tick axis coordinate system, just complement it.

Take it as a suggestion.
Date Time Of Last Edit: 2022-07-01 17:09:26

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

Login

Login Page - Create Account