Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Possible Bug in AccountSelector.DesiredAccount?

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

    Possible Bug in AccountSelector.DesiredAccount?


    Hello!

    I think I found a rare/broker-specific bug when it somes to programmatically setting the AccountSelector with the DesiredAccount property.

    I'm using the NT Continuum connection for connection to Oanda. In the Control Center, my account name appears as
    [UserId]!Oanda![MyAcctNbr].

    When I get the account name using selector.SelectedAccount.Name it only returns the account number portion. And when I try to put this back into the selector.DesiredAccount property, it can't find it.

    It works fine with temp accounts. Also, if I hard code the value passed into DesiredAccount, it works fine.

    Code:
    // WORKS:
    selector.DesiredAccount = "Sim101";
    
    
    // WORKS:
    selector.DesiredAccount = "[UserId]!Oanda![MyAcctNbr]";
    
    
    // DOES NOT WORK:
    string accountName = selector.SelectedAccount.Name;
    selector.DesiredAccount = accountName;
    
    // accountName="[MyAcctNbr]";
    Am I missing something simple? Thoughts?

    #2
    Hello, thanks for your post.

    The example Addon on this page works fine with our Oanda test account, please try implementing like this. I also attached the example addon, the account selector is on line 317.

    Attached Files
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      That solved my issue. Thanks!


      I had to set my variable FROM the "DesiredAccount" property.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Belfortbucks, Today, 09:29 PM
      0 responses
      6 views
      0 likes
      Last Post Belfortbucks  
      Started by zstheorist, Today, 07:52 PM
      0 responses
      7 views
      0 likes
      Last Post zstheorist  
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      151 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      6 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Working...
      X