Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Re defining CumProfit

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

    Re defining CumProfit

    The issue I am having is that for strategies that hold positions for some time their "P&L" is only "realized" when they are disposed of.

    I would like to have a Mark to Market P&L i.e unrealized+realized P&L.

    Also I would like to be able to use the chart in Strategy Analyzer that plots CumProfit.

    I am wondering if there is somewhere I can modify the CumProfit value to add GetProfitLoss() to it so that for multi day strategies I can have a mark to mark to market P&L.

    Is it possible to modify the TradesPerformanceValues somewhere in a similar fashion to being able to modify optimization type?

    Is this possible?

    #2
    Hello ag987654321,

    Sure, you can work with existing properties and create your own value.

    I would like to have a Mark to Market P&L i.e unrealized+realized P&L.
    Add them together with something like:
    Code:
    double myDouble = Performance.RealtimeTrades.TradesPerformance.Currency.CumProfit + Position.GetProfitLoss(Close[0], PerformanceUnit.Currency);
    Last edited by NinjaTrader_RyanM1; 03-15-2011, 03:31 PM.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick reply Ryan-

      Is it possible to have this value show up in the drop down menu in the Graphs tab in the strategy Analyzer by making this a global definition or variable?

      I would really like to re-define the current definition of Cumulative Profit in NT and use it throughout the program.

      In addition I would like to use this in the back testing if at all possible.

      Comment


        #4
        Unfortunately you cannot change the built in definitions for these. The strategy analyzer is a backtesting tool and will not show details for open trades (unrealized PnL). If there are any open trades they are closed when the backtesting run is completed.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Ag,

          Ryan is right, you can meet some of your requirements via the Positions collection. See this thread for reference: http://www.ninjatrader.com/support/f...ad.php?t=39240

          Cheers,

          drolles

          Comment


            #6
            Drolles,

            Thanks for the reference. Not sure it really helps me though since i need the feature exclusively in back testing. In real time i just create a series for the information that I need- adds overhead but simplifies things enormously

            Comment


              #7
              Ag,

              I might have misunderstood your requirements. The Positions collection works in backtesting as well.

              I agree with you it can’t be reported on (without exporting it to a txt file). It can be used within a strategy.

              Kind regards,

              Dan

              Comment


                #8
                I posted a similar question before stumbling upon this thread. I've found NinjaTrader to be very flexible, but it would be a drawback if mark-to-market P&L (or its derivatives such as Sharpe Ratio) can not be reported in a back-test and used as an optimization criterion. The backtest performance measures are based on monthly realized P&L, and I find them to be of limited use to gauge the daily mark-to-market risk of a strategy. Really hope there is a way to get around it...

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NRITV, Today, 01:15 PM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by maybeimnotrader, Yesterday, 05:46 PM
                5 responses
                24 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by quantismo, Yesterday, 05:13 PM
                2 responses
                16 views
                0 likes
                Last Post quantismo  
                Started by frankthearm, Today, 09:08 AM
                7 responses
                27 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by adeelshahzad, Today, 03:54 AM
                5 responses
                33 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Working...
                X