Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart Trader Quantity

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

    Chart Trader Quantity

    Is there a simple way to get the value that the user has currently entered in the Chart Trader Quantity field?

    I found some old posts but could not get it to work.

    I just want to be able to have that number passed to a variable that I can use.

    #2
    Hello several,

    Thank you for your post.

    You would need to use a dispatcher to get the quantity.

    Below are some relevant forum posts:



    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      Hello, thanks. This worked.I did find that when enabling the indicator it caused NT to freeze for 4 seconds or so, disabling it being run on hostorical data fixed that.

      I'm not sure the best place to put the code though. If I want to monitor changes to the quantity field and also grab the initial quantity. If I put it in state configure I get an error when loading the indicator..

      Code:
      protected override void OnBarUpdate()
              {
                  //Add your custom indicator logic here.
                  if (State == State.Historical)
                      return;
              
                  ChartControl.Dispatcher.InvokeAsync((Action)(() => {
                      NinjaTrader.Gui.Tools.QuantityUpDown quantitySelector = (Window.GetWindow(ChartControl.Parent).FindFirst("ChartTraderControlQuantitySelector") as NinjaTrader.Gui.Tools.QuantityUpDown);
                      MyVar = quantitySelector.Value;
                  }));
                  
                  Print(Convert.ToString(MyVar));
              }​
      Last edited by several; 01-17-2025, 06:17 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by DayTradingDEMON, Yesterday, 02:10 PM
      6 responses
      39 views
      0 likes
      Last Post rockmanx00  
      Started by Pointtoni, Yesterday, 11:41 PM
      3 responses
      35 views
      0 likes
      Last Post jenacie.com  
      Started by Nate G, 03-17-2025, 02:53 PM
      4 responses
      73 views
      1 like
      Last Post timko
      by timko
       
      Started by several, 03-18-2025, 03:53 AM
      11 responses
      184 views
      1 like
      Last Post timko
      by timko
       
      Started by Amelie4262, Today, 10:45 AM
      0 responses
      15 views
      0 likes
      Last Post Amelie4262  
      Working...
      X