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 GussJ, 03-04-2020, 03:11 PM
          16 responses
          3,280 views
          0 likes
          Last Post Leafcutter  
          Started by WHICKED, Today, 12:45 PM
          2 responses
          19 views
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Started by Tim-c, Today, 02:10 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Taddypole, Today, 02:47 PM
          0 responses
          5 views
          0 likes
          Last Post Taddypole  
          Started by chbruno, 04-24-2024, 04:10 PM
          4 responses
          52 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Working...
          X