Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issues following the script example for SystemPerformance

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

    Issues following the script example for SystemPerformance

    Hi guys, I'm pretty new to developing and am having trouble using the example from:


    For example, I am trying to practice developing by creating a basic indicator that displays my daily and weekly PNL on the chart. But, whenever I use:

    protected override void OnBarUpdate()
    {
    // Check if it's a new day
    if (Time[0].Date > lastDailyReset)
    {
    dailyProfitLoss = SystemPerformance.AllTrades.TradesPerformace.Gross Profit;
    dailyPNL = dailyProfitLoss; //Set daily PNL for the new day
    lastDailyReset = Time[0].Date;
    }
    }

    I end up getting CS0120 error. Am I supposed to create a reference to SystemPerformace?
    I'm really confused so if anyone could help I would greatly appreciate it. ​

    #2
    Hello drewclass34,

    The sample you are viewing is a strategy sample, that code can only be used in a strategy.

    Indicators don't have any associated account or know about trades or account values by default. You can use the addon framework to monitor live account values from an indicator but it would not be the same as the strategies performance values which represent the isolated trades of that individual strategy.

    To use the system performance values you would need to develop a strategy that places trades so it can populate its performance and then use that code in that strategy.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    557 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X