Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why does adding exit condition reduce the number of trades in a backtest?

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

    Why does adding exit condition reduce the number of trades in a backtest?

    Hi all. I have a question about strategy development and backtesting. I've noticed that when I add a condition check for exits, instead of leaving exits to exit on close, often fewer trades come in with the exit condition than without. So,

    Code:
    if(condition1)
        EnterLong();
    Might return 2000 trades, but

    Code:
    if(condition1)
        EnterLong();
    if(condition2)
        ExitLong();
    returns fewer (1800+/-) trades. What am I missing?

    #2
    Hello CSharpTrader,
    Thanks for your post.

    To assists you further may I know does your NinjaScript code is a long only strategy or it implements shorts too (via EnterShort for example).

    I look forward to assisting you further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hi Joydeep, it's long only. I've seen this happen in most of my strategies, always long only so far.

      Comment


        #4
        Hello CSharpTrader,
        To assist you further can you please send a toy NinjaScript code* replicating the behavior to support[AT]ninjatrader[DOT]com

        Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.

        I look forward to assisting you further.

        *The "toy" just means something that is a stripped down version that isn't necessarily the whole logic. It makes things easier to rout out.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Thanks Joydeep, I just sent it, hopefully it makes sense, let me know if you have any questions..

          Comment


            #6
            Hello CSharpTrader,
            This is to confirm I have received your email and has replied to it.
            JoydeepNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            648 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X