Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Incorrect price appearing on the execution data grid

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

    Incorrect price appearing on the execution data grid

    I've been working with Ninjascript for a while now and just when I thought I had nailed my backtesting strategy, I realized that the execution data grid was displaying the incorrect price entry and exit. What do I need to do to get this to display the proper entry and exit?

    I've been digging around for answers and I've discovered it's best to type up the script myself, rather than having to rely on the strategy wizard. What are my options here?

    #2
    Welcome to the forums escobar63!

    Historical order fill simulations are estimated from the OHLC values of the data series the strategy is applied against. If your strategy does not use multiple time frames or Tick Replay, High Order Fill Resolution can be used to simulate order fills with a smaller data series, like a single tick data series. Alternatively, the strategy can be written to submit orders to a single tick data series for order fills that are more consistent with real market movement.

    Strategies can also be tested with Market Replay data in the playback connection to have orders filled as if they were submitted in a realtime context.

    Discrepancies Between Realtime and Backtest - https://ninjatrader.com/support/help...ime_vs_bac.htm

    Historical Fill Processing - https://ninjatrader.com/support/help...ical_fill_.htm

    Backtesting with Intrabar Granularity — https://ninjatrader.com/support/help...ipt_strate.htm

    For a more comprehensive study on these differences, my colleague Chelsea has a series of videos comparing the different scenarios where order fills are simulated.

    Comparing real-time, historical, and replay performance — https://ninjatrader.com/support/foru...mance?t=102504

    Please let me know if I can be of further assistance.

    Comment


      #3
      Thank you so much for responding! Bear with me because all of this is still relatively new to me.
      Does intrabar granularity involve different OHLC values?
      Where can I get access to Chelsea's videos?

      Thanks in advance!

      Comment


        #4
        Hello escobar63,

        Adding intrabar granularity would involve submitting orders to a single tick data series so the orders will be filled following intrabar movement. (The OHLC values would be the tick price, and that tick price would be used for the order fill.)

        As for Chelsea's videos, they are linked within his forum post. The videos are recorded in flash format, so you may need to enable flash on your browser in order to view the videos.

        Direct link to videos - https://www.screencast.com/t/c73xusjul

        Let us know if you have any questions.

        Comment


          #5
          Based on what I've read. When running backtests, strategies can ONLY be processed at the close of each bar. Is this correct?
          I'll have to look at the video when I'm at my office. Thank you so much!

          Comment


            #6
            Hello escobar63,

            Historical data processing is forced to Calculate.OnBarClose. If you would like to calculate historical data OnEachTick or OnPriceChange, Tick Replay can be enabled. Please note that Tick Replay will not change the way orders are filled. (Orders will still fill based on the OHLC data the order is submitted to.) When using Tick Replay, you could add a single tick data series to the strategy and have orders submitted to the single tick data series for intra bar order fills.

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

            Please let us know if you have any additional questions.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            52 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            130 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            70 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            44 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            48 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X