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

Detect Chart Interval Change From Add-On

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

    Detect Chart Interval Change From Add-On

    I would like to detect an interval change for a chart from an AddOn. I can almost do it by hooking the toolbar interval selector IntervalChanged event. This works when the interval selector is used to change the interval, but fails when the keyboard is used to change the interval.

    Is there a way to do this today? I was not able to find anything.

    I do this for an instrument change today by hooking the toolbar instrumentSelector StringValueChanged event, which properly raises an event when with the selector or the keyboard are used.

    Can something similar be added to the interval selector? Or can the interval changed event be raised when the interval is changed via the keyboard?

    Thanks for the consideration.

    #2
    Hello aslane,

    This would be undocumented and out of the realm of NinjaTrader Support.

    I'm uncertain that there is an event accessible from an addon that would trigger when a chart's data series changes..
    I'll look around and see if I can find anything helpful.

    This thread will also remain open for any community members that would like to assist.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Its ok if it is not available, then run it by development quick. This is a trivial add for those that understand it. As I mentioned, your custom instrument selector already provides the means, and the custom interval selector provides half of the solution. The interval selector just needs to be extended one of several ways to handle the keyboard update.

      I can make this work, but really wanted to do it correctly vs hacking something in there.

      Comment


        #4
        Hello aslane,

        So far I've been advised that if you use window linking to link your addon window to the chart, you can detect the data series change from the addon if its using an NTTabPage using the setter of the BarsPeriod object.

        Below is a public link to the help guide on Window Linking.
        https://ninjatrader.com/support/help..._interface.htm
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Of course an AddOn may not have a window, but instead monitor windows, in which case you need a way to monitor when the interval changes.

          Comment


            #6
            I know this an old post but to help others, we use code similar to the following:

            Code:
            object item = _chartWindow.FindFirst("instrumentSelector");
            if (item != null)
            {
                _instrumentSelector = item as InstrumentSelector;
                _instrumentSelector.StringValueChanged += InstrumentSelector_StringValueChanged;
                Print("FOUND");
            }
            else
            {
                Print("NOT FOUND");
            }
            Be sure to unhook the event when you're finished with it.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ketostrongdiet, Today, 12:34 AM
            0 responses
            6 views
            0 likes
            Last Post ketostrongdiet  
            Started by ketostrongdiet, Today, 12:33 AM
            0 responses
            7 views
            0 likes
            Last Post ketostrongdiet  
            Started by mattdowns1234, Yesterday, 06:57 PM
            0 responses
            16 views
            0 likes
            Last Post mattdowns1234  
            Started by dgee949, Yesterday, 06:26 PM
            0 responses
            26 views
            0 likes
            Last Post dgee949
            by dgee949
             
            Started by dgee949, Yesterday, 05:58 PM
            0 responses
            32 views
            0 likes
            Last Post dgee949
            by dgee949
             
            Working...
            X