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 yertle, Yesterday, 08:38 AM
        7 responses
        28 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by bmartz, 03-12-2024, 06:12 AM
        2 responses
        21 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by funk10101, Today, 12:02 AM
        0 responses
        4 views
        0 likes
        Last Post funk10101  
        Started by gravdigaz6, Yesterday, 11:40 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by MarianApalaghiei, Yesterday, 10:49 PM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X