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 funk10101, Today, 09:43 PM
        0 responses
        6 views
        0 likes
        Last Post funk10101  
        Started by pkefal, 04-11-2024, 07:39 AM
        11 responses
        37 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Yesterday, 08:51 AM
        8 responses
        44 views
        0 likes
        Last Post bill2023  
        Started by yertle, Today, 08:38 AM
        6 responses
        26 views
        0 likes
        Last Post ryjoga
        by ryjoga
         
        Started by algospoke, Yesterday, 06:40 PM
        2 responses
        24 views
        0 likes
        Last Post algospoke  
        Working...
        X