Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simulated Data Feed - CalculateOnBarClose

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

    Simulated Data Feed - CalculateOnBarClose

    Hi:

    When running the simulated data feed with CalculateOnBarClose = false, my OnBarUpdate callback is only being called for historical data.

    I understand that I'll only get single events for historical data, but I don't get tick by tick events for current bar.

    I this a known issue with the simulator? I must be missing something.

    Thx

    #2
    Errr... It seems to be working now...

    There an issue in here somewhere... If I can pin it down to an NT bug, I'll let you know...

    So, nevermind...

    Thanks,

    Comment


      #3
      Ok,

      BarsRequired apparently defaults to some value like 10 or 20...

      OnBarUpdate won't be called until that many bars has been 'simulated'.

      Setting it to 0... didn't seem to work... locked NT up hard when adding the indicator to a chart.

      I guess the best I can do is set it to 1? How do I get OnBarUpdate called for the 1st bar?

      Comment


        #4
        Correct, BarsRequired defaults to 20. All it would have to satisfied for all series you potentially call in your script.

        This can be programmatically as well in the script's Initialize() :

        Comment


          #5
          Originally posted by BigWaveDave View Post
          Ok,

          BarsRequired apparently defaults to some value like 10 or 20...

          OnBarUpdate won't be called until that many bars has been 'simulated'.

          Setting it to 0... didn't seem to work... locked NT up hard when adding the indicator to a chart.

          I guess the best I can do is set it to 1? How do I get OnBarUpdate called for the 1st bar?
          It is possible to set BarsRequired to 0. BarsRequired suppresses the plot during the initial phase, but has no further impact on the execution of OnBarUpdate() unless you use it in the code. A typical example would be

          Code:
          if(CurrentBar < BarsRequired)
              return;
          In that case OnBarUpdate() will only be executed after BarsRequired is exceeded.

          If NT locks up hard, you will need to examine your code, you should find the reason there.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          571 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          330 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          548 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          548 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X