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:	180
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.
    JesseNinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        Comment


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

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by traderqz, Today, 12:06 AM
          2 responses
          3 views
          0 likes
          Last Post traderqz  
          Started by RideMe, 04-07-2024, 04:54 PM
          5 responses
          28 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by f.saeidi, Today, 08:13 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by DavidHP, Today, 07:56 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by kujista, Today, 06:23 AM
          3 responses
          11 views
          0 likes
          Last Post kujista
          by kujista
           
          Working...
          X