Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

HelpGuides, Account Class, example, AccountStatusUpdate, Error CS0176

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HelpGuides, Account Class, example, AccountStatusUpdate, Error CS0176

    Howdy fellers!

    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,

    Code:
    // Subscribe to static events. Remember to unsubscribe with -= when you are done
    myAccount.AccountStatusUpdate += OnAccountStatusUpdate;
    but I can nots be compilin'
    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.

    Code:
    // Subscribe to account status updates
    Account.AccountStatusUpdate += OnAccountStatusUpdate;
    and don't miss the unsubscribe portion at the bottom of the example also.

    Code:
    // error CS0176
    // myAccount.AccountStatusUpdate -= OnAccountStatusUpdate;
    Account.AccountStatusUpdate -= OnAccountStatusUpdate;
    Happy Trails!

    #2
    Hello balltrader,

    Thank you for your post.

    You're correct there, for that one since it's status updates on all accounts, not just one, you'd want to use Account.AccountStatusUpdate. I've let our team that maintains the help guide know and we'll get that changed.

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      thanks for fixing it

      Comment


        #4
        Hello, Is this issue still not resolved?

        Comment


          #5
          Hello soyjesus,

          Thank you for your reply.

          The help guide page linked above has been corrected.

          Please let us know if we may be of further assistance to you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          647 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          368 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          571 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X