Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Live Strategy Error

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

    Live Strategy Error

    Hello,
    I am having a serious issue with live trading.

    this is the sequence of events:
    - One of my strategies issued a buy order for 1 ES contract.
    - InteractiveBrokers: issued a warning message: Your order was repriced so as not to cross a related resting order.
    - NinjaTrader: assumed the order is cancelled, not executed and terminated the strategy removed stop loss and target orders.
    - InteractiveBrokers: executed the order at slightly higher price. (timestamped one second later)
    - NinjaTrader reads the new execution as an open position not related to any strategy.

    I couldn't understand the issue for a long time but now I guess I do. It seems that NinjaTrader (NT) is misreading this warning message as a rejection of the order when it is basically slippage and/or repricing. Then NT terminates the strategy although it executed the order a second later.

    What is the solution for this? I know you will probably suggest I refrain from using market orders.. but that is weird. I also noticed this same issue happening with stop limit orders as well.

    I'm not 100% sure my understanding is correct let me know thanks.​​

    #2
    Hello ahpeak951,

    From the details it sounds like IB issued a native error which is a rejection of the order. that means the broker rejected the order for the reason given.

    When a strategy gets a rejection the default action is to stop the strategy which would explain the other events you listed.

    If the entry was not filled then the targets will not have an associated entry and would get canceled if active otherwise would not be submitted. When a strategy is stopped it can additionally cancel target orders based on the options in the Tools -> Options -> Strategies menu.

    The interactive brokers executing another order would not be expected however if your strategy submitted two entries in fast repetition that would explain having 1 position open and the other getting rejected. If you submit a market order to buy, and immediately after a market order to sell the same instrument while the first order is not yet executed, the second order will be rejected, because you are effectively "trading with yourself". This is an error that IB will reject with the message you are seeing.

    NinjaTrader would still see the live account position which would be 1 and that would not be related to a strategy because the strategy had a rejection and was disabled.

    The solution would be to explore how your logic is working in that use case. If you continue to see this I would suggest looking at the order log first to check if you are submitting multiple market orders at a fast frequency. You can also contact your broker to discuss the individual order and why it was rejected. After knowing the specifics of the situation you could adjust logic as needed to avoid submitting orders at that frequency.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    66 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    141 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    76 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    47 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    51 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X