Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Analyzer Tick Data

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

    Strategy Analyzer Tick Data

    My strategy trades on tickdata with AddDataSeries(Data.BarsPeriodType.Tick, 1)

    Does Strategy Analyzer have access to BarsArray[1].LastPrice



    #2
    Hello dibDab,

    Thanks for your post.

    Please review the help guide document on the differences on real-time vs backtest (historical).
    http://ninjatrader.com/support/helpG...ime_vs_bac.htm

    When in historical data, only the Open, High, Low, and Close will be available and there will be no intra-bar data. This means actions cannot happen intra-bar, fills cannot happen intra-bar. All prices and actions come from and occur when the bar closes as this is all the information that is known.

    Because of this, OnBarUpdate will only update 'On bar close' as it does not have the intra-bar information necessary for 'On price change' or 'On each tick' and the script will not have the intra-bar information to accurately fill an order at the exact price and time.​

    This could be possible by enabling Tick Replay when running backtests. Tick Replay would be used to have the logic process OnEachTick or OnPriceChange with historical data.

    Note that this does not allow for intra-bar order fills. You would need to submit orders to that single-tick data series for a strategy that uses Tick Replay.​

    ​TickReplay — https://ninjatrader.com/support/help...ick_replay.htm

    Developing for Tick Replay -
    https://ninjatrader.com/support/helpGuides/nt8/developing_for__tick_replay.htm?zoom_highlightsub= developing+for+tick+replay

    Additional information may be found in this NinjaTrader Forum post —
    https://ninjatrader.com/support/foru...mance?t=102504

    Let me know if I may assist further.​
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      ok thanks but my strategy calculates on each tick and I use tick replay from the added tick series to submit orders, this works fine on a chart. just not on Strategy Analyzer.

      Does Strategy Analyzer have access to BarsArray[1].LastPrice, when I do a Print in SA there is no value for BarsArray[1].LastPrice but there is in a chart.
      Last edited by dibDab; 03-07-2023, 02:46 PM.

      Comment


        #4
        Hello dibDab,

        Thanks for your note.

        I have created a very simple strategy script that adds a 1-Tick series to the script and prints out BarsArray[1].LastPrice to the Output window.

        When I run the script in the Strategy Analyzer with Tick Replay enabled, I do see the print appear in the Output window. See the attached screenshots.

        That said, you could consider using the Playback connection to test your script instead of using the Strategy Analyzer.

        Playback: https://ninjatrader.com/support/help...8/playback.htm

        Please let me know if I may assist further.
        Attached Files
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          all ok, my error

          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