Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop a strategy if profit goal reached?

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

    #46
    Ok, will do as indicated, but again, in the case of the SamplePnL strategy on CL 09-10 which I just added today to my instrument list (I was following CL 08-10 yestterday) it should be executing without a hiccup... but, let's see what I get with the Print() and I'll let you know.

    Tks again

    Comment


      #47
      Originally posted by NinjaTrader_RyanM View Post
      Our replies crossed. Regarding your latest post:

      The value is captured at the start of the day so that you can later subtract the total from this captured value. This tell you what has been going on for the day-in-progress.

      Code:
       
      Performance.AllTrades.TradesPerformance.Currency.CumProfit - priorTradesCumProfit = Your session CumProfit.
      I get this...

      Perfomance All Trades - Prior Trades
      -20.0000000000243
      All Trades Count - Prior Trades
      11

      where is the SamplePnL strategy getting these from ? I just started running it today???

      Comment


        #48
        pepereal4,

        When you start a strategy it recalculates based off of historical data to generate historical strategy positions. When you use "Performance.AllTrades" you are accessing these historical trades. If you only want real trades please use "Performance.RealtimeTrades".
        Josh P.NinjaTrader Customer Service

        Comment


          #49
          RealTime trades vs All trades was the problem, solved with output window - big tks !!!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          60 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          146 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          161 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          97 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          284 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X