Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Putting max trailing drawdown and daily loss limit directly into a trading strategy

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

    Putting max trailing drawdown and daily loss limit directly into a trading strategy

    Would it be possible to implement something like this into the strategy itself via ninjascript? I know that it is possible to turn on a function like this for the account when live trading, but I want to be able to see the effects in the strategy analyzer when doing backtesting. Thank you in advance for any help!

    #2
    Hello, thanks for writing in. You can get the Drawdown value while the strategy is running using this code:

    SystemPerformance.AllTrades.TradesPerformance.Curr ency.Drawdown

    This comes from the documentation example here:



    We have examples of a daily loss limit here:

    Hello, I've updated the DailyLossLimit and DailyLosLimitMultiTrade examples that were posted on the forum for NinjaTrader 7 for NinjaTrader 8. These are often requested and I felt they are good examples to have for NT8. DailyLossLimitExample_NT7 - http://ninjatrader.com/support/forum...241#post451241 (http://ninjatrader

    Comment


      #3
      Thanks for the helpful response. I am attempting to use the DailyLossLimitMultiTradeExample that you sent a link to as part of my strategy. It is working fine to record losing trades as part of the currentPnL, but it sometimes misses winning trades, leading the strategy to "think" that the currentPnL situation is worse that it really is. Is there a known fix for this issue? If necessary I can provide the code for my strategy.

      Comment


        #4
        Hello PacifistZealot,

        To confirm, are you able to reproduce this behavior using the DailyLossLimitMultiTradeExample without any modifications?

        Are you printing the last trade information from the SystemPerformance and finding that the entry price and exit price are not matching the profit of that trade?
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        62 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X