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 know the positions PnL realized and unrealized?

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

    How to know the positions PnL realized and unrealized?

    Hi,

    I'm looking for a way to know the total PnL for the realized and unrealized during the trading day.
    I want to use it in backtest and when running live.
    I'm currently using:
    Code:
    Performance.AllTrades.TradesPerformance.Currency.CumProfit - startOfDayProfit
    but this is only for the realized PnL.

    Tx!

    #2
    freewind, I'm not following you here, once the trading day is over and you're flat, there would be no unrealized PnL? Or are you holding overnight positions here?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I want to know during the day what is my unrealized position. I want to exit all positions if my StopLoss for the day has reached.

      Comment


        #4
        Sorry freewind, for this just add the open position PnL to the already known win / loss amount for the day - http://www.ninjatrader.com/support/h...profitloss.htm
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks Bertrand, this is what I needed.

          Comment


            #6
            When using any of my strategies with contract 6E (full euro), there is no unrealized or realized P&L showing. The zero in each column is highlighted with red or green when trades are executed--but it never shows any other digits. 6E is the only contract that does this. Same exact thing happens in replay. I am using Zen-Fire. Any way to fix this?

            Comment


              #7
              LTWCI, where do you track with the PnL then? In the Positions tab or Market Analyzer for the 6E? Would you see the same mismatch after an instrument reset under Tools > Options > Data?

              Thanks,
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Bertrand

                I am seeing this in the Control Center Strategies tab. I have not tried to reset the database because I am currently running strategies. In the Control Center Orders tab, I can see the bid/ask/last pricing moving correctly.
                Last edited by LTWCI; 09-26-2011, 10:28 AM.

                Comment


                  #9
                  LTWCI, is this on the latest NT7 R7? In my testing here I could not reproduce this, please retry once you had a chance to reset the instruments info under Tools > Options > Data and have restarted NT fresh.

                  Thanks,
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Yes, I'm using NT 7 R7. OK, I'll try resetting the DB later today.

                    Comment


                      #11
                      Bertrand

                      I reset the database and the same thing is happening in the strategy tab window with contract 6E. It shows 1 contract in the position column and the average price, but unrealized doesn't change from zero. It just highlights the zero from red to black or to green.

                      Comment


                        #12
                        LTWCI, thanks for the repply here - to clarify : did you reset the database or reset the instruments under Tools > Options > Data?
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          I reset the database.

                          Comment


                            #14
                            Thanks, can you then please try a reset of the instrument definitions as well under Tools > Options > Data and then recheck? This would affect mapping and ticksizes used by NT which in turn influences the PnL display.
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              I've fixed the problem. The point value was set to 1.00. The correct setting is 125,000.00.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by DJ888, 04-16-2024, 06:09 PM
                              6 responses
                              18 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by Jon17, Today, 04:33 PM
                              0 responses
                              1 view
                              0 likes
                              Last Post Jon17
                              by Jon17
                               
                              Started by Javierw.ok, Today, 04:12 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post Javierw.ok  
                              Started by timmbbo, Today, 08:59 AM
                              2 responses
                              10 views
                              0 likes
                              Last Post bltdavid  
                              Started by alifarahani, Today, 09:40 AM
                              6 responses
                              41 views
                              0 likes
                              Last Post alifarahani  
                              Working...
                              X