Support Board
Date/Time: Sun, 15 Jun 2025 07:02:47 +0000
[Programming Help] - C# program for copying key strokes from one SC instance to another one
View Count: 206
[2025-06-04 11:51:08] |
User887627 - Posts: 5 |
Hi SC team, I’m running two instances of Sierra Chart on the same Windows PC and I’m using a custom C# application to mirror keystrokes from one instance (the active one) to the other (in the background). This is to synchronize trading hotkeys between both instances. What works: Regular SC chart hotkeys (like Buy Market, Flatten, Cancel All, etc.) do trigger on the background instance when I mirror the keys using PostMessage or WM_KEYDOWN. What doesn’t work: The Trade Executor study hotkeys (like the one set to Key = 80 for 'P') do not react to mirrored keystrokes. I tried sending the keys via: PostMessage with WM_KEYDOWN / WM_KEYUP SendInput (which only works for the active window) WM_CHAR Various combinations with and without scan codes In all cases, the background SC instance receives the keystroke (verified in logs), but the study does not respond. My suspicion (confirmed by behavior): The study may be using GetAsyncKeyState() or a similar low-level API to detect key presses, which only works for real physical key presses and not simulated ones via Windows messages or injected input. My Question: Is the Trade Executor study designed to respond only to actual physical keyboard input? Or is there a recommended way to trigger its hotkeys externally (e.g. via DTC, shared memory, file commands, or another IPC mechanism)? Thanks in advance! |
[2025-06-05 21:44:56] |
Sierra_Chart Engineering - Posts: 19916 |
This is not within the scope of our support.
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 |
[2025-06-05 22:36:09] |
User719512 - Posts: 315 |
@User887627, perhaps some "trade copier" studies (search for them) might be a more optimal solution.
|
To post a message in this thread, you need to log in with your Sierra Chart account: