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 bmartz, 03-12-2024, 06:12 AM
          4 responses
          32 views
          0 likes
          Last Post bmartz
          by bmartz
           
          Started by Aviram Y, Today, 05:29 AM
          4 responses
          12 views
          0 likes
          Last Post Aviram Y  
          Started by algospoke, 04-17-2024, 06:40 PM
          3 responses
          28 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by gentlebenthebear, Today, 01:30 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by cls71, Today, 04:45 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X