Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Historical Fill Processing in NT8

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

    Historical Fill Processing in NT8

    I am regular user of Ninja7. I recently looked to switch to Ninja8 due to presumed enhanced back-testing features for automated system development.

    I am very confused with a feature of Ninja 8 - the historically fill processing.

    I have tried to create a very simple system using as an example a moving average to trigger a trade. Using the update on price change property and testing the difference between simple/standard fill processing and the fill processing where you can choose a different timeframe. If I use 15 minutes as my primary time series and then choose 1 minute for the fill processing I see no different at all - the trade is always initiated at, say, the beginning of the next bar. I have tried different trade types, since I thought I had read that some trade types (i.e. market) cannot be initiated intrabar.

    So - is there something I am doing wrong? What is the primary intent of this feature of historical fill processing? I cannot seem to get it to do anything.

    Is there an example where it is implemented and there is a clear difference and advantage to its use?

    Thanks in advance.

    Nick

    #2
    Hello bobajob78,

    Thanks for your post.

    Historical Fill Processing is different than processing strategy logic intrabar. NinjaTrader uses the underlying data series to create the order fill simulation, unless the strategy uses High Order Fill Resolution to simulate order fills on a smaller data series. It is meant to give you an idea on where the order would fill depending on the data series used to simulate the order fill. (Using 1 tick will give a more accurate order fill since the exact market price at the time will be known.)

    Historical processing for strategy logic is also forced to calculate on bar closes, unless Tick Replay is used. Tick Replay is also not compatible with High Order Fill Resolution, and the orders must be submitted to a smaller data series in the strategy's logic. So if you are using Tick Replay with the strategy, it would be useful to implement intrabar granularity for order fill simulations so your backtest fills look consistent with the order submission.

    Developing for Tick Replay - https://ninjatrader.com/support/help...ick_replay.htm

    Backtesting with intrabar granularity - https://ninjatrader.com/support/help...ipt_strate.htm

    Please let us know if you have any additional questions.
    JimNinjaTrader Customer Service

    Comment


      #3
      Jim,

      Thanks with all that being said could you please give an example of where the Historical processing is supposed to be used, and where it adds value. I still don't understand where it offers a benefit.

      A quote from the user manual says "For greater order-fill resolution and accuracy in strategy backtesting, you can use the High Fill Resolution in the Strategy Analyzer."

      But I see no example of this. Instead above you say for Tick replay (where it doesn't apply) and Backtesting with intrabar granularity (where it is done manually).

      Sorry I don't want to be obtuse, I just don't have an example. Would it be possible to upload a very simple system, that I could then change between the 2 settings in the Strategy Analyzer?

      Comment


        #4
        Hello bobajob78,

        Historical processing refers to when the strategy processes historical data. When a strategy is enabled, it processes historical data to identify which trades have been made by that strategy. This determines the strategy position (not to be confused with the actual account position.)

        All order fill simulations for historical data use the underlying data series. So you are using OHLC values of a bar to simulate where the order may have filled. This is not fully accurate, but gives you a rough idea for where the order was filled and is very efficient.

        High Order Fill Resolution submits orders to another data series. You can get more accurate fills this way, but this is not compatible with Tick Replay. If you want to use Tick Replay and have your orders filled against a single tick data series, that data series will need to be added to the script and the strategy will have to submit orders to the single tick data series.

        Tick Replay is used to have the strategy use Calculate.OnEachTick or Calculate.OnPriceChange so the strategy processes OnBarUpdate intrabar. Order fill simulations are still filled by the underlying data series, however. As such, an order that is submitted intrabar, may ber filled with OHLC data points and the fill may look wrong. Submitting the orders to a single tick data series can simulate order fills that make more sense in the context of an order that is submitted mid bar.

        Tick replay is used to process historical data intrabar while High Order Fill Resolution (or following the Backtesting with intrabar granularity example) is used to have the orders filled at more accurate prices.

        In other words, a strategy that uses Tick Replay can submit orders in the middle of a bar, but the prices used to fill that order will not be as accurate as submitting that order to a single tick data series.

        Attached is a demo explaining these behaviors further - https://drive.google.com/file/d/1g7W...w?usp=drivesdk

        Please let us know if we can be of further assistance.
        JimNinjaTrader Customer Service

        Comment


          #5
          Jim,

          I really appreciate the time taken to explain this. I will try to work an example myself, but I think the issue comes with the difference between how orders are filled once they are submitted and whether they are submitted intrabar or not. If that makes any sense. I guess maybe my strategies require the bar to be completed prior to submitting the order, even if I have the update on price change included, and I want it to initiate intrabar. And therefore it is just negating any fills in the first place. As I say I think I'm getting closer to getting this. Will over it till it is clear.

          Thanks,

          Nick.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by GwFutures1988, Today, 02:48 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by ScottWalsh, 04-16-2024, 04:29 PM
          6 responses
          30 views
          0 likes
          Last Post ScottWalsh  
          Started by frankthearm, Today, 09:08 AM
          10 responses
          36 views
          0 likes
          Last Post frankthearm  
          Started by mmenigma, Today, 02:22 PM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by NRITV, Today, 01:15 PM
          2 responses
          9 views
          0 likes
          Last Post NRITV
          by NRITV
           
          Working...
          X