Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SystemPerformance

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

    SystemPerformance

    strategy development going well but unsure about final error ...

    Code:
    using NinjaTrader.Cbi;
    
    if(SystemPerformance.AllTrades.Count >= 1) 
    {
    
    }
    Error Code CS0120:

    an object reference is required for the non-static field, method or property 'NinjaTrader.Cbi.SystemPerformance,AllTrades.get'

    any help appreciated.

    #2
    Hello delTik,

    The code you have appears correct.

    I have created a script to test this code and the script is able to compile, run, and print output.
    If you test this script on your end, do you get an error?

    Are you on the latest version of the Beta? (Beta 11)
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      ok thanks. updating now. can I get emails about new releases?

      code compiles in your sample but not in mine, declarations ok, will figure.

      Code:
      		protected override void OnPositionUpdate(Position position, double averagePrice, int quantity, MarketPosition marketPosition)
      		{
      			if (SystemPerformance.AllTrades.Count >= 1)
      				Print(SystemPerformance.AllTrades.Count.ToString());
      		}
      Last edited by delTik; 05-17-2016, 12:16 AM.

      Comment


        #4
        Hello delTik,

        Are you certain that code is what is generating the error?

        What is the error message? May we have a screenshot of the error message with the error column expanded so that we may read the message?

        We do not have a service to email about new releases. I recommend that you bookmark the release notes page to occasionally check the current release number.
        http://ninjatrader.com/support/helpG...ease_notes.htm

        Any mandatory updates for NinjaTrader 7 (and NinjaTrader 8 once there is a final release) are released as an Advisory which appears as a popup in NinjaTrader and also on our Advisory page.
        http://ninjatrader.com/Advisory
        Last edited by NinjaTrader_ChelseaB; 05-17-2016, 08:13 AM.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        670 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X