Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Checking for Correct Account and ATM in Chart trader

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

    Checking for Correct Account and ATM in Chart trader

    I'd like to use Chart Trader hidden so it takes up less room on my chart.

    But I also want to make sure that the right Account and ATM are chosen.

    I Render a message at the bottom of the chart if either the Account or ATM are not the ones that I want to use. The code I'm using below is working, but I cobbled it together from a few other posts I found.

    Is there anything I should change to make it more efficient/correct?

    HTML Code:
    //=====    GET CHART TRADER INFO        
                activeAtm = "NO ATM SELECTED";
                if (ChartControl.Properties.ChartTraderVisibility != ChartTraderVisibility.Collapsed)
                    ChartControl.Dispatcher.InvokeAsync((Action)(() =>
                    {
                        xAlselector = Window.GetWindow(ChartControl.Parent).FindFirst("ChartTraderControlAccountSelector") as NinjaTrader.Gui.Tools.AccountSelector;
                        activeAccount = xAlselector.SelectedAccount.ToString();
    
                        if (ChartControl.OwnerChart.ChartTrader.AtmStrategy.Template != null)
                            activeAtm = ChartControl.OwnerChart.ChartTrader.AtmStrategy.Template.ToString();
                    }));
                    chartTraderStatus = ChartControl.Properties.ChartTraderVisibility;
                    }
    ​

    #2
    Hello cre8able,

    Thank you for your post.

    I don't have any suggestions to "improve" the code provided - there is no portion I would say is unnecessary / inefficient. If it is working as intended, I would consider this code correct.

    Please let us know if you have any further questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    599 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    344 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    558 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    557 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X