Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TD Ameritrade Account info not populated?

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

    TD Ameritrade Account info not populated?

    Hi,

    I have added some code to my strategy to print account information. When I connect to IB the code works, but when I connect to TDA it does not. I need it for may strategy to work properly.

    Any Idea how I can get the account info to populate?

    Thanks,
    Erik

    This is the code:

    Code:
    if (State == State.Configure) {
        try {
            Print("Account Info:");
            foreach (Account Acct in Account.All) {
                if (Acct.Name != "TDA ACCT #" && Acct.Name != "IB ACCT #") continue;
                Print("Account: " + Acct.DisplayName.ToString());
                var enumValues = Enum.GetValues((typeof(AccountItem)));
                foreach (AccountItem enumValue in (AccountItem[])enumValues) {
                    var Name = Enum.GetName(typeof(AccountItem), enumValue);
                    var Value = Acct.GetAccountItem(enumValue, Currency.UsDollar).Value;
                    Print(Name + ": " + Value);
                }
            }
    
        }
        catch {}
    }​​
    The TDA Output:

    Account Info:
    Account: TDA ACCT #
    BuyingPower: 0
    CashValue: 0
    Commission: 0
    ExcessIntradayMargin: 0
    ExcessInitialMargin: 0
    ExcessMaintenanceMargin: 0
    ExcessPositionMargin: 0
    Fee: 0
    GrossRealizedProfitLoss: 0
    InitialMargin: 0
    IntradayMargin: 0
    LongOptionValue: 0
    LookAheadMaintenanceMargin: 0
    LongStockValue: 0
    MaintenanceMargin: 0
    NetLiquidation: 0
    NetLiquidationByCurrency: 0
    PositionMargin: 0
    RealizedProfitLoss: 0
    ShortOptionValue: 0
    ShortStockValue: 0
    SodCashValue: 0
    SodLiquidatingValue: 0
    UnrealizedProfitLoss: 0
    TotalCashBalance: 0


    Enabling NinjaScript strategy 'xxxxxxxxxxx SPY/xxxxxxxxxxxx' : On starting a real-time strategy - StartBehavior=WaitUntilFlat EntryHandling=All entries EntriesPerDirection=1 StopTargetHandling=By strategy position ErrorHandling=Stop strategy, cancel orders, close positions ExitOnSessionClose=True / triggering 30 seconds before close SetOrderQuantityBy=Strategy ConnectionLossHandling=Recalculate DisconnectDelaySeconds=10 CancelEntriesOnStrategyDisable=False CancelExitsOnStrategyDisable=False Calculate=On bar close IsUnmanaged=False MaxRestarts=4 in 5 minutes

    #2
    Hello ErikHR1969,

    Each data provider offers different account values, TDA offers very few account values compared to other brokers. You can find a list of the values that each broker offers here: https://ninjatrader.com/support/help...counts_tab.htm

    Are you able to see the buying power or cash value showing a value in the control center accounts tab? The NinjaScript output is going to match what you see in the accounts tab for broker provided values.

    Comment


      #3
      Hi Jesse,

      Yes, I can see buying power and cash value.

      Thanks,
      Erik

      Comment


        #4
        Hello ErikHR1969,

        It sounds like its working then, as noted there are not many account values populated with TDA. If you need a reference please see the chart in the help guide for the available values for TDA, unfortunately there is not a way to gather other account values which you may be able to see inside of TDA software.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        119 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        62 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        40 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        44 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        82 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X