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

Difference between TickData and CalculateOnBarClos

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

    Difference between TickData and CalculateOnBarClos

    I want to work with each incoming tick of data volume (price, volume).
    I would like to know which is the difference between adding a new tick dataseries as:

    Add(PeriodType.Tick, 1);

    and then do the script logic inside: if (BarsInProgress==1) then {logic}

    or setting the property:

    CalculateOnBarClose=false;

    and then do the script directly in the OnBarUpdate().

    Do they provide the same kind of data?

    Thank you.
    Last edited by bonnies; 06-15-2017, 07:52 AM.

    #2
    Hello bonnies,

    Adding a 1 tick series would allow the script to load the tick data historically to be used for triggering OnBarUpdate for each tick historically as well as to use for fill prices adding granularity to a larger timeframe historically and this would also work in real-time.


    Using CalculateOnBarClose as false would cause OBarUpdate to trigger for each tick in real-time but does not work historically.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you very much for the explanation.

      If I add the new tick data series at 1 tick for having the data tick historically and then when running in real time I also set the CalculateOnBarClose to false, what does Ninjatrader in this situation: does it has two tick data series overloading the cpu or it only works with one data tick series because both are the same?

      Thank you again for your support.

      Comment


        #4
        Hi bonnies,

        When a bar is closing, OnBarUpdate does not trigger for the tick. So if the primary bar is closing, there isn't a second update for the tick being received.

        Which means, if you were to add a 1 tick series to a script and CalculateOnBarClose is false, OnBarUpdate is only going to trigger once for each tick (secondary bar closing) and once for each primary bar update (a tick being received).

        In other words you would only see two updates each time a tick comes in instead of 3 (or even 4 when when primary bar closes).
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,607 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        9 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        19 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        6 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        16 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X