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:
    // http://ninjatrader.com/support/helpGuides/nt8/en-us/?intervalselector.htm
     LogicalTreeHelper.FindLogicalNode(pageContent, "intervalSelector")
    may have children or editable properties.

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

    http://ninjatrader.com/support/helpG...don_window.htm

    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.

        http://ninjatrader.com/support/helpG...tervalselector
        Jessica P.NinjaTrader Customer Service

        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
        5 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