Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How is the "reset to zero" for these system variables?

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

    How is the "reset to zero" for these system variables?

    Hi Ninjas,

    One feature of an Algo is having updated variables such as following below for logic procedures purposes:
    - GetAccountValue(AccountItem.RealizedProfitLoss)
    - Performance.RealtimeTrades.TradesPerformance.Curre ncy.CumProfit
    - Performance.AllTrades.TradesPerformance.Currency.C umProfit

    When do these variable reset to zero, in order to be sure for a new session?

    Thanks

    #2
    Hello pstrusi,

    Thank you for your post.

    The AllTrades and RealTimeTrades reset for a new instance of the strategy, so these would not reset to zero at any point during the current strategy's run. AllTrades will include all historical trades so this will not be zero if historical trades are calculated as taking.

    GetAccountValue is based on the account the strategy is ran on and will only be zero over historical bars. On real-time bars it will be the account's value.

    Comment


      #3
      Hi Patrick,

      I understand what you say about these variables; so it left me wondering:

      How can I be able to have the real-actual realized PnL updated as soon as a trade is closed?

      Thanks

      Comment


        #4
        Hello pstrusi,

        CumProfit() would provide this value, is this not what you are seeing on your end?

        Comment


          #5
          Hi Patrick,

          That command doesn't seem to exist in that simply form "CumProfit()", I imagine that you meant what goes with:
          "Performance.AllTrades.TradesPerformance.Currency. CumProfit" ; the problem with that command is that it has a historical number by its own that I can't reset for a new session, so it's useless for my purposes.

          If you had any other idea please let me know

          Thanks

          Comment


            #6
            Just save its value at session begin and then compare.

            Comment


              #7
              Thanks Baruch for your suggestion; yes there are several indirect ways to calculate through any snippet, but don't u think that a powerful software packaged as NT should have a direct command that immediately shows the same realized PnL displayed in the Tab "account" of the Control center ?, that's my point.

              Comment


                #8
                You would use Performance.RealTimeTrades.TradesPerformance.Curre ncy.CumProfit: http://www.ninjatrader.com/support/h...timetrades.htm

                Comment


                  #9
                  Thanks Patrick, you've nailed it!

                  Yep, This is what I was looking for: "Performance.RealtimeTrades.TradesPerformance.Curr ency.CumProfit"

                  It gives me actually in real time, the realized PnL as soon as the last trade is closed

                  Finally, Thanks

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  65 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  41 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  23 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  26 views
                  0 likes
                  Last Post TheRealMorford  
                  Started by Mindset, 02-28-2026, 06:16 AM
                  0 responses
                  52 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Working...
                  X