• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 JohnS52, Today, 09:49 AM
      0 responses
      2 views
      0 likes
      Last Post JohnS52
      by JohnS52
       
      Started by billythekid72, Today, 09:47 AM
      0 responses
      2 views
      0 likes
      Last Post billythekid72  
      Started by DTSSTS, Today, 08:29 AM
      2 responses
      11 views
      0 likes
      Last Post DTSSTS
      by DTSSTS
       
      Started by mtamaku, Today, 08:39 AM
      3 responses
      7 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Douglee, Today, 08:11 AM
      2 responses
      7 views
      0 likes
      Last Post Douglee
      by Douglee
       
      Working...
      X