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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        47 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        23 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        33 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        50 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Working...
        X