• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
    http://www.ninjatrader.com/support/h...t7/editing.htm
    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 pjsmith, Today, 04:10 AM
        0 responses
        3 views
        0 likes
        Last Post pjsmith
        by pjsmith
         
        Started by tonynt, Today, 02:21 AM
        0 responses
        7 views
        0 likes
        Last Post tonynt
        by tonynt
         
        Started by alstsion, Today, 12:55 AM
        0 responses
        2 views
        0 likes
        Last Post alstsion  
        Started by kandster, Yesterday, 11:49 PM
        0 responses
        3 views
        0 likes
        Last Post kandster  
        Started by priceisking, Yesterday, 05:33 PM
        0 responses
        26 views
        0 likes
        Last Post priceisking  
        Working...
        X