Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Session P&L

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

    Session P&L

    Lets say I want to stop trading if I am dow $250
    Would the following code be the best way to do that:
    if (Performance.RealtimeTrades.TradesPerformance.Gros sProfit +
    Performance.RealtimeTrades.TradesPerformance.Gross Loss
    < -250 )
    {
    //Disable strategy if exceeded $250
    Disable();
    Print(Time[0] + "EXIT Strategy exceeded target loss of $250 ") ;
    }

    #2
    Hello,

    Yes this is how I would do it. There are always multiple ways to do something in NinjaScript however.

    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      Help is unclear on the Trades collection. Does

      Performance.RealtimeTrades.TradesPerformance.Curre ncy.CumProfit

      Track cumulative profit for only trades since Start of Session or for ALL trades for a strategy irregardless of session.

      Also, how does this work when submitting orders to an ATM? Is cum profit across ALL ATMs? If so, how does one access trade performance for a specific ATM?
      Last edited by snaphook; 02-08-2011, 08:28 AM.

      Comment


        #4
        Hello,

        You specify this with this here:

        Performance.RealtimeTrades.TradesPerformance.Curre ncy.CumProfit



        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        Comment


          #5
          Ok. So RealTimeTrades accesses RTT for this session only, and excludes RTT from a prior session. Is that correct?

          Comment


            #6
            Realtime Trades is real trades placed in the strategy since the strategy was enabled.

            Let me know if I can be of further assistance.
            BrettNinjaTrader Product Management

            Comment


              #7
              So, if I disable it and 5 minutes later re-enable it, the count starts over when I enable it?

              This would be a good little tidbit for the help file.

              Comment


                #8
                Hello,

                Actually not in this case as this is strategy persistance. A disable and then renable will keep the realtime data going.

                However if you removed the strategy and then re-added and enabled it then the data would be removed and started fresh.

                Let me know if I can be of further assistance.
                BrettNinjaTrader Product Management

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                633 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                364 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                567 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                568 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X