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:



    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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      556 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X