Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
      https://ninjatrader.com/support/foru...ples#post93881
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by AlexEro, Today, 12:29 AM
      0 responses
      3 views
      0 likes
      Last Post AlexEro
      by AlexEro
       
      Started by Vincere, 01-20-2019, 08:42 AM
      13 responses
      330 views
      0 likes
      Last Post AlexEro
      by AlexEro
       
      Started by bltdavid, 12-01-2022, 07:59 PM
      10 responses
      37 views
      0 likes
      Last Post jeronymite  
      Started by StealthM93, Yesterday, 11:09 PM
      0 responses
      1 view
      0 likes
      Last Post StealthM93  
      Started by digibob, 11-22-2020, 10:59 PM
      3 responses
      110 views
      0 likes
      Last Post FutureDragon  
      Working...
      X