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 charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          61 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          148 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          162 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          98 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          286 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X