Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Gap behaviour of Stop and Limit orders

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

    Gap behaviour of Stop and Limit orders

    Hallo,

    I have a look forward bias during backtesting because of the following problem:

    At the signal bar I submit an entrylonglimit order, the limit being a value
    below the close of the signal bar and above the high of the following bar.
    If I chose Default as fill type, the entry is taking place rigth within the gap at
    the limit price. When I chose liberal as fill type, entry is taking place at the High of the bar. Both is not happening in real life and the latter causes a negative bias in system performance. In my view it's more realistic to do a fill at the open of the bar, when the
    price of the Open is alreaedy below the limit. How to script that in a correct way?

    entrystoplimit seems to behave "correct" at gaps.

    #2
    Hi Stephan123,

    Market orders like EnterLong() and EnterShort() fill at the open of the next bar following the condition.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I know. But I need to enter intrabar at certain price levels, which stop and limit orders
      are made for.

      Comment


        #4
        You could consider programming your own fill type if you prefer a different handling than the built in ones. This is beyond our scope of support but is possible. You will need an external development environment like visual studio, and will find existing fill types here:
        Documents\NinjaTrader 7\bin\custom\type\
        @DefaultFillType, @LiberalFillType
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by Stephan123 View Post
          I know. But I need to enter intrabar at certain price levels, which stop and limit orders
          are made for.
          If you want entries intrabar while backtesting, you will have to add another bar series with finer granularity, that you can use to trigger orders.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          661 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          376 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          110 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          580 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X