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 cmoran13, Yesterday, 01:02 PM
        0 responses
        29 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        21 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        160 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        95 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        148 views
        2 likes
        Last Post CaptainJack  
        Working...
        X