Announcement

Collapse
No announcement yet.

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 mmenigma, 01-23-2024, 09:37 AM
        1 response
        85 views
        0 likes
        Last Post Nin8aTrender  
        Started by wbayne333, 02-22-2021, 01:18 PM
        6 responses
        408 views
        0 likes
        Last Post Nin8aTrender  
        Started by gtheaded, 07-03-2020, 03:47 PM
        3 responses
        367 views
        0 likes
        Last Post Nin8aTrender  
        Started by theminster, Today, 03:12 PM
        0 responses
        10 views
        0 likes
        Last Post theminster  
        Started by AyeSir, Today, 03:01 PM
        0 responses
        11 views
        0 likes
        Last Post AyeSir
        by AyeSir
         
        Working...
        X