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 PrTester, 12-29-2008, 05:27 PM
      131 responses
      96,700 views
      0 likes
      Last Post diegomezhur  
      Started by knowmad, 05-07-2024, 03:52 AM
      6 responses
      62 views
      0 likes
      Last Post knowmad
      by knowmad
       
      Started by xepher101, 05-10-2024, 12:19 PM
      9 responses
      115 views
      0 likes
      Last Post jeronymite  
      Started by tkaboris, Yesterday, 07:53 PM
      0 responses
      5 views
      0 likes
      Last Post tkaboris  
      Started by JGriff5646, 05-19-2024, 05:47 PM
      2 responses
      23 views
      0 likes
      Last Post JGriff5646  
      Working...
      X