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 Skifree, Yesterday, 11:41 PM
      2 responses
      12 views
      1 like
      Last Post eDanny
      by eDanny
       
      Started by TraderCro, 04-12-2024, 11:36 AM
      8 responses
      105 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by synthhokie, Today, 10:24 AM
      3 responses
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by eladlevi, Today, 11:02 AM
      0 responses
      4 views
      0 likes
      Last Post eladlevi  
      Started by Bogdan097, Yesterday, 03:25 PM
      3 responses
      18 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X