Login Page - Create Account

Support Board


Date/Time: Sun, 07 Sep 2025 19:11:58 +0000



ACSIL Windows GDI Wrapper functions with sc.DoNotRedrawChartAfterStudyReturns

View Count: 359

[2025-05-22 08:24:18]
User346098 - Posts: 50
is it possible to have a variable like sc.AllowDrawingOfGDIAlways to draw GDI drawings even when sc.DoNotRedrawChartAfterStudyReturns = 1, is ON
If drawing with GDI wrapper functions and with sc.DoNotRedrawChartAfterStudyReturns = 1 it dosen't draw, and with sc.DoNotRedrawChartAfterStudyReturns = 0 it isn't as smooth as when using native SierraChart drawing tools

so allow GDI drawings but do not redraw chart for performance reasons when sc.DoNotRedrawChartAfterStudyReturns = 1
Date Time Of Last Edit: 2025-05-22 08:26:15
[2025-05-22 14:01:16]
Sierra_Chart Engineering - Posts: 20829
Not sure we understand this, but either the chart is drawn in its entirety or not drawn. It is not possible to just draw Chart Drawings and not other parts of the chart. Everything has to be drawn together, at the same time.

Thinking about this some more, we think we understand what you are referring to. Sierra Chart built-in drawing tools, use an exclusive or drawing mode. This does not always work like with text. We would have to see how this would be possible to do from ACSIL. Not very simple and is not something we really can concentrate on right now.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2025-05-22 14:03:30
[2025-09-02 21:33:37]
User346098 - Posts: 50
I need a Sierra Chart variable or mechanism to ensure the function assigned to sc.p_GDIFunction runs after my Study function returns, even when sc.DoNotRedrawChartAfterStudyReturns == 1.

Current behavior with sc.ReceivePointerEvents = ACS_RECEIVE_POINTER_EVENTS_ALWAYS_FOR_ALL_TOOLS:
• On sc.PointerEventType == SC_POINTER_MOVE, the Study function is called.
• If sc.DoNotRedrawChartAfterStudyReturns == 0, the chart redraws and sc.p_GDIFunction is called (as expected).
• If sc.DoNotRedrawChartAfterStudyReturns == 1, there is no redraw, and sc.p_GDIFunction is not called.

Separately, I notice sc.p_GDIFunction does get called regardless of the Study or the DoNotRedraw state whenever a redraw is forced by other UI actions:

1. "Any chart movement (zoom in/out with the wheel, pan/scroll left-right, drag)"
2. "Mouse button down"
3. "Returning focus to the chart window"
4. "Selecting a drawing for adjustment"

In all of these cases the GDI drawings render correctly.
[2025-09-03 01:45:33]
User719512 - Posts: 321
Interesting post @User346098. Not sure I understand your use case, nor do I understand how this flag should be used as none of the Sierra Chart samples seem to use it and the docs mention using it for performance reasons.
ACSIL Interface Members - Variables and Arrays: sc.DoNotRedrawChartAfterStudyReturns

Are you setting this in certain circumstances in your code?

If your study were to set its own Persistent variable, your GDI function could check for this, then the overhead would be a call to your function which could return right away. Not technically as fast as Sierra checking the flag and not calling your function, but also not that much of a hit overall.

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

Login

Login Page - Create Account