Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Slipage

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

    Slipage

    Hi,

    Can anyone please explain to me how and when slippage is applied during backtesting? I had a strategy go from mildly successful to horribly unsuccessful when I changed slipage from 0 to 2 ticks. Any info would be greatly appreciated. Thank you.

    #2
    Zeos6, slippage is the offset applied to the entry and exit when backtesting when compared to the actual bar data. If you're backtesting a stock, for example, and the long entry was triggered at 15.43, it would actually be filled at 15.45 for two ticks of slippage. It is basically meant to account for the fact that you'll probably be buying and selling at market prices. For something like the ES, two ticks is worst case scenario, but if you're trading some illiquid stock, you might need to bump up the slippage even higher.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Hi Austin,

      Thanks for your reply. I do know what slippage is. What I was asking was how it is applied by Ninjatrader during back testing. It appears from your response that slippage is apllied on EVERY trade during back testing on BOTH the entry and the exit. So, on every trade I loose 4 ticks if I set slippage to 2 ticks. Is that correct?

      In reality, during live trading, slippage does not occur on every trade. Therefore, is it possible to programatically set when slippage is to be applied? I am thinking for example to have slippage occur say only 30% of the time, randomly. Is there a way to set when slippage is to be applied? Please let me know. Thank you.

      Comment


        #4
        Zeos6, you are correct - slippage is applied to both entries and exits. Unfortunately it is not currently possible to apply random slippage.
        AustinNinjaTrader Customer Service

        Comment


          #5
          I have not tried this but i think you can fiddle with the the fill price. you can get an idea from post #11 of the below mentioned thread

          Comment


            #6
            Hi bukkan,

            Thanks for your reply. From Austin's response I assumed that NT applies slippage on every trade. The real trading slippage issue, however, is more complex. In reality there are different slippage probabilities for entries and exits. I have figured out a way to program this and will code it and try it out. Thanks for the thread reference.

            Comment


              #7
              yes Austin is right on slippage. but here we are circumventing slippage altogether and calculating our own fill price. havent tried it myself so do let me know the result.

              Comment


                #8
                Hi bukkan,

                Thanks for your reply but I respectfully disagree. I don't think we are circumventing slippage in what I propose to do. I think that NT is unrealistic in how it applies slippage. I have been trading for a long time and I have never had slippage on BOTH the entry and the exit on EVERY trade.

                In fact I rarely get slippage on entries, and when I do it's usually 1 tick. I do occasionally get slippage on exits, but the slippage is never more than 2 ticks. For me slippage on exits is more common than on entries but it still does not happen often. So, I am thinking of using entry slippage probability of 10% and exit slippage probability of 25% and using different slippage amounts for entries and exits.

                I will let you know how this goes.

                Comment


                  #9
                  Originally posted by Zeos6 View Post
                  Hi bukkan,

                  Thanks for your reply but I respectfully disagree. I don't think we are circumventing slippage in what I propose to do. I think that NT is unrealistic in how it applies slippage. I have been trading for a long time and I have never had slippage on BOTH the entry and the exit on EVERY trade.

                  In fact I rarely get slippage on entries, and when I do it's usually 1 tick. I do occasionally get slippage on exits, but the slippage is never more than 2 ticks. For me slippage on exits is more common than on entries but it still does not happen often. So, I am thinking of using entry slippage probability of 10% and exit slippage probability of 25% and using different slippage amounts for entries and exits.

                  I will let you know how this goes.
                  well, its not NT doing something unrealistic but rather i would say its just the maths. the said thread just try to make things realistic.

                  every market order is prone to slippage and slippage dosent means its has to be -ive but we have to assume the worse.

                  Comment


                    #10
                    Originally posted by Zeos6 View Post
                    Hi bukkan,

                    Thanks for your reply but I respectfully disagree. I don't think we are circumventing slippage in what I propose to do. I think that NT is unrealistic in how it applies slippage. I have been trading for a long time and I have never had slippage on BOTH the entry and the exit on EVERY trade.

                    In fact I rarely get slippage on entries, and when I do it's usually 1 tick. I do occasionally get slippage on exits, but the slippage is never more than 2 ticks. For me slippage on exits is more common than on entries but it still does not happen often. So, I am thinking of using entry slippage probability of 10% and exit slippage probability of 25% and using different slippage amounts for entries and exits.

                    I will let you know how this goes.
                    I do not know if you recorded slippage information in your trading diary, but if you did, you might want to look at your last (say) 100 trades, and use that to determine the percentages. Just a suggestion, as when I did make a crude estimation by such a tally, I discovered that there was more slippage than I had been thinking, as I use almost exclusively limit orders for both entry and exit.

                    The problem that I discovered was that I was giving up a lot of slippage on exits when price touched my exit price too often without taking me out, and I tried to chase the market to get out. In the end I found that when action slowed near my exit, I was better off using market orders to exit. So now, I have times of day when I use Market Orders for exit if I happen to be caught in a trade (for example, if a late morning trade is still on, and gets caught in the midday doldrums).

                    Comment


                      #11
                      Hi koganam,

                      Thanks for your email. I do record slippage in my trading logs and I rarely get slippage. I agree with you on using my recorded percentages for slippage and that is exactly what I was planning to do. Thanks for mentioning it. I tend to enter on stop with market momentum and consequently I rarely get slippage on entry. I exit on stop, on stop limit, or limit and sometimes on MIT and I do get slippage on exits but not very often and almost never more than 1 tick. Furthermore, this only happens on commodity futures when they are moving fast, e.g. crude oil. I think that if I code my own custom slippage percentages and slippage amounts for entries and exits, backtesting will better reflect the performance of my strategy. I will say though that NT will certainly give you the worst possible case scenario for your strategy when slippage is applied and in that it is immensely useful.

                      Comment


                        #12
                        For anyone interested in this, here is the formula:

                        If P is the probability that it takes at most n entries (or exits) for the first occurence of slippage to take place, and p is the probability of slippage taking place on any single entry (or exit), then

                        n < = log(1-P)/log(1-p)
                        expected number of entries = 1/p
                        variance = (1-p)/p^2

                        So, for example, if I want at least 95% probability that slippage has occured, and the probability of slippage on any entry (or exit) is 30%, then the formula gives n <= 8.399 or 9 entries (or exits). In other words, it will take at most 8.399 entries (or exits) for the first occurence of slippage to take place with at least 95% probability. The expected number of entries (or exits) would be 3.333 and the variance would be 7.778.

                        I apply this formula independently on entries and exits and I pick randomly from within this number of entries (or exits) as to which specific entry (or exit) I apply the slippage amount to.

                        Hope this helps. And of course, as koganam said, use your own slippage percentages (p values) based on your individual trading logs.
                        Last edited by Zeos6; 06-20-2011, 01:03 PM.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by argusthome, 03-08-2026, 10:06 AM
                        0 responses
                        88 views
                        0 likes
                        Last Post argusthome  
                        Started by NabilKhattabi, 03-06-2026, 11:18 AM
                        0 responses
                        48 views
                        0 likes
                        Last Post NabilKhattabi  
                        Started by Deep42, 03-06-2026, 12:28 AM
                        0 responses
                        31 views
                        0 likes
                        Last Post Deep42
                        by Deep42
                         
                        Started by TheRealMorford, 03-05-2026, 06:15 PM
                        0 responses
                        34 views
                        0 likes
                        Last Post TheRealMorford  
                        Started by Mindset, 02-28-2026, 06:16 AM
                        0 responses
                        69 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Working...
                        X