In the HelpGuides,
Navigation: NinjaScript > Language Reference > Add On > Account
URL: " https://ninjatrader.com/support/help...ount_class.htm "
Thar be an example at the bottom of ye page,
// Subscribe to static events. Remember to unsubscribe with -= when you are done myAccount.AccountStatusUpdate += OnAccountStatusUpdate;
CS0176:"Member cannot be accessed with an instance reference; qualify it with a type name instead".
In the NinjaScript editor, the Intellisense poppers do not show an event handler for "AccountStatusUpdate" under "myAccount", where myAccount is an instance of Sim101
Therefore, it appears this example is incorrect and needs to be fixed to the correct syntax as shown in helpGuides page
URL " https://ninjatrader.com/support/help...atusupdate.htm "
using the class Account as a type.
// Subscribe to account status updates Account.AccountStatusUpdate += OnAccountStatusUpdate;
// error CS0176 // myAccount.AccountStatusUpdate -= OnAccountStatusUpdate; Account.AccountStatusUpdate -= OnAccountStatusUpdate;
Comment