Today's scenario was as follows.
1. On 3/31, I went long 450 shares of [email protected]. A profit target of 2 ATR, or 69.88, was set.
2. Today (4/2), at 2:10 PM, my strategy switched sides. Instead of being short 450 shares, I was short 900 shares. A profit target of 2 ATR, or 64.39, was set.
Reading the trace file, I think that the very first thing that happens in this sequence is that the profit target is modified to the new price, but the type (e.g. sell to buy) is not changed. Here is the line:
2008-04-02 14:10:11:249 (IB) IB.OrderRequest.Send: tmOrderId='574568958' orderId ='4709' instrument='IYR' expiry='' strikePrice=0 right='' exchange='SMART' action='SELL' limitPrice=64.39 auxPrice=0 quantity=450 type='LMT' tif='GTC' oca='NT-00084'
This order gets filled right away (with several fills like this one):
2008-04-02 14:10:11:391 (IB) IB.ExecutionsRequest.Process: id='00011f47.47f37e4e.01.01' instrument='IYR' orderid='574568958' account='XXXXXXXXX' filled=100 price=68.96 side='SLD' permId='574568958' liquidation=0
Afterwards, I see the 'Close position' and 'Sell short' orders get processed, but I have already gotten fills on this symbol as shown above.
This does not happen when running against the simulator.
I have the trace file if you need the whole thing. I am running without profit targets for the time being as I suspect they are the cause.
This is still on beta 10 as I did not notice release 1 was out until after the market opened.

Comment