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 srtrader, 02-12-2025, 09:01 PM
      3 responses
      24 views
      0 likes
      Last Post rockmanx00  
      Started by bertochi, 02-14-2025, 05:25 PM
      2 responses
      29 views
      0 likes
      Last Post bertochi  
      Started by sclay115, 02-10-2025, 03:58 PM
      6 responses
      32 views
      0 likes
      Last Post sclay115  
      Started by Babbou72, Yesterday, 08:37 PM
      0 responses
      19 views
      0 likes
      Last Post Babbou72  
      Started by ethanguh, Yesterday, 08:34 PM
      0 responses
      9 views
      0 likes
      Last Post ethanguh  
      Working...
      X