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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      134 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X