Support Board
Date/Time: Wed, 05 Mar 2025 09:00:24 +0000
Post From: (ACSIL) How do I trigger a subgraph when exiting a trade from an attached order?
[2019-06-21 01:28:43] |
Tom Hanks - Posts: 20 |
Triggering a subgraph to indicate where you entered a position is straight forward, but I'm not sure what the best way to achieve this is for exiting when using attached orders. My guess is to do a check like this on every bar: sc.GetOrderByOrderID for all attached stop and target orders (order ids saved with persistent variables) and then use s_SCTradeOrder::OrderStatusCode to check if the orders are SCT_OSC_FILLED. If one of my exit orders = SCT_OSC_FILLED then draw a subgraph indicating an exit as I would on entry orders. Would this be the best way or is there something easier? Thanks!! |