Any trick to setting up OCO orders via QScript? I had this part of code:
Code: Select all
ib_cancelall();
mp = abs(ib_marketposition());
ref1 = IB_PlaceOrder("buy",mp,low_offset,"limit","gtc","myoco");
ref2 = IB_PlaceOrder("buy",mp,high_offset,"limit","gtc","myoco");
When my script ran, it seemed to do nothing. My only thought was that the initial entry of the position was not done via the script, but via live off the chart. Perhaps "mp" was not set? So therefore ignored? Or do I need to do something more to tie these orders together?
(I also remember that there was discussion about OCO orders on this forum before, but I could not find anything via the search. So perhaps it was the old forum?)