Strategy starts out flat. It then gets a signal and buys or sells 1 unit. Then it does nothing until it gets it's next signal, which would be a single buy or sell of 2 units. And it would keep doing this until the strategy was turned off.
I have built the strategy using managed orders using EnterLong() and EnterShort(), however when it executes it submits two trades of 1 unit each. So if it starts flat, then enters a long at 1 unit, it will flip position using two trades - a sell of 1 unit to get to flat and then another sell of 1 unit to become short.
While convenient code wise, practically this has a number of issues. Can a strategy be programmed as I described using managed orders?
Or do I need to use unmanaged orders? I'm feeling that I probably do... so... is there an example or demo file detailing some of the intricacies of Unmanaged orders? Like how you handle partial fills or if the market moves away and canceling live orders and handling errors?
Thanks much!
Comment