Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Changing Trading Hours or showing Data series box

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

    Changing Trading Hours or showing Data series box

    I've been trying to figure out how to change the trading hours by button-click. I've tried lots of different non-documented stuff using reflection to call private methods/properties. Nothing works. Any hints/tips on what I need to do to achieve this? I don't need programming support, just to be pointed in the right direction.

    Failing that, is there any way to show the Data Series box from code? I can make it immediately hide itself, then set the Trading hours and push OK from code.

    Any help on this would be appreciated. Switching ETH/RTH is a pain in Ninjatrader. Its a shame its not built-in. I don't think it would be difficult to add as a feature to Ninjatrader.

    "If the selected trading hours template on the chart ends in ETH or RTH show a button on the toolbar that flips it to the other one"

    #2
    Hello frantic,

    Welcome to the forums!

    To point you in the right direction, you might be able to find a solution by invoking the Data Series window button and manipulating the Trading Hours combo box via Automation ID.

    Keep in mind that modifying/invoking NinjaTrader controls and using C# code that is outside of what we have documented escapes what we can provide support for. There may be an internal change that breaks those types of modifications/invocations.

    I've included a demonstration showing how Inspect can be used to fetch Automation ID's.

    Demo: https://www.screencast.com/t/g7nnyFUYu

    With the attained Automation ID, we can invoke these items from code.

    As a rough example for invoking NTMenuItems:
    Code:
    if(ChartControl == null)
    	return;
    Chart ChartWindow =  ChartControl.OwnerChart;
    ChartControl.Dispatcher.InvokeAsync(()=>
    {
    	NTMenuItem element = ChartWindow.FindFirst("AutomationID") as NTMenuItem;
    	
    	if(element == null) return;
    	
    	element.Command.Execute(null);
    });
    You can get the Windows SDK here: https://developer.microsoft.com/en-u...indows-8-1-sdk

    Further information on Inspect can be found here: https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx

    I've submitted a feature request for you so we can track interest to implement a button that can switch the data series Trading Hours template between ETH and RTH. The ticket ID tracking this request is SFT-3117.

    Feature requests are fulfilled based on the development team's priorities and we cannot offer an ETA or promise of fulfillment. Upon implementation, the ticket ID's can be seen in the Release Notes page of the help guide.

    Release Notes: https://ninjatrader.com/support/help...ease_notes.htm

    Please let me know if there is anything else I could do to help.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hey frantic, let me know if you figure it out. I've been trying to do the same thing. I wanted a button or hotkey to switch between ETH/RTH either on a per-tab basis or on the entire window.

      Comment


        #4
        Thanks for the info. That's really helpful; I didn't think to invoke the menu. I will have a go at it this weekend.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by frslvr, Today, 05:42 PM
        0 responses
        2 views
        0 likes
        Last Post frslvr
        by frslvr
         
        Started by frslvr, Today, 04:29 PM
        0 responses
        12 views
        0 likes
        Last Post frslvr
        by frslvr
         
        Started by wjadevries, Today, 04:18 PM
        0 responses
        5 views
        0 likes
        Last Post wjadevries  
        Started by shahabjet1, Today, 03:47 PM
        2 responses
        17 views
        0 likes
        Last Post shahabjet1  
        Started by JTizz, Today, 03:21 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X