Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Equity curve for strategy

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

    Equity curve for strategy

    Hello,
    I would like to monitor the equity curve of a running strategy and compare it to its moving average. Can do that with creating a new DataSeries like follows?

    #region Variables
    private DataSeries equityCurve;
    #endregion

    protected override void Initialize()
    {
    equityCurve= new DataSeries(this);
    }

    protected override void OnBarUpdate()
    {
    equityCurve.Set(Performance.AllTrades.TradesPerformance.Points.Cum Profit);

    if (equityCurve[1] > SMA(equityCurve,10)[1])
    Print("Do something");
    }

    Would this work?


    Thank you
    LazKz

    #2
    Hi LazKz, unfortunately not - you would need to program this yourself. For plotting from the strategy you can check this reference sample - http://www.ninjatrader-support2.com/...ead.php?t=6651

    To access the unrealized PnL you can work with GetProfitLoss() - http://www.ninjatrader-support.com/H...rofitLoss.html

    Comment


      #3
      Thanks Bertrand,
      I'm afraid you've misunderstood me. My goal is not to create an indicator plot but to access the performance graph values while a strategy is running (live or backtesting). So instead of the unrealized profit Position.GetProfitLoss() I would like to reference the accumulated realized profit and it's value [n] bars ago. The purpose is to see the momentum of the strategy's performance while it is still running. I'm not sure if that is possible.

      Thanks
      LazKz

      Comment


        #4
        Thanks for clarifying, you could work with the Performance class for this then, this reference sample may help you - http://www.ninjatrader-support2.com/...ead.php?t=4084

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X