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 rocketman7, Today, 02:12 AM
          5 responses
          23 views
          0 likes
          Last Post rocketman7  
          Started by trilliantrader, 04-18-2024, 08:16 AM
          7 responses
          28 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by samish18, 04-17-2024, 08:57 AM
          17 responses
          66 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by briansaul, Today, 05:31 AM
          1 response
          15 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by PaulMohn, Today, 03:49 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X