Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddDataSeries(Data.BarsPeriodType.Tick, 1) vs Calculate = Calculate.OnEachTick

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

    AddDataSeries(Data.BarsPeriodType.Tick, 1) vs Calculate = Calculate.OnEachTick

    Hello,

    In my strategy, I have two data series, one is set up with Calculate = Calculate.OnBarClose; and the other set up with AddDataSeries(Data.BarsPeriodType.Tick, 1) .
    With that setup, my OnBarUpdate() will be called on every tick as well on every bar closed. Is my understanding correct? Thanks

    Billy

    #2
    Hello Billy,

    Thanks for your post.

    Calculate.OnBarClose is not a data series. The Calculate method determines how often OnBarUpdate() is called. If this is set to OnBarClose, the OnBarUpdate() method will process at the close of each bar.

    See this help guide page about Calculate: https://ninjatrader.com/support/help.../calculate.htm

    AddDataSeries() will add a secondary data series to your script. That added series can be used to calculate values or place trades based on that series.

    See this help guide about AddDataSeries(): https://ninjatrader.com/support/help...dataseries.htm

    For example, Close[0] could be used to get the close price of the primary series the script is running on. Closes[1][0] could be used to get the close price of the first added data series.

    Close: https://ninjatrader.com/support/help.../nt8/close.htm
    Closes: https://ninjatrader.com/support/help...nt8/closes.htm
    PriceSeries: https://ninjatrader.com/support/help...riceseries.htm

    Also, it is important to review this help guide page when working with Multi-Timeframe and Multi-Instrument NinjaScripts: https://ninjatrader.com/support/help...nstruments.htm

    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
      Hello Brandon,

      Thank you for your reply. It is my understanding that with AddDataSeries(Data.BarsPeriodType.Tick, 1), the OnBarUpdate() will be called on every tick, in addition to the on Bar closed. Is that correct? Thanks.

      Billy

      Comment


        #4
        Hello Billy,

        Thanks for your note.

        Yes, AddDataSeries() will add the secondary Tick series to the script which will calculate at the close of each bar.

        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

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        88 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        134 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        119 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        67 views
        0 likes
        Last Post PaulMohn  
        Working...
        X