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 andrewtrades, Today, 04:57 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by chbruno, Today, 04:10 PM
          0 responses
          5 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          436 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          7 views
          0 likes
          Last Post FAQtrader  
          Started by rocketman7, Today, 09:41 AM
          5 responses
          19 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X