a. Maintaining the delta distance between the price the strategy wants the price and where the user wants it
b. Or instead the strategy no longer moves the orders ( with a further option that if the user drops the order at the same price that the strategy wants then the strategy again resumes moving it ).
Without the ability for the strategy to know if a user moved the order I can't be sure of a way to program this. I thought of maintaining some price history and comparing values between Order.LimitPrice, where the strat last set it, where the strat wants it this time, etc. But even if I think I've worked that out there's a couple of things that give me pause: 1, it's complicated logic and 2, I'm not sure if it be introducing a race condition. For example, is a query to Order.LimitPrice in an OnBarUpdate gauranteed to be the price that's already been received by the exchange and is showing in the NT UI? There could be network congestion that causes setting it to be delayed. That's why I'm more confident about a solution to this that involves using OnOrderUpdate. If the OrderUpdate method provided a flag to indicate if the update was caused by user or the strategy then I think it would be a more straight forward implementation.
Comment