Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

(Calculating...)

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

    (Calculating...)

    In Ninjascript, what can be used to determine when the calculation phase is done and this message in the upper left corner of the chart goes away?

    Click image for larger version

Name:	cal.png
Views:	232
Size:	3.8 KB
ID:	1170708

    #2
    Hello Bidder,

    Thank you for the post.

    There is not a specific way to determine when that is displayed, that is happening based on the script being calculated and is just part of the chart. What is the intended goal surrounding finding out when it has completed?

    I look forward to being of further assistance.

    Comment


      #3
      There is code in a timer which does not operate properly if it runs before the chart is finished loading and calculating. Right now the functionality is on a time hold and will not run for a number of predetermined number of seconds. Having a way to detect when the chart is done calculating would trim off some time from that pre-determined wait time.

      Comment


        #4
        Hello Bidder,

        This sounds like it would be a good use case for the scripts standard OnStateChange override. You could use State.DataLoaded, State.Realtime or State.Historical to complete actions when the script is ready to work. DataLoaded would be the earliest when data is in the series but bars have not started processing. State.Realtime would be the best for doing something once the script is actually running however that would wait for the first tick/bar to close in realtime.

        You could also use OnBarUpdate and just check that the CurrentBar == Count - 2 which would be the last historical bar processed when using OnBarClose processing.

        I look forward to being of further assistance.

        Comment


          #5
          Thanks Jesse, I'll give the bar count a shot.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          24 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          120 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          63 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          41 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          45 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X