Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BACKTEST: Erroneous fills for limit orders

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

    BACKTEST: Erroneous fills for limit orders

    Dear NinjaTrader,

    I am getting wrong fills for limit orders in backtest while in real I am getting perfect fills. What could be the reason?

    For instance, if you look at the attached image, you'll see that my strategy sent a short limit order @ 1277.0, but got filled @ 1277.1.

    I am also using liberal fill type...

    Please help me understand what it is going on and how would this impact trading real this strategy.

    Thank you very much.
    Attached Files

    #2
    Hello nicanor.babula,

    Thanks for your post.

    Can you provide further information about your strategy?

    Have you added any other dataseries?

    Are all the fills in the strategy analyzer at your limit or better price?

    Do you see any error messages listed in the log tab of the control center when you run the strategy in the strategy analyzer?
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Paul View Post
      Hello nicanor.babula,

      Thanks for your post.

      1) Can you provide further information about your strategy?

      2) Have you added any other dataseries?

      3) Are all the fills in the strategy analyzer at your limit or better price?

      4) Do you see any error messages listed in the log tab of the control center when you run the strategy in the strategy analyzer?
      Hi there,

      Thanks for the reply.

      1) The strategy simply tries to follow the trend on a range bars chart. I cannot provide in-depth details, but roughly it goes long when the bar closes over an average and flattens when it closes under the average. Viceversa for short.

      2) Yes, I use a second dataseries. I use the tick dataseries to obtain intra-bar definition while backtesting.

      3) Not all the fills, but most of them.

      4) No, no errors at all in the log.

      Sincerely,
      Nicanor.

      Comment


        #4
        Hello Nicanor,

        Thanks for your reply.

        Have you tried using the "default" fill type and if so are your results as expected?
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Hi,

          With "Default" fill type seems fine. What's the logic behind it? I would expect more ideal fills with "Liberal", not with "Default". How come in this case it's viceversa?

          Thanks.

          Comment


            #6
            Originally posted by nicanor.babula View Post
            For instance, if you look at the attached image, you'll see that my strategy sent a short limit order @ 1277.0, but got filled @ 1277.1.
            Isn't this ok?

            I mean, a limit order says buy at price X or better .. well, isn't 1277.1 considered a "better" price than 1277.0 when going short?

            Comment


              #7
              Originally posted by bltdavid View Post
              Isn't this ok?

              I mean, a limit order says buy at price X or better .. well, isn't 1277.1 considered a "better" price than 1277.0 when going short?
              Thanks for replying.

              Yes, it is better. But I would expect for the backtester to give me realistic results. Even more pessimistic, but not too optimistic.

              When I trade live this strategy I *RARELY* get executed better. maybe 0.5% of the times. In backtest, I get executed better 98.7% of the times. How can I trust my backtests this way?

              Please advise.

              Thanks.

              Comment


                #8
                Hello Nicanor,

                Thanks for your post.

                Quoting from the helpguide:

                The two system fill algorithms are:

                Default
                An algorithm that takes a conservative and more realistic approach to filling limit and stop limit orders.
                • Limit orders only fill if the limit price was penetrated
                • Limit orders are always filled at the limit price specified never better (for example, if a limit order is submitted on bar n, NinjaTrader will check if the order is filled on bar n+1, if this bar gaps down and the limit order was a buy, the order would be filled at the limit price and NOT the high of bar n+1)

                Liberal
                An algorithm that takes a liberal approach to filling limit and stop limit orders.
                • Limit orders fill if the limit price was touched
                • On gap down bars, buy limit orders will fill at the high of the gap down bar
                • On gap up bars, sell limit orders will fill at the low of the gap up bar


                Here is the link to the helpguide section: http://ninjatrader.com/support/helpG...a_strategy.htm
                Paul H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by algospoke, Yesterday, 06:40 PM
                2 responses
                19 views
                0 likes
                Last Post algospoke  
                Started by ghoul, Today, 06:02 PM
                3 responses
                14 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                44 views
                0 likes
                Last Post jeronymite  
                Started by Barry Milan, Yesterday, 10:35 PM
                7 responses
                20 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by AttiM, 02-14-2024, 05:20 PM
                10 responses
                180 views
                0 likes
                Last Post jeronymite  
                Working...
                X