Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

strategy daily loss max. xy

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

    strategy daily loss max. xy

    Hello,

    When writing a strategy, I would like to be able to define a "daily loss".
    And when the strategy has reached this loss, it should no longer execute any trades.

    There is a similar example: https://ninjatrader.com/support/help...ancevalues.htm

    But that (example) is the "total loss".

    I would like to have the "profit from the current day". (daily loss)

    Is there such a function?
    How else could I go about this?​

    #2
    Hello 1001111,

    You can find a sample that shows how to break down the pnl into per session values here: https://ninjatrader.com/support/help...nce_statis.htm

    Comment


      #3
      Thank you very much. That helped me a lot. I always wanted to go back one day and add up the last trades. But this example makes more sense.

      I will expand it with the following

      HTML Code:
      if (0 == Bars.BarsSinceNewTradingDay) {}
      This way you not only get the session start, but also the beginning of the trading day.


      thank you very much

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      476 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      317 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      254 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      340 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      306 views
      0 likes
      Last Post CarlTrading  
      Working...
      X