Login Page - Create Account

Support Board


Date/Time: Tue, 29 Sep 2026 18:09:38 +0000



Post From: ACSIL: letting a custom study use a left-button drag without scrolling (Pointer/Hand tool)

[2026-09-29 13:22:04]
Fabio - Posts: 152
Hello SC support,
I hope this email finds you well.

My Sierra Chart version: 2953

WHAT I AM BUILDING
A custom ACSIL order-entry study. The user arms it with a Custom Study Control Bar button, then on the chart presses the left mouse button at the stop price, drags, and releases at the entry price. The study sizes the position from the stop distance and sends the order. The active tool during normal use is Tools >> Pointer (or Hand).

THE PROBLEM
With Pointer or Hand active, the left-button drag scrolls the chart. The study does receive the pointer events (sc.ReceivePointerEvents set to ACS_RECEIVE_POINTER_EVENTS_WHEN_ACS_BUTTON_ENABLED, and also tried ACS_RECEIVE_POINTER_EVENTS_ALWAYS), but it cannot stop the chart from scrolling, so the price under the pointer never changes and the drag is unusable. With Tools >> Chart Values active, the same drag works perfectly (no scrolling).

WHAT I TRIED
1. Switching the tool from the study to Chart Values when the button is pressed, and back to Pointer afterwards:
- sc.SetChartDrawingTool(DRAWING_TOOL_CHART_VALUES) returns 1, but sc.CurrentlySelectedDrawingTool does not change.
- sc.SetActiveDrawingTool(sc.ChartNumber, DRAWING_TOOL_CHART_VALUES, 0) returns 0. Same result with the last parameter set to 1.
- Both were called on every normal study update for 1.5 seconds after arming, both with the Control Bar button enabled and after disabling it from the study. The tool never changed.
- For reference, sc.CurrentlySelectedDrawingTool reports: Pointer = 0, Hand = 52, Chart Values = 2 (these differ from the DRAWING_TOOL_POINTER = 10 / DRAWING_TOOL_CHART_VALUES = 22 / DRAWING_TOOL_HAND = 23 enum values).
2. sc.BlockChartDrawingSelection = 1 while armed: prevents drawing selection but not scrolling.

CURRENT WORKAROUND (works, but unsupported)
While the study is armed, it subclasses the chart window (SetWindowLongPtr on sc.ChartWindowHandle): it swallows WM_LBUTTONDOWN / WM_LBUTTONUP and removes MK_LBUTTON from WM_MOUSEMOVE, so Sierra Chart never starts its own drag. The original window procedure is restored as soon as the study disarms, on sc.LastCallToFunction and on full recalculation. I would prefer a supported method.

QUESTIONS
1. Is there a supported way for a custom study to take over a left-button drag on the chart (like the built-in drawing tools do), so the chart does not scroll, while Pointer or Hand is the selected tool?
2. What is the correct usage of sc.SetChartDrawingTool and sc.SetActiveDrawingTool to switch the active tool to Chart Values and back to Pointer? Are there conditions under which they are ignored (for example when called from a study, or while a Custom Study Control Bar button is enabled)?
3. If there is no supported method: is temporarily subclassing the chart window from a study safe, or are there known problems we should be aware of?

Thank you very much for your help.

Regards,
Fabio.