Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to handle outlier data

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

    How to handle outlier data

    My data feed occasionally registers data values that are excessively outside of the actual market values. For example, last night I got a value for EUR/USD of -1.0 from IBKR at 12:07 am. My strategy uses stop orders to enter/exit trades and it triggered a fill, resulting in an extreme loss. Luckily I'm in simulation mode. But since I use stops, I don't know how to prevent my strategy from exercising the stop. Seems like the order should be rejected because of the extreme value but it doesn't. Is it proper to capture this situation in OnOrderUpdate and cancel the order there? Or is there another built-in method for handling this that I haven't seen?

    #2
    Hello dweems,

    It would not be possible to prevent an accepted or working order from filling on the exchange (or simulation engine).

    You can cancel an order before it fills if it is accepted or working as long as this is not from a Set method by assigning this to a variable in OnOrderUpdate() using CancelOrder() supplying the variable holding the order.

    A stop order would only be rejected when it is being submitted if the buy stop price is below the ask or the sell stop price is above the bid.

    You can filter out back ticks with the option in the Tools window.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Would OnOrderUpdate catch the condition earliest or might OnMarketData be faster. I've not yet found where to use OnMarketData but maybe this would be an example where you would catch the price getting extreme the quickest way possible?

      Comment


        #4
        Hello dweems,

        If an order is working on an exchange and there is a valid price on an opposing order, that order is most likely going to fill before the market data of that opposing order is received by your local computer. There is transmission time for market data while the order would be filling on the exchange server without transmission time.

        It depends on what you want to do.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        43 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        21 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        30 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        50 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Working...
        X