Eugene, I just reread all the posts to this topic and for simplicity have the following recommendation:
1. It is the responsibility of the user that he/she has enough margin to trade the desired quantity of contracts. Anyway, I believe that order rejections are already handled by JBT in some way. 2. It would be desirable to have the option of having a stop loss for emergency situations , i.e. lost internet connection. 3. With every order submission, cancel any previously submitted orders for this contract and submit a new stop loss order after having submitted the strategy order. 4. Define in your strategy how far away from the entry price the stop price should be. 5. It is the user's responsibility that he/she choses a stop loss offset within the strategy that is always bigger than the highest loss allowed by the strategy. Example: When you want to go long for 1 contract ES June 2011, - check if there already exists an open order for contract ES June 2011 (reqOpenOrders). - if yes cancel that order - submit the buy order (1 contract), you will go long by one contract - submit the appropriate stop loss sell order (1 contract, stop price according to StrategyES) Now you want to go short by 1 contract: - check if there already exists an open order for contract ES June 2011 (reqOpenOrders). - yes it exists, it's the emergency stop loss sell order: cancel that order - submit the sell order (2 contracts) from the strategy, you will go short by 1 contract - submit the appropriate stop loss buy order (1 contract, stop price according to StrategyES) With this, you don't even have to deal with parent and child orders. I cannot imagine a simpler way. Would that be feasible? I'd rather not implement this myself, however. Alexander -- 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.
