Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AccountName

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

    AccountName

    So, I have the below codes in one of my custom indicators, but it seems that NT8.1.1.3 does not recognize the new nomenclature for AccountName "DEMOxxxxxx", consequently, my custom indicator is not working under NT8.1.1.3. Please, how is AccountName referenced in the new NT8 ?

    lock (Account.All)
    myAccount = Account.All.FirstOrDefault(a => a.Name == AccountName);​


    omololu

    #2
    Hello omololu,

    How are you getting the AccountName input, is that a manually typed in value or are you using an account selector?

    Are you also connected to the connection with that demo account when the code is being run?

    To get a better idea of what's happening it may be helpful to loop over the accounts collection and print out the names of the accounts that are available to check if there is some error with the input property.

    Code:
    foreach(Account acc in Account.All)
    {
        Print(acc.Name);
    }

    Comment


      #3
      Originally posted by omololu View Post
      So, I have the below codes in one of my custom indicators, but it seems that NT8.1.1.3 does not recognize the new nomenclature for AccountName "DEMOxxxxxx", consequently, my custom indicator is not working under NT8.1.1.3. Please, how is AccountName referenced in the new NT8 ?

      lock (Account.All)
      myAccount = Account.All.FirstOrDefault(a => a.Name == AccountName);​
      Nothing has changed.

      In order for your code to work, AccountName must be a string and must be defined
      somewhere else in your code.

      Where is that string defined?
      Is that string a public property?
      What is the value of that string?

      Emily's suggestion to print all Account names is good place to start.

      Is the string value already known? Such as "DEMOxxxxx"?

      You'll want to make sure the "DEMOxxxxx" account is defined in
      your system -- thus Emily's suggestion to print them all.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      72 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      39 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X