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 NullPointStrategies, Today, 05:17 AM
      0 responses
      53 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X