Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Setting Max Daily Loss in Strategy Wizard

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

    #16
    Decoda,

    Let's break down the condition you have here.

    if(RealizedPnL <= -900)

    This would read out as if RealizedPnL is less than or equal to -900 then place trades

    However, less than -900 is -901, -902 and so on.

    You want this to have if(RealizedPnL >= -900) then place trades.
    Cal H.NinjaTrader Customer Service

    Comment


      #17
      Cal,
      Thanks, I think I found the problem. I put it in like you said and it does work. It's just the backtester doesn't appear to reset the daily PnL at end of day. The strategy runs until I hit my max loss (cumalitively speaking, not day to day). I can backtest in market replay and it looks look it would work live, as long as I don't leave it running overnight (which I didn't plan on anyway). Appreciate the help.

      Comment


        #18
        Hello decoda,

        Thank you for your response.

        The PnL would not be reset over the backtest. In real-time trading and Market Replay it will reset when you disable the strategy or disconnect and re-enable the strategy after reconnecting.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        376 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        243 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        208 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        294 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        255 views
        0 likes
        Last Post CarlTrading  
        Working...
        X