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 ScottWalsh, Today, 04:29 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post ScottWalsh  
                  Started by rtwave, 04-12-2024, 09:30 AM
                  2 responses
                  22 views
                  0 likes
                  Last Post rtwave
                  by rtwave
                   
                  Started by tsantospinto, 04-12-2024, 07:04 PM
                  5 responses
                  70 views
                  0 likes
                  Last Post tsantospinto  
                  Started by cre8able, Today, 03:20 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post cre8able  
                  Started by Fran888, 02-16-2024, 10:48 AM
                  3 responses
                  49 views
                  0 likes
                  Last Post Sam2515
                  by Sam2515
                   
                  Working...
                  X