• 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 jtrading82, 10-11-2019, 05:07 PM
      8 responses
      76 views
      1 like
      Last Post sledge
      by sledge
       
      Started by MARTIN MARTIN, Yesterday, 01:01 PM
      3 responses
      40 views
      0 likes
      Last Post MARTIN MARTIN  
      Started by NickyD, Today, 11:42 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Jim  
      Started by cupir2, Today, 11:25 AM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by 7robert, Today, 11:15 AM
      2 responses
      7 views
      0 likes
      Last Post 7robert
      by 7robert
       
      Working...
      X