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

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.
    Kate W.NinjaTrader Customer Service

    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.
          Kate W.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Market1337, Today, 08:54 AM
          0 responses
          9 views
          0 likes
          Last Post Market1337  
          Started by Bobin, Today, 04:29 AM
          1 response
          11 views
          0 likes
          Last Post bltdavid  
          Started by Lyubomir Kratinov, Today, 06:36 AM
          2 responses
          13 views
          0 likes
          Last Post Lyubomir Kratinov  
          Started by joostb, Today, 12:59 AM
          2 responses
          12 views
          0 likes
          Last Post joostb
          by joostb
           
          Started by Shai Samuel, Today, 02:35 AM
          0 responses
          12 views
          0 likes
          Last Post Shai Samuel  
          Working...
          X