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 sjsj2732, Yesterday, 04:31 AM
        0 responses
        38 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        287 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        289 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        134 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        95 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X