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

NinjaTrader - Event: Charts and Indicators in a workspace have been fully loaded

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

    NinjaTrader - Event: Charts and Indicators in a workspace have been fully loaded

    Hello there,

    I am currently working on a project. For it to work we need to be able to identify from an AddOn when all charts in a workspace and their indicators have been fully loaded (e.g. historical data has been loaded and indicators have stopped calculating). I could not find an existing event for this.

    Another alternative I tried is to check with an AddOn windows that are created in OnWindowCreated. By using the Window.ContentRendered Event I am able to identify when the window is being shown but there are no indicators in the ChartControl at this point. I could keep track of the windows and periodically check if Indicators have been loaded, but there might be a chart window without indicators.

    So my questions are:
    Is there already an Event which would tell me if the Charts and its Indicators are done loading? If not, does anyone have a better suggestion on how to identify if the chart is fully loaded?

    Any help will be greatly appreciated. Thank you in advance.

    #2
    Hello Devside_Victor, thanks for writing in.

    There's no documented event that will tell an addon when the charts are done loading. One way of doing it would be to loop through the Indicators on the chart to see if they are in State.RealTime. We have an example addon that loops through all charts and gets each indicator on each chart:

    https://ninjatrader.com/support/foru...tor#post717883

    This example demonstrates how to get the charts and their indicators, and those indicator's properties.

    Please let me know if you have any questions about this material.

    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Good reading here.

      Comment


        #4
        This is a solution I have contemplated doing, but one issue to be careful of is the multi-threaded access. Unless the State property is a thread safe property, accessing it from multiple threads could be problematic. One would need to use the dispatcher of the indicator to retrieve the result and figure out how to return it in a thread safe manner.

        Comment


          #5
          Hello all,

          Thank you all very much for your help. I will take a closer look at your suggestions and probably come back to you with further questions

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by f.saeidi, Today, 11:02 AM
          1 response
          2 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by geotrades1, Today, 10:02 AM
          4 responses
          12 views
          0 likes
          Last Post geotrades1  
          Started by rajendrasubedi2023, Today, 09:50 AM
          3 responses
          16 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by lorem, Today, 09:18 AM
          2 responses
          11 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by geddyisodin, Today, 05:20 AM
          4 responses
          30 views
          0 likes
          Last Post geddyisodin  
          Working...
          X