Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get PnL for the session?

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

    How to get PnL for the session?

    Hello,

    The instrument is futures. How can I get PnL for the session? I know there is a method for all trades in all sessions, that's not what I need.

    The reason is I want to have a Day Profit Target and Day Stop Loss.

    Many Thanks, Caesar.

    #2
    NinjaTrader does not provide session PNL, it only provides the accumulated PNL which by default includes the PNL of historical (virtual) trades not actually made by your strategy.

    See this link on the system PNL: https://ninjatrader.com/support/help...?cumprofit.htm

    For session PNL what you would need to do is to create a double type variable and then store the system PNL at the beginning of the session. At the end of the session you would take the update (through the session) system PNL minus the value of the stored variable as this then would be the session PNL. You can also check the session PNL at any time in the session by the same process.



    Comment


      #3
      Hello Skechers,

      This can be tracked using logic in the code.

      Below is a link to an example of a daily loss limit which tracks the session PnL and stops trading after a specified amount of loss.
      Hello, I've updated the DailyLossLimit and DailyLosLimitMultiTrade examples that were posted on the forum for NinjaTrader 7 for NinjaTrader 8. These are often requested and I felt they are good examples to have for NT8. DailyLossLimitExample_NT7 - http://ninjatrader.com/support/forum...241#post451241 (http://ninjatrader
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Ymcapital, 08-16-2023, 04:39 PM
      3 responses
      77 views
      0 likes
      Last Post xiinteractive  
      Started by e5656, Today, 01:00 PM
      2 responses
      34 views
      0 likes
      Last Post e5656
      by e5656
       
      Started by sarderiftekhar, Today, 04:11 AM
      2 responses
      14 views
      0 likes
      Last Post sarderiftekhar  
      Started by srhserio33, Today, 04:24 PM
      0 responses
      4 views
      0 likes
      Last Post srhserio33  
      Started by NISNOS69, 10-03-2024, 05:38 AM
      23 responses
      77 views
      0 likes
      Last Post NISNOS69  
      Working...
      X