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

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 traderqz, Today, 12:06 AM
        2 responses
        4 views
        0 likes
        Last Post traderqz  
        Started by RideMe, 04-07-2024, 04:54 PM
        5 responses
        28 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by f.saeidi, Today, 08:13 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by DavidHP, Today, 07:56 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by kujista, Today, 06:23 AM
        3 responses
        11 views
        0 likes
        Last Post kujista
        by kujista
         
        Working...
        X