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

Event when chart instrument changes

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

    Event when chart instrument changes

    Hey there,

    Is there an event that I can hook into to tell me when the instrument or the timeframe has changed on that chart?

    thanks,

    Kevin.

    #2
    Hello Kevin,

    I am not aware of an event such as this that would trigger when the instrument has changed.
    You may try tracking the instrument using a static variable.

    I am happy to submit a feature request on your behalf to add this functionality. Please let me know if you would like to submit this as a feature request.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hey Chelsea!! Thanks for the quick response... I am in such a hurry at the moment. geee this puts me in a pickle because my addon kinda needs to know what Instrument its working with. I guess I will just need to do a loop inside an async task and keep checking it to see if it has changed since the window was first loaded.

      What about the instrument and timeframe selectors at the top of the chart... they must have a change event that I can work with? I'm not sure how to hook into them though... and of course it wouldn't work with the DataSeries windows, but I could live with it. Any ideas?

      Comment


        #4
        Hello Kevin,

        Changing the instrument on a chart will reload all indicators as well. If you use an indicator on each chart that updates a static variable when State is State.DataLoaded you may be able to use this to only update when there has been a change.

        Or you could loop with timer.

        I am not aware of any way to add events to the controls on a chart and if these exist these will not be documented in the help guide.
        This thread will remain open for any community members that would like to assist.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Chelsea, got this working great using an indicator!! Thanks for the tip!!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by bortz, 11-06-2023, 08:04 AM
          47 responses
          1,607 views
          0 likes
          Last Post aligator  
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          9 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          19 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          6 views
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          16 views
          0 likes
          Last Post Javierw.ok  
          Working...
          X