You are right, in principle, as with IB's API, what looks like an easy job turns out to be complicated. I'm sorry to say that but it's my experience.
In this case, however, the stop would always be so far away that it will never be triggered as long as JBT runs and has connection to IB. As the user (a) defines the stop (as a number of ticks from the entry) and (b) defines the strategy, it is his/her responsibility to issue a setPosition(0) within the strategy way before such an emergency stop would be reached. By definition such an emergency stop order may ONLY be triggered when JBT stops for some reason. There is one further simplification that I can imagine: Instead of cancelling the existing stop order and issue a new strategy order: Update the existing stop order to reflect the new strategy order (just place order with the stop order's order ID) Then place the new stop order if position not zero But there is also a complication to it because there is not always an existing stop order, namely when the position is zero. -- You received this message because you are subscribed to the Google Groups "JBookTrader" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jbooktrader?hl=en.
