Login Page - Create Account

Support Board


Date/Time: Thu, 03 Oct 2024 11:47:01 +0000



Post From: Hotkey for moving buy or sell stop orders?

[2021-03-07 00:10:31]
autobahn - Posts: 25
I've found a way to do this.

1. Create a custom study.
2. Enable sc.ReceiveCharacterEvents.
3. When the study is called, check sc.CharacterEventCode() for the appropriate keypress.
4. Locate the appropriate Stop Order with sc.GetOrderByIndex().
5. Modify the located order with sc.ModifyOrder().

I've been able to expand on this to have other hotkeys that select and highlight the order I want to move, in case of multiple stops.

I've also been able to create a hotkey "Move to breakeven" which will adjust non-attached Stops.


Notes
1. It is not necessary to enable sc.UpdateAlways - keypresses will trigger the study.
2. You cannot use sc.GetNearestStopOrder() as this only returns attached child orders.
Date Time Of Last Edit: 2021-03-07 00:38:29