I’ve modified Jessica’s script demonstrating how to assign an order to an order object, print that orders order ID, and modify the price of that order which was created from an ATM and opened from a superdom.
Within the foreach loop in State.DataLoaded, I check if the order name is “Stop1”, and if so, I assign that order an order object (stopOrder) as well as print that orders OrderID.
Within OnBarUpdate, I modify the order object’s stop price and submit that change.
To test this script, create a ATM template called AtmStrategy, with a stop and profit target of 5 ticks. Connect to the simulated data feed, open a superdom, select the ATM template AtmStrategy, and submit a market order. Then enable the attached strategy in the strategies tab, while an output window is open. You will see the order id printed as well as the stop move back 5 ticks.
Please let us know if you need further assistance.
Comment