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 bmarovets, Today, 06:33 PM
      0 responses
      6 views
      0 likes
      Last Post bmarovets  
      Started by ETFVoyageur, Yesterday, 07:05 PM
      4 responses
      33 views
      0 likes
      Last Post ETFVoyageur  
      Started by JGriff5646, Yesterday, 10:02 PM
      2 responses
      21 views
      0 likes
      Last Post JGriff5646  
      Started by DawnTreader, Today, 05:58 PM
      0 responses
      5 views
      0 likes
      Last Post DawnTreader  
      Started by ntram, Today, 05:39 PM
      0 responses
      5 views
      0 likes
      Last Post ntram
      by ntram
       
      Working...
      X