Boise, Idaho/United Sates
Experience: Advanced
Platform: NinjaTrader
Trading: CL, 6E, 6J, GC, ES
Posts: 25 since Jun 2014
Thanks Given: 38
Thanks Received: 23
|
An approach could be to save all Order objects generated by the strategy to a list within the strategy. Then on termination you’d loop through the strategy’s orders and cancel those that are pending, as well as submit a closing order at market for the strategy’s outright quantity (I.e. sell 2 at market if strategy is net long 2 at the time of termination).
|