• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AvgProfit == Average Net Profit?

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

    #16
    Excellent, this is proving to be super helpful.

    So on Slippage, is there any way to generate a backtest for 3 ticks of roundtrip Slippage? If my understanding of your Slippage explanation (below) is correct, one could only have 0, 2, 4, 6, etc roundtrip Slippage ticks because the Slippage value in the Strategy Analyzer dialog box is per side and needs to be an integer (i.e., 0, 1, 2, 3, etc)?

    Thanks, Aventeren

    Comment


      #17
      Hi aventeren,

      You could try using 1.5 but I'm not going to recommend it.

      If you enter with a limit and exit with a market or stop market then only the market will have the slippage and you could use 3.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Originally posted by NinjaTrader_ChelseaB View Post
        Hi aventeren,

        You could try using 1.5 but I'm not going to recommend it.

        If you enter with a limit and exit with a market or stop market then only the market will have the slippage and you could use 3.
        From what I've read, I've been advised against using limit orders in backtesting because they generate unrealistic results. However, the following might produce reasonable back testing results:

        1. Modify the strategy for back testing purposes to enter with limit orders (i.e., EnterLongLimit() and EnterShortLimit()) and exit with market orders (i.e., ExitLong() and ExitShort()).

        2. Select "Default" in the "Fill type" parameter in the Strategy Analyzer dialog box, which amongst other things specifies that limit orders will only fill if penetrated. The documentation does not say anything about how the Default Historical Fill Processing in Operations > Strategy Analyzer > Understanding historical processing options > Historical Fill Processing handles market orders, but I'm assuming that market orders are considered executed if touched (can you please confirm this)?

        3. Enter 3 for the Slippage value in the Strategy Analyzer dialog box, such that the back test engine will then add 0 ticks Slippage to the limit order and 3 ticks Slippage to the market (stop) order.

        Does that seem likely to produce a back test with 3 ticks of roundtrip Slippage?

        Also, can you please confirm with the Default Fill Type in the Historical Fill Processing dialog box that although limit orders will only be filled if penetrated, that market orders will still be filled with the specified Slippage when touched?

        Thanks,

        Aventeren

        Comment


          #19
          Hi averteren,
          Originally posted by aventeren View Post
          From what I've read, I've been advised against using limit orders in backtesting because they generate unrealistic results. However, the following might produce reasonable back testing results:

          1. Modify the strategy for back testing purposes to enter with limit orders (i.e., EnterLongLimit() and EnterShortLimit()) and exit with market orders (i.e., ExitLong() and ExitShort()).

          2. Select "Default" in the "Fill type" parameter in the Strategy Analyzer dialog box, which amongst other things specifies that limit orders will only fill if penetrated. The documentation does not say anything about how the Default Historical Fill Processing in Operations > Strategy Analyzer > Understanding historical processing options > Historical Fill Processing handles market orders, but I'm assuming that market orders are considered executed if touched (can you please confirm this)?

          3. Enter 3 for the Slippage value in the Strategy Analyzer dialog box, such that the back test engine will then add 0 ticks Slippage to the limit order and 3 ticks Slippage to the market (stop) order.

          Does that seem likely to produce a back test with 3 ticks of roundtrip Slippage?

          Also, can you please confirm with the Default Fill Type in the Historical Fill Processing dialog box that although limit orders will only be filled if penetrated, that market orders will still be filled with the specified Slippage when touched?

          Thanks,

          Aventeren

          You are likely referring to how the Default fill type requires that the price passes through a limit for it to fill.
          Try using the Liberal fill type instead. This fills limits when they are touched and does not require a pass through. In a way that is more like the real market while the Default fill type is more like a worst case scenario.

          Market / Stop Market orders will be filled at the open price of the next bar every time.

          Yes, it does seem likely that a limit order entry and market order exit would result in 3 ticks of slippage. But I recommend that you test this and confirm.

          Yes, I can confirm (through testing) that the market order will have slippage applied (within the price range of the bar) using the Default or Liberal fill types and that limit orders will need to be passed through when using the Default fill type.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            Originally posted by NinjaTrader_ChelseaB View Post
            Hi averteren,



            You are likely referring to how the Default fill type requires that the price passes through a limit for it to fill.
            Try using the Liberal fill type instead. This fills limits when they are touched and does not require a pass through. In a way that is more like the real market while the Default fill type is more like a worst case scenario.

            Market / Stop Market orders will be filled at the open price of the next bar every time.

            Yes, it does seem likely that a limit order entry and market order exit would result in 3 ticks of slippage. But I recommend that you test this and confirm.

            Yes, I can confirm (through testing) that the market order will have slippage applied (within the price range of the bar) using the Default or Liberal fill types and that limit orders will need to be passed through when using the Default fill type.
            Thanks, Chelsea.

            I understand where you are coming from on the Liberal vs Default fill type (as it relates to limits being executed when touched or when penetrated, respectively), but I think I'm going to stick with the Default fill type so that this portion of my back test will have the potential to under-promise and over-deliver (i.e., guaranteed that the entry price would have been achieved) rather than over-promise and under-deliver (i.e., live miss an entry b/c price moved away).

            I'll make sure to test the limit and stop = 3 ticks slippage. That might be a decent way to test to 3 ticks.

            On the entries, your answer sheds light on why others use a secondary data series (i.e., 1 range) for entries and exits. Clearly using the secondary series for exits makes intuitive sense for back testing, but until you pointed out that a market order is not assumed to be executed until the open of the next bar, I did not understand why others used a secondary series for order entries. Now (I think) I do. For example, if you were back testing a daily bar and market entry order, then you would have to assume that if the OHLC met your entry condition that the assumed entry price would not be until the open of the next bar. But instead, if you had a piece of logic that first identified if the OHLC of the bar triggered the entry, which then dropped you into a secondary series to simulate the entry price, a better simulation would occur if you were planning on using COBC = false for your actual live testing. If you were using only going to be using COBC = true, then it likely wouldn't matter, as a live order would not be triggered until the open of the next bar anyway. I'll have to think about this...

            Thanks for your help.

            All best,

            Aventeren

            Comment


              #21
              So I've been thinking about this commission and slippage issue, and another way to assume slippage for backtest purposes may be to just hardcode in the slippage and commission costs within the Tools > Options > Commissions > Futures - Simulator > Commission levels.

              For instance, let's say that you use a $2.50/side commission, and that you have plugged that number into the Futures - Simulator Commissions value. But, you also want to assume that on average you are also going to incur 3 ticks of roundtrip slippage. Therefore, what you may consider doing would be to calculate the instrument specific cost of 1.5 ticks, and then just add this to the $2.50 Futures - Simulator Commissions value.

              For example, let's say that you're backtesting the ES contract and that you are assuming $2.50/side in commission and 3 ticks roundtrip slippage. 3 ticks * $12.50/tick = $37.50 slippage. Therefore, you would divide $37.50 in half ($37.50 / 2 = $18.75) and add that number to $2.50 ($2.50 + $18.75 = $21.25) in the Commissions value, and you then have a net backtest result regardless of what order type you elect to use in your backtest (i.e., market or limit).

              Based on the above, is it possible to define the Futures - Simulator Commission value within Initialize()? For instance, the above ES example would be $21.25, but a similar CL backtest would be $2.50 + (3 ticks * $10/tick)/2 = $17.50. Therefore, to run an ES backtest and then a CL backtest, one would need to remember to go back into the Futures - Simulator option and change the Commission value from $21.25 to $17.50. Instead, would it be possible to just have an if or switch statement that set the Commission value within the code so that you would not have to go to the extra step of clicking through screens to change the Commission value?

              Thanks,

              Aventeren
              Last edited by aventeren; 02-24-2014, 09:11 AM.

              Comment


                #22
                Hi Aventeren,

                It is not possible to set the commission amounts using code.
                However, I will submit a feature request in your behalf to our development department for this.

                Thank you for your feedback and suggestions. We value your opinions and they will be considered in our feature discussion for a future NinjaTrader release.

                I did want to mention that it would seem odd to me to apply slippage to a limit order. A limit order would not be affected by slippage. However, the idea sounds good.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by guvenators, Today, 05:18 PM
                1 response
                13 views
                0 likes
                Last Post NinjaTrader_ShawnB  
                Started by LANwarr1or, Today, 03:00 PM
                2 responses
                8 views
                0 likes
                Last Post LANwarr1or  
                Started by Newtrader101, Today, 02:53 PM
                2 responses
                10 views
                0 likes
                Last Post Newtrader101  
                Started by JuanPabloQuevedo, Today, 02:53 PM
                2 responses
                9 views
                0 likes
                Last Post JuanPabloQuevedo  
                Started by samir, Today, 03:16 PM
                2 responses
                14 views
                0 likes
                Last Post samir
                by samir
                 
                Working...
                X