Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market vs Limit orders

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

    Market vs Limit orders

    Is it normal to get different results if I run a backtest. Two different versions.

    1) Buy is a market.
    2) Buy is a limit with a limit price of 50*TickSize above GetCurrentAsk()

    This is using unmanaged orders. I would of assumed it would give me the same results. But it is not.

    ?

    #2
    Hello,

    How far different are the results? Would expect it to be the same as lonf your your going long in this case. Going short would need to be the other way around.

    I look forward to assisting you further.

    Comment


      #3
      Originally posted by NinjaTrader_Brett View Post
      Hello,

      How far different are the results? Would expect it to be the same as lonf your your going long in this case. Going short would need to be the other way around.

      I look forward to assisting you further.
      Pretty big difference. I know this doesn't really mean anything. But it is more than $10k difference running it over a year. Same # of trades (534 of them).

      Any further ideas?

      Comment


        #4
        Hello,

        Can you spot any differences in the fill times and dates, or the fill prices in the performance report?

        If not able to identify would need you to send both strategies to support at ninjatrader dot com for me to look into.

        I look forward to assisting you further.

        Comment


          #5
          I tested one day and looked at an entry in question. The limit order using:

          Code:
          longInsideEntryOrder = SubmitOrder(0,OrderAction.Buy,OrderType.Limit,contracts,GetCurrentAsk() + (50*TickSize),0,"","Long Inside");
          Actually buys instrument (TF) 50 ticks above the current price instead of giving me the best price.

          8/18/2008 8:09:00 AM ---------+++++---------Placing long INSIDE order. Entry: 754.4

          Order='NT-00003/Backtest' Name='Long Inside' State=PendingSubmit Instrument='TF 03-11' Action=Buy Limit price=759.4 Stop price=0 Quantity=1 Strategy='TF1' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='ffc274ded5034b71b5cc73809f0440f3' Gtd='12/1/2099 12:00:00 AM'
          Order='NT-00003/Backtest' Name='Long Inside' State=Accepted Instrument='TF 03-11' Action=Buy Limit price=759.4 Stop price=0 Quantity=1 Strategy='TF1' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='ffc274ded5034b71b5cc73809f0440f3' Gtd='12/1/2099 12:00:00 AM'
          Order='NT-00003/Backtest' Name='Long Inside' State=Working Instrument='TF 03-11' Action=Buy Limit price=759.4 Stop price=0 Quantity=1 Strategy='TF1' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='ffc274ded5034b71b5cc73809f0440f3' Gtd='12/1/2099 12:00:00 AM'
          Order='NT-00003/Backtest' Name='Long Inside' State=Filled Instrument='TF 03-11' Action=Buy Limit price=759.4 Stop price=0 Quantity=1 Strategy='TF1' Type=Limit Tif=Gtc Oco='' Filled=1 Fill price=759.4 Token='ffc274ded5034b71b5cc73809f0440f3' Gtd='12/1/2099 12:00:00 AM'
          That is from my output window. The 754.4 on the top line is GetCurrentAsk()

          ?
          Last edited by lookOutBelow; 01-18-2011, 02:49 PM.

          Comment


            #6
            Hello,

            Very interesting. I would want to look into this with development. Can you please send in your strategy to support at ninjatrader dot com and let me know what chart and instrument you are running this backtest on so I can duplicate the results.

            Seems as if the limit price is being used instead of the Open price of the next bar.

            Comment


              #7
              As you can imagine, I don't really want to hand over my strategy.

              I did find something interesting that may or may not answer it... If I leave Fill Type to Liberal, I get more normal looking results. Meaning, it doesn't do a limit buy 50 ticks above the current price. If it is on Default, then it buys it above the current market. Perhaps there is something going on with the fill type.


              There is still a discrepancy between Market and Limit orders. Even with Fill Type on Liberal. The limit buys are a few ticks off here and there. Is that considered normal? It is almost like a slippage.

              I'm not sure how the backtest calculates a market buy as opposed to a limit buy that is well above current Ask.

              Thanks

              Comment


                #8
                When you use Default, it will fill you at the limit price. When you use Liberal it will fill closer to the bar.

                A market order will just fill at the next bar's open in a backtest.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Josh View Post
                  When you use Default, it will fill you at the limit price. When you use Liberal it will fill closer to the bar.

                  A market order will just fill at the next bar's open in a backtest.
                  Thanks. So, when using liberal, if not the next bar open, where is it getting (assuming you place the limit well above the ask) the price from?

                  I'm just trying to identify what is going on so I can figure out what is more realistic result.

                  Comment


                    #10
                    For a reading on the difference between Default and Liberal fill types please see the "Understanding historical processing options" section here: http://www.ninjatrader.com/support/h...a_strategy.htm
                    Josh P.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by AttiM, 02-14-2024, 05:20 PM
                    11 responses
                    184 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by fernandobr, Today, 09:11 AM
                    1 response
                    3 views
                    0 likes
                    Last Post NinjaTrader_Erick  
                    Started by timmbbo, Today, 08:59 AM
                    1 response
                    3 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by KennyK, 05-29-2017, 02:02 AM
                    2 responses
                    1,281 views
                    0 likes
                    Last Post marcus2300  
                    Started by itrader46, Today, 09:04 AM
                    1 response
                    6 views
                    0 likes
                    Last Post NinjaTrader_Clayton  
                    Working...
                    X