by George Pruitt on September 29, 2020 in Introduction, Python, TradingSimula-18, Trend Following System
WowsssadfSlippage Can Vary Throughout the Life of a Back-Test
Many testing platforms allow you to set a slippage and commission fee on a trade by trade basis. The only problem is that it is fixed for the life of the back test. You can always set a high amount to err on the side of caution. The more accurate method is to tie the slippage to the underlying data. Instead of a fixed $ amount you can use a portion of the average true range and convert that to $’s. Even using continuous contract data this is not a bad way to go. If you really want to be cruel to your algorithm and it enters on stops you can always serve up the worst case scenario. If the high of the day exceeds the stop-in level, instead of using the stop-level, use the high of the day. In reality you will not get the high or low of every day on a stop basis, but it does provide peek into the importance of that first bar of entry. Now should a system that collapses on this unrealistic slippage estimate be thrown out – by no means no. However, you can gain insight in the individual markets sensitivity to slippage and either include it in a portfolio test or provide incentive to drill down and figure out what is going on.
TradingSimula-18 Allows Full Control of Slippage Estimates
Here are three simple tests: 1) Use a fixed $100 for commission slippage 2) Use 10% of the 20Day ATR or $100 (whichever is greater) and finally 3) Buying the high and Shorting the low of the day.
Test 1 – Simple Bollinger Band System
Avg. Monthly Avg.
SysName Market TotProfit MaxDD ClsTrdDD AvgWin AvgLoss PerWins #Trds MonthRet. StdDev YearlyRet.
-------------------------------------------------------------------------------------------------------------------
Strategy-Temp Crude-ZU 6400 51750 40050 10911 -3918 0.28 40 49 5224 -1285
Strategy-Temp EuroCur-FN 10356 42143 30750 6199 -2604 0.33 40 80 3377 1408
Strategy-Temp Gold-ZG 14769 68040 52920 7320 -3745 0.34 38 115 5199 566
Strategy-Temp Coffee-KC 25737 47318 36212 8729 -3055 0.32 34 199 4301 3916
Strategy-Temp Nat.Gas-ZN -14540 26460 20530 5739 -2606 0.27 44 -112 3155 -1490
Strategy-Temp S.Beans-ZS 33687 17037 11175 5816 -2001 0.38 34 261 2811 2627
Strategy-Temp LCattle-ZT -18880 26370 23530 2396 -1381 0.24 41 -146 1766 -2200
Strategy-Temp Sugar-SB 15728 12403 6084 2655 -988 0.41 32 121 1573 1634
Strategy-Temp Silver-ZI -20050 135455 72850 10601 -7163 0.38 40 -155 11156 -2612
Strategy-Temp 10YNote-TY 18684 14077 9534 3349 -1242 0.39 33 144 1446 1470
-------------------------------------------------------------------------------------------------------------------
Totals 71893 180372 88.9% Avg. DD 58191 376
-------------------------------------------------------------------
Test 2 – Simple Bollinger Band System ($100 or 10% of 20D-ATR – whichever is greater);
Avg. Monthly Avg.
SysName Market TotProfit MaxDD ClsTrdDD AvgWin AvgLoss PerWins #Trds MonthRet. StdDev YearlyRet.
-------------------------------------------------------------------------------------------------------------------
Strategy-Temp Crude-ZU 2616 53050 41243 10789 -4002 0.28 40 20 5252 -1642
Strategy-Temp EuroCur-FN 9026 42836 31313 6672 -2541 0.30 40 69 3393 1289
Strategy-Temp Gold-ZG 11261 69500 54228 7186 -3818 0.34 38 87 5235 265
Strategy-Temp Coffee-KC 23411 48603 36844 8638 -3113 0.32 34 181 4326 3702
Strategy-Temp Nat.Gas-ZN -15885 27268 21143 5706 -2636 0.27 44 -123 3176 -1619
Strategy-Temp S.Beans-ZS 33121 17130 11285 5790 -2012 0.38 34 256 2818 2570
Strategy-Temp LCattle-ZT -18933 26404 23564 2392 -1382 0.24 41 -146 1767 -2203
Strategy-Temp Sugar-SB 15608 12497 6111 2648 -990 0.41 32 120 1575 1622
Strategy-Temp Silver-ZI -27549 141278 75085 11095 -7034 0.35 40 -213 11247 -3284
Strategy-Temp 10YNote-TY 18684 14077 9534 3349 -1242 0.39 33 144 1446 1470
-------------------------------------------------------------------------------------------------------------------
Totals 51363 194719 97.3% Avg. DD 59116 376
-------------------------------------------------------------------
Test 3 – Ouch!!! Execute at High of day of Buys/ExitShort and Low of day of Shorts/ExitLong
Avg. Monthly Avg.
SysName Market TotProfit MaxDD ClsTrdDD AvgWin AvgLoss PerWins #Trds MonthRet. StdDev YearlyRet.
-------------------------------------------------------------------------------------------------------------------
Strategy-Temp Crude-ZU -49250 73830 71130 10665 -5197 0.25 40 -381 5551 -6605
Strategy-Temp EuroCur-FN -33925 68743 53475 7095 -3499 0.25 40 -262 3687 -2556
Strategy-Temp Gold-ZG -46060 100060 83110 6724 -4931 0.29 38 -359 5517 -4449
Strategy-Temp Coffee-KC -17068 74581 61450 9183 -3988 0.26 34 -132 4568 -116
Strategy-Temp Nat.Gas-ZN -54409 60089 54409 5928 -3344 0.23 44 -421 3424 -5030
Strategy-Temp S.Beans-ZS 9137 24087 17625 4940 -2627 0.38 34 70 2922 208
Strategy-Temp LCattle-ZT -42260 48690 45400 2661 -1790 0.17 41 -327 1873 -4367
Strategy-Temp Sugar-SB 3721 16242 10295 2534 -1334 0.38 32 28 1597 470
Strategy-Temp Silver-ZI -149709 249635 172824 12892 -8572 0.23 40 -1160 11927 -14919
Strategy-Temp 10YNote-TY 4028 22746 16884 3343 -1488 0.33 33 31 1517 57
-------------------------------------------------------------------------------------------------------------------
Totals -375796 538016 370.4% Avg. DD 80316 376
-------------------------------------------------------------------
Wow did you see the jump in the loss in Silver. What’s that all about.
----------------------------------------- -----------------------------------------
Sys Name : Strategy-Temp Sys Name : Strategy-Temp
Mkt Symb : ZI Buy/Cover High Of Day - Short/Sell Low Of Day Mkt Symb : ZI Buy/Cover High Of Day - Short/Sell Low Of Day100 Commission
20100128 TF-Bol-S 1 1968.40000 0.00 0.00 20100128 TF-Bol-S 1 1989.00000 0.00 0.00
20100303 Sxit 1 2101.30000 -6745.00 -6745.00 20100303 Sxit 1 2098.00000 -5550.00 -5550.00
20100511 TF-Bol-B 1 2303.70000 0.00 0.00 20100511 TF-Bol-B 1 2281.50000 0.00 0.00
20100604 Lxit 1 2089.70000 -10800.00 -17545.00 20100604 Lxit 1 2121.00000 -8125.00 -13675.00
20100621 TF-Bol-B 1 2307.20000 0.00 0.00 20100621 TF-Bol-B 1 2299.50000 0.00 0.00
20100701 Lxit 1 2130.10000 -8955.00 -26500.00 20100701 Lxit 1 2173.00000 -6425.00 -20100.00
20100728 TF-Bol-S 1 2089.10000 0.00 0.00 20100728 TF-Bol-S 1 2092.00000 0.00 0.00
20100802 Sxit 1 2214.10000 -6350.00 -32850.00 20100802 Sxit 1 2187.00000 -4850.00 -24950.00
20100827 TF-Bol-B 1 2289.10000 0.00 0.00 20100827 TF-Bol-B 1 2287.50000 0.00 0.00
20110124 Lxit 1 3026.10000 36750.00 3900.00 20110124 Lxit 1 3032.50000 37150.00 12200.00
20110218 TF-Bol-B 1 3631.10000 0.00 0.00 20110218 TF-Bol-B 1 3536.50000 0.00 0.00
20110505 Lxit 1 3768.40000 6765.00 10665.00 20110505 Lxit 1 3861.00000 16125.00 28325.00
20110822 TF-Bol-B 1 4748.50000 0.00 0.00 20110822 TF-Bol-B 1 4710.00000 0.00 0.00
20110922 Lxit 1 3891.00000 -42975.00 -32310.00 20110922 Lxit 1 4206.00000 -25300.00 3025.00
20110923 TF-Bol-S 1 3323.00000 0.00 0.00 20110923 TF-Bol-S 1 3700.00000 0.00 0.00
20120120 Sxit 1 3552.40000 -11570.00 -43880.00 20120120 Sxit 1 3479.00000 10950.00 13975.00
20120228 TF-Bol-B 1 4053.80000 0.00 0.00 20120228 TF-Bol-B 1 3976.00000 0.00 0.00
20120314 Lxit 1 3486.80000 -28450.00 -72330.00 20120314 Lxit 1 3537.50000 -22025.00 -8050.00
20120508 TF-Bol-S 1 3230.90000 0.00 0.00 20120508 TF-Bol-S 1 3271.50000 0.00 0.00
20120817 Sxit 1 3140.30000 4430.00 -67900.00 20120817 Sxit 1 3134.50000 6750.00 -1300.00
20120823 TF-Bol-B 1 3389.70000 0.00 0.00 20120823 TF-Bol-B 1 3314.50000 0.00 0.00
20121102 Lxit 1 3384.20000 -375.00 -68275.00 20121102 Lxit 1 3417.50000 5050.00 3750.00
20121220 TF-Bol-S 1 3257.30000 0.00 0.00 20121220 TF-Bol-S 1 3378.50000 0.00 0.00
20130123 Sxit 1 3542.30000 -14350.00 -82625.00 20130123 Sxit 1 3538.00000 -8075.00 -4325.00
20130219 TF-Bol-S 1 3211.30000 0.00 0.00 20130219 TF-Bol-S 1 3242.00000 0.00 0.00
20130812 Sxit 1 2422.90000 39320.00 -43305.00 20130812 Sxit 1 2421.00000 40950.00 36625.00
20130827 TF-Bol-B 1 2750.30000 0.00 0.00 20130827 TF-Bol-B 1 2743.00000 0.00 0.00
20130918 Lxit 1 2396.30000 -17800.00 -61105.00 20130918 Lxit 1 2409.50000 -16775.00 19850.00
20131202 TF-Bol-S 1 2181.10000 0.00 0.00 20131202 TF-Bol-S 1 2232.50000 0.00 0.00
20140213 Sxit 1 2321.60000 -7125.00 -68230.00 20140213 Sxit 1 2307.00000 -3825.00 16025.00
20140224 TF-Bol-B 1 2487.80000 0.00 0.00 20140224 TF-Bol-B 1 2480.00000 0.00 0.00
20140320 Lxit 1 2280.30000 -10475.00 -78705.00 20140320 Lxit 1 2295.00000 -9350.00 6675.00
20140501 TF-Bol-S 1 2131.80000 0.00 0.00 20140501 TF-Bol-S 1 2138.00000 0.00 0.00
20140619 Sxit 1 2355.80000 -11300.00 -90005.00 20140619 Sxit 1 2253.50000 -5875.00 800.00
20140710 TF-Bol-B 1 2421.80000 0.00 0.00 20140710 TF-Bol-B 1 2390.00000 0.00 0.00
20140805 Lxit 1 2234.80000 -9450.00 -99455.00 20140805 Lxit 1 2261.50000 -6525.00 -5725.00
20140919 TF-Bol-S 1 2029.60000 0.00 0.00 20140919 TF-Bol-S 1 2071.50000 0.00 0.00
20150113 Sxit 1 1966.70000 3045.00 -96410.00 20150113 Sxit 1 1913.00000 7825.00 2100.00
20150120 TF-Bol-B 1 2049.70000 0.00 0.00 20150120 TF-Bol-B 1 2042.50000 0.00 0.00
20150206 Lxit 1 1899.70000 -7600.00 -104010.00 20150206 Lxit 1 1914.00000 -6525.00 -4425.00
20150707 TF-Bol-S 1 1694.80000 0.00 0.00 20150707 TF-Bol-S 1 1763.50000 0.00 0.00
20150918 Sxit 1 1771.60000 -3940.00 -107950.00 20150918 Sxit 1 1760.00000 75.00 -4350.00
20151014 TF-Bol-B 1 1847.60000 0.00 0.00 20151014 TF-Bol-B 1 1838.00000 0.00 0.00
20151104 Lxit 1 1730.60000 -5950.00 -113900.00 20151104 Lxit 1 1739.00000 -5050.00 -9400.00
20160211 TF-Bol-B 1 1824.10000 0.00 0.00 20160211 TF-Bol-B 1 1812.50000 0.00 0.00
20160531 Lxit 1 1808.40000 -885.00 -114785.00 20160531 Lxit 1 1822.00000 375.00 -9025.00
20160624 TF-Bol-B 1 2053.40000 0.00 0.00 20160624 TF-Bol-B 1 2030.50000 0.00 0.00
20160825 Lxit 1 2054.20000 -60.00 -114845.00 20160825 Lxit 1 2056.00000 1175.00 -7850.00
20161006 TF-Bol-S 1 1912.20000 0.00 0.00 20161006 TF-Bol-S 1 1949.50000 0.00 0.00
20161110 Sxit 1 2097.20000 -9350.00 -124195.00 20161110 Sxit 1 2096.50000 -7450.00 -15300.00
20161114 TF-Bol-S 1 1860.20000 0.00 0.00 20161114 TF-Bol-S 1 1890.50000 0.00 0.00
20170123 Sxit 1 1916.70000 -2925.00 -127120.00 20170123 Sxit 1 1915.00000 -1325.00 -16625.00
20170503 TF-Bol-S 1 1814.30000 0.00 0.00 20170503 TF-Bol-S 1 1840.00000 0.00 0.00
20170605 Sxit 1 1937.80000 -6275.00 -133395.00 20170605 Sxit 1 1933.50000 -4775.00 -21400.00
20170705 TF-Bol-S 1 1751.80000 0.00 0.00 20170705 TF-Bol-S 1 1759.00000 0.00 0.00
20170802 Sxit 1 1862.80000 -5650.00 -139045.00 20170802 Sxit 1 1860.00000 -5150.00 -26550.00
20170905 TF-Bol-B 1 1967.70000 0.00 0.00 20170905 TF-Bol-B 1 1950.00000 0.00 0.00
20170921 Lxit 1 1845.20000 -6225.00 -145270.00 20170921 Lxit 1 1855.50000 -4825.00 -31375.00
20171130 TF-Bol-S 1 1783.00000 0.00 0.00 20171130 TF-Bol-S 1 1798.00000 0.00 0.00
20171229 Sxit 1 1866.00000 -4250.00 -149520.00 20171229 Sxit 1 1844.50000 -2425.00 -33800.00
20180613 TF-Bol-B 1 1851.10000 0.00 0.00 20180613 TF-Bol-B 1 1838.00000 0.00 0.00
20180615 Lxit 1 1782.60000 -3525.00 -153045.00 20180615 Lxit 1 1796.00000 -2200.00 -36000.00
20180627 TF-Bol-S 1 1732.30000 0.00 0.00 20180627 TF-Bol-S 1 1746.50000 0.00 0.00
20181102 Sxit 1 1611.40000 5945.00 -147100.00 20181102 Sxit 1 1603.50000 7050.00 -28950.00
20181226 TF-Bol-B 1 1632.10000 0.00 0.00 20181226 TF-Bol-B 1 1606.50000 0.00 0.00
20190301 Lxit 1 1613.10000 -1050.00 -148150.00 20190301 Lxit 1 1624.50000 800.00 -28150.00
20190423 TF-Bol-S 1 1565.80000 0.00 0.00 20190423 TF-Bol-S 1 1575.00000 0.00 0.00
20190614 Sxit 1 1600.30000 -1825.00 -149975.00 20190614 Sxit 1 1597.00000 -1200.00 -29350.00
20190716 TF-Bol-B 1 1653.80000 0.00 0.00 20190716 TF-Bol-B 1 1645.50000 0.00 0.00
20191106 Lxit 1 1802.40000 7330.00 -142645.00 20191106 Lxit 1 1819.00000 8575.00 -20775.00
20191206 TF-Bol-S 1 1709.30000 0.00 0.00 20191206 TF-Bol-S 1 1712.50000 0.00 0.00
20191224 Sxit 1 1838.30000 -6550.00 -149195.00 20191224 Sxit 1 1817.50000 -5350.00 -26125.00
20200108 TF-Bol-B 1 1941.30000 0.00 0.00 20200108 TF-Bol-B 1 1912.00000 0.00 0.00
20200128 Lxit 1 1793.80000 -7475.00 -156670.00 20200128 Lxit 1 1809.00000 -5250.00 -31375.00
20200221 TF-Bol-B 1 1914.30000 0.00 0.00 20200221 TF-Bol-B 1 1906.00000 0.00 0.00
20200227 Lxit 1 1806.50000 -5490.00 -162160.00 20200227 Lxit 1 1811.00000 -4850.00 -36225.00
20200228 TF-Bol-S 1 1683.50000 0.00 0.00 20200228 TF-Bol-S 1 1709.00000 0.00 0.00
20200514 Sxit 1 1654.50000 1350.00 -160810.00 20200514 Sxit 1 1653.50000 2675.00 -33550.00
20200720 TF-Bol-B 1 2048.50000 0.00 0.00 20200720 TF-Bol-B 1 2027.50000 0.00 0.00
20200923 Lxit 1 2272.50000 11100.00 -149710.00 20200923 Lxit 1 2299.50000 13500.00 -20050.00
Well you better get near your Stop levels or what turned out to be a somewhat decent system – not so much.
Take full control of your back-testing with my latest book and TradingSimula-18.
classic
yes