Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ignore Erroneous trades

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

    Ignore Erroneous trades

    hello,

    I'd like to code into a strategy the capability to ignore bad tick data. Something like:
    if ( last traded price >/< 30 * TickSize +/- CurrentBid/Ask) ignore that tick. I use Iqfeed for data.

    I'm finding that when I put a profit target into a strategy and then backtest it will often exit on what appears to be erroneous trades or trades that are far off from the high low of a bar. Now those trades probably did occur but they were most likely for a very small lot size and it would be highly unlikely that my strat's profit takers would get filled in a similar scenario when running real time.
    I provided an image with an example. The close of the profit taking bar close at 109.85 but it shows a wick that traded down to 109.30. I believe that is either erroneous or very small size therefore it's unlikely my profit taking order at 109.57 would have been filled in that bar.

    thanks
    Attached Files

    #2
    Hello Wahooj,

    I'm not sure how you would exclude that trade. Set statements like your profit target will use the last value they were set to. In backtesting, conditions are evaluated at the close of a bar. With this sequence of events you can't evaluate the bar until it's completed and it would already result in a fill.

    You may need to look at the data itself, and edit the values you feel are incorrect. You can do this in version 7 by clicking Tools > Historical Data Manager.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hmm, i figured it would be a stretch or involve some long manual erasing of the individual instances. Backtesting over a couple year period this occurs way to often to manually do it. Is there a way you can think of to script something that would deleted those entries?

      Comment


        #4
        Unfortunately, there's no way I'm aware of with the default fill options. It may be possible by programming your own fill type.

        You can view the existing fill types by browsing to:

        My Documents\NinjaTrader\bin\custom\type

        There are DefaultFillType.cs and LiberalFillType.cs
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by f.saeidi, Today, 12:14 PM
        7 responses
        16 views
        0 likes
        Last Post f.saeidi  
        Started by Russ Moreland, Today, 12:54 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by philmg, Today, 12:55 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by TradeForge, 04-19-2024, 02:09 AM
        2 responses
        32 views
        0 likes
        Last Post TradeForge  
        Started by aprilfool, 12-03-2022, 03:01 PM
        3 responses
        329 views
        0 likes
        Last Post NinjaTrader_Adrian  
        Working...
        X