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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      157 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      91 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      143 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      130 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X