Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IB + NT7 Exit On Close problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    IB + NT7 Exit On Close problem

    Hi all,

    I have a very annoying problem with the Exit on Close feature of NT7 (up to and including 1000.7), connected to an IB account.

    Here is a description of the strategies:
    - Broker is IB
    - Instrument is CAC40 future contract, full session (from 8am to 10pm)
    - Each open position is always protected by target profit and stop loss orders, sent using NT's managed approach (SetProfitTarget and SetStopLoss);
    - Open Positions are closed automatically using Exit on close, 30 secs before end of session. Liquidity is always sufficient.

    Now, the problem I have is that the Exit on close handler always detects a problem and shuts down the strategy, as shown below. This always happens and is very frustrating as it requires me to reinitiate the strategy every night.

    Below is an example that happened yesterday (prices and names have been changed).

    11/23/2011 9:59:30 PM|1|128|Exit on close handling for strategy 'StrategyName' started.
    11/23/2011 9:59:31 PM|1|32|Order='841861044/AccountName' Name='Stop loss' New state=PendingCancel Instrument='InstrumentName' Action=Sell Limit price=0 Stop price=1111 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
    11/23/2011 9:59:31 PM|1|32|Order='841861045/AccountName' Name='Profit target' New state=PendingCancel Instrument='InstrumentName' Action=Sell Limit price=3333 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
    11/23/2011 9:59:31 PM|1|32|Order='9e840314fdc5452b916ae478ff33ef64/AccountName' Name='Exit on close' New state=PendingSubmit Instrument='InstrumentName' Action=Sell Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
    11/23/2011 9:59:31 PM|1|32|Order='841861045/AccountName' Name='Profit target' New state=Rejected Instrument='InstrumentName' Action=Sell Limit price=3333 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=OrderRejected Native error='Cancel attempted when order is not in a cancellable state. Order permId =841861045 (161)'
    11/23/2011 9:59:31 PM|0|32|IBGW, Cancel attempted when order is not in a cancellable state. Order permId =841861045 (161) affected Order: Sell 1 Limit @ 3333
    11/23/2011 9:59:31 PM|0|128|Strategy 'StrategyName/3c79c63235fa42c69255f209c1c90978' submitted an order that generated the following error 'OrderRejected'. Strategy has sent cancel requests, attempted to close the position and terminated itself.
    11/23/2011 9:59:31 PM|1|32|Order='841861044/AccountName' Name='Stop loss' New state=Cancelled Instrument='InstrumentName' Action=Sell Limit price=0 Stop price=1111 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='Order Canceled - reason: (202)'
    11/23/2011 9:59:31 PM|1|32|Order='841861045/AccountName' Name='Profit target' New state=Cancelled Instrument='InstrumentName' Action=Sell Limit price=3333 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='Order Canceled - reason: (202)'
    11/23/2011 9:59:31 PM|2|4|Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed. 2109
    11/23/2011 9:59:31 PM|1|32|Order='841861046/AccountName' Name='Exit on close' New state=Accepted Instrument='InstrumentName' Action=Sell Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
    11/23/2011 9:59:31 PM|1|32|Order='841861046/AccountName' Name='Exit on close' New state=Working Instrument='InstrumentName' Action=Sell Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
    11/23/2011 9:59:31 PM|1|32|Order='841861046/AccountName' Name='Exit on close' New state=PendingCancel Instrument='InstrumentName' Action=Sell Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
    11/23/2011 9:59:31 PM|1|32|Order='841861046/AccountName' Name='Exit on close' New state=Filled Instrument='InstrumentName' Action=Sell Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=1 Fill price=2222 Error=NoError Native error=''
    11/23/2011 9:59:31 PM|1|16|Execution='InstrumentName/0000ef55.4ecc933e.01.01' Instrument='InstrumentName' Account='AccountName' Exchange=Monep Price=2222 Quantity=1 Market position=Short Operation=Insert Order='841861046' Time='11/23/2011 9:59:31 PM'
    11/23/2011 9:59:31 PM|0|128|An over fill was detected on order 'Order='841861046/AccountName' Name='Exit on close' State=Filled Instrument='InstrumentName' Action=Sell Limit price=0 Stop price=0 Quantity=1 Strategy='StrategyName' Type=Market Tif=Gtc Oco='' Filled=1 Fill price=2222 Token='93b3dcdebd754956af6579c70da6d6e8' Gtd='12/1/2099 12:00:00 AM'' generated by strategy 'StrategyName/3c79c63235fa42c69255f209c1c90978' : This strategy will be disabled and NinjaTrader will attempt to cancel/close any strategy generated orders and positions. Please check your account orders and positions and take any appropriate action.
    11/23/2011 9:59:31 PM|1|32|Order='841861046/AccountName' Name='Exit on close' New state=Rejected Instrument='InstrumentName' Action=Sell Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=1 Fill price=2222 Error=OrderRejected Native error='Order rejected - reason:Cannot cancel the filled order (201)'
    11/23/2011 9:59:31 PM|0|32|IBGW, Order rejected - reason:Cannot cancel the filled order (201) affected Order: Sell 1 Market
    11/23/2011 9:59:31 PM|1|32|Order='841861046/AccountName' Name='Exit on close' New state=Filled Instrument='InstrumentName' Action=Sell Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=1 Fill price=2222 Error=NoError Native error=''
    11/23/2011 9:59:32 PM|1|64|Instrument='InstrumentName' Account='AccountName' Avg price=0 Quantity=0 Market position=Long Operation=Remove Currency=Euro
    11/23/2011 9:59:39 PM|1|128|Disabling NinjaScript strategy 'StrategyName/3c79c63235fa42c69255f209c1c90978'


    Any idea?

    Thank you!

    Lct

    #2
    Hi Lector, thanks for the post - NT shuts your strategy as it experiences a rejected order communicated from IB, as it attempts to cancel your profit target resting on the account :

    11/23/2011 9:59:31 PM|1|32|Order='841861045/AccountName' Name='Profit target' New state=Rejected Instrument='InstrumentName' Action=Sell Limit price=3333 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=OrderRejected Native error='Cancel attempted when order is not in a cancellable state. Order permId =841861045 (161)'

    Best would be checking with IB support on why exactly this message was returned to you.
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kaywai, Today, 12:05 PM
    0 responses
    3 views
    0 likes
    Last Post kaywai
    by kaywai
     
    Started by DTSSTS, 01-14-2022, 02:53 PM
    3 responses
    24 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by SuperDude123, Today, 05:17 AM
    2 responses
    18 views
    0 likes
    Last Post SuperDude123  
    Started by iamkmckinney, Yesterday, 10:52 PM
    2 responses
    23 views
    0 likes
    Last Post iamkmckinney  
    Started by ラリー, Yesterday, 10:18 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X