Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need to synchronize ChartTrader Account to OnOrderUpdate account in Indicator

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

    Need to synchronize ChartTrader Account to OnOrderUpdate account in Indicator

    it seems when the account changes on ChartTrader, I need to reset the subscription of OnMarketData to the new Account​?

    Are there any examples of how to know when the account changes on ChartTrader and to know what it is?

    (then it would be simply to unsubscribe OnMarketDate form the old account and assign it to the new??)

    #2
    Looks like this is the answer

    accountSelector.SelectionChanged

    ??


    Comment


      #3
      is that triggered on startup/load?

      Comment


        #4
        I'm getting a compile error ("pageContent" does not exist in the current context....

        AccountSelector accountSelector = LogicalTreeHelper.FindLogicalNode(pageContent, "accountSelector");

        Comment


          #5
          looks like I need to XAML code?

          never done that before (converting from NT7)

          where does the XAML code go???

          Comment


            #6
            sorry for all the questions...the example in the documentation is for an AddOn.....where should I put the code in an Indicator...??

            somewhere in OnStateChange?

            is there an example code (would be the easiest) I can read?

            Comment


              #7
              Ok, I"m driving you all crazy...but it seems the documentation should be updated to include what is in this indicator

              ChartTraderUIElementsFromAutomationIDsIndicatorExa mple

              nothing in the doc I could find

              seems to be what I was looking for....

              Comment


                #8
                Hi, thanks for posting. This is not documented code, so I will be limited in creating new examples, but this is how you attach the Chart Trader control without the XAML:
                Code:
                else if (State == State.Configure)
                {
                 if(ChartControl != null)
                 {
                 ChartControl.Dispatcher.InvokeAsync((Action)(() =>
                 {
                  accSelector = (Window.GetWindow(ChartControl.Parent).FindFirst(" ChartTraderControlAccountSelector") as NinjaTrader.Gui.Tools.AccountSelector);
                  if(accSelector != null)
                  Print(accSelector.SelectedAccount.Name);
                 }));
                }
                }

                Comment


                  #9
                  Thanks Chris

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by SalmaTrader, 07-07-2026, 10:26 PM
                  0 responses
                  30 views
                  0 likes
                  Last Post SalmaTrader  
                  Started by CarlTrading, 07-05-2026, 01:16 PM
                  0 responses
                  17 views
                  0 likes
                  Last Post CarlTrading  
                  Started by CaptainJack, 06-17-2026, 10:32 AM
                  0 responses
                  9 views
                  0 likes
                  Last Post CaptainJack  
                  Started by kinfxhk, 06-17-2026, 04:15 AM
                  0 responses
                  16 views
                  0 likes
                  Last Post kinfxhk
                  by kinfxhk
                   
                  Started by kinfxhk, 06-17-2026, 04:06 AM
                  0 responses
                  19 views
                  0 likes
                  Last Post kinfxhk
                  by kinfxhk
                   
                  Working...
                  X