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 SharkTankValue, Today, 03:19 AM
          0 responses
          2 views
          0 likes
          Last Post SharkTankValue  
          Started by Sheridan, Yesterday, 11:06 AM
          1 response
          26 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by JasmneGardne, Today, 01:07 AM
          0 responses
          22 views
          0 likes
          Last Post JasmneGardne  
          Started by ttodua, 01-28-2018, 04:24 PM
          6 responses
          975 views
          0 likes
          Last Post Heart
          by Heart
           
          Started by jeronymite, Yesterday, 10:22 PM
          0 responses
          31 views
          0 likes
          Last Post jeronymite  
          Working...
          X