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

Customize IntervalSelector dropdown items

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

    Customize IntervalSelector dropdown items

    Hello,
    I'm adding IntervalSelector to chart's menu from indicator. Is there any way to customize the dropdown items? For instance remove Range or Tick intervals.
    Last edited by serialbug; 09-28-2016, 04:08 AM.

    #2
    Hello serialbug, and thank you for your question.

    The following answer will apply to NinjaTrader 8.

    The functionality we have documented for IntervalSelector guides you through linking to the selector and hooking events to it. As of yet we do not have more granular support for modifying the IntervalSelector programmatically.

    If you would like to investigate on your own, the object returned by


    Code:
    [FONT=Courier New]// http://ninjatrader.com/support/helpGuides/nt8/en-us/?intervalselector.htm[/FONT]
    [FONT=Courier New] LogicalTreeHelper.FindLogicalNode(pageContent, "intervalSelector")[/FONT]
    may have children or editable properties.

    The instructions for creating entirely new add-on windows and tabs found here will be invaluable.



    I recommend using those instructions to create an entirely new tab, then finding out how to populate the new tab with the existing intervals. I believe doing so will make you familiar with the XAML and all of the exposed capabilities.

    We are happy to help with any questions that come up along the way. If you discover any ways to modify the existing interval selector using the document model object the above code exposes, I would like to encourage you to share it with other users here on the forums.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Thanks NinjaTrader_JessicaP,
      I used the link you provide to build new empty addon window, it works fine, but when I add IntervalSelector to my xaml layout I got the the exception XamlParseException: Cannot find resource named 'BackgroundTextInput'
      My page content:
      Code:
      <t:NTTabPage  x:Class="WpfControlLibrary2.sbMyAddOnPage"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
            xmlns:t="clr-namespace:NinjaTrader.Gui.Tools;assembly=NinjaTrader.Gui"
            mc:Ignorable="d" 
            d:DesignHeight="300" d:DesignWidth="300">
      
          <DockPanel>
              <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal">
                <t:IntervalSelector		x:Name="intervalSelector" IntervalChanged="OnIntervalChanged">
                      <t:IntervalSelector.Margin>
                          <Thickness Left="{StaticResource MarginBase}" Top="{StaticResource PaddingColumn}" Bottom="0"/>
                      </t:IntervalSelector.Margin>
                  </t:IntervalSelector>
              </StackPanel>
      
          </DockPanel>
      </t:NTTabPage>
      Any suggestions? Thanks!
      Last edited by serialbug; 10-03-2016, 07:59 AM.

      Comment


        #4
        While it does look like the BackgroundTextInput symbol is indeed defined in the NinjaTrader.Gui.dll assembly, it looks like there is some added prep work that needs to be done through the NinjaScript C# code for IntervalSelector to work. It is very likely that there are some object references that must be created in memory before you will be able to use an IntervalSelector.

        I am including a help guide documentation which contains both a C# and XAML code sample for IntervalSelector. Please ensure that, prior to calling IntervalSelector through either C# or XAML, that you fully understand and include every preparation step that is taken through the documented sample code.

        Jessica P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by The_Sec, Yesterday, 03:37 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by vecnopus, Today, 06:15 AM
        0 responses
        1 view
        0 likes
        Last Post vecnopus  
        Started by Aviram Y, Today, 05:29 AM
        0 responses
        5 views
        0 likes
        Last Post Aviram Y  
        Started by quantismo, 04-17-2024, 05:13 PM
        3 responses
        27 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by ScottWalsh, 04-16-2024, 04:29 PM
        7 responses
        36 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X