I am referencing this code https://ninjatrader.com/support/foru...ns#post1090999
In my AddOn there is an AccounSelector UI element that lets me select the account I want, but I would like to generalize the AddOn to monitor all accounts and not just the specific account that has been selected by the selector.
if I use just the SelectedAccount from the AccountSelector the code works as intended.
var myPositions = SystemPerformance.Calculate(accountSelector.SelectedAccount.Executions);
accountSelector.DesiredAccount = "Sim101"; var myPositions = SystemPerformance.Calculate(accountSelector.SelectedAccount.Executions); // Up to this point works accountSelector.DesiredAccount = "****|ExampleLiveAccount"; var myPositions = SystemPerformance.Calculate(accountSelector.SelectedAccount.Executions); // This line will cause a error or crash
Or another option would be a better way to force AccountSelector to change to a new account in code?
Comment