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 NullPointStrategies, Today, 05:17 AM
        0 responses
        44 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        124 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        65 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X