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 Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  567 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  330 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
                  548 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  548 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X