Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    JesseNinjaTrader Customer Service

    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 thegeniuswavebyt, Today, 03:40 AM
      1 response
      10 views
      0 likes
      Last Post marcus2300  
      Started by wuannetraam, Yesterday, 07:43 AM
      2 responses
      26 views
      0 likes
      Last Post wuannetraam  
      Started by hsammons87, Yesterday, 05:21 PM
      1 response
      16 views
      0 likes
      Last Post peter629  
      Started by David Hill, Today, 02:57 AM
      0 responses
      22 views
      0 likes
      Last Post David Hill  
      Started by r68cervera, 05-15-2024, 02:54 AM
      6 responses
      36 views
      0 likes
      Last Post r68cervera  
      Working...
      X