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 cmoran13, Yesterday, 01:02 PM
                  0 responses
                  25 views
                  0 likes
                  Last Post cmoran13  
                  Started by PaulMohn, 04-10-2026, 11:11 AM
                  0 responses
                  17 views
                  0 likes
                  Last Post PaulMohn  
                  Started by CarlTrading, 03-31-2026, 09:41 PM
                  1 response
                  160 views
                  1 like
                  Last Post NinjaTrader_ChelseaB  
                  Started by CarlTrading, 04-01-2026, 02:41 AM
                  0 responses
                  95 views
                  1 like
                  Last Post CarlTrading  
                  Started by CaptainJack, 03-31-2026, 11:44 PM
                  0 responses
                  148 views
                  2 likes
                  Last Post CaptainJack  
                  Working...
                  X