READ-ONLY

The forum is now a read-only archive.

For bug reports & platform questions → [email protected]

Our community lives on Discord and YouTube — come join us!

Spreads and Slippage For Different CFD’s and Testing for Robustness.

4 replies

TONY DAVIS

Subscriber, bbp_participant, customer, community, sq-ultimate, 6 replies.

Visit profile

3 years ago #280693

Hi all I have some questions regarding spreads and slippage for asset classes other than Forex Pairs.

For example I have a robustness test where I use the MonteCarlo Slippage test from 0-5pips as one robustness test and another that varies the spread from say 0-10 pips depending on the forex pair I’m testing. I’ve found this to be a great test to filter out the poor strategies that cant handle large slippage and spreads.

I’ve been running into issues when developing strategies on XAUUSD and BTCUSD CDF’s on Dukascopy data. For example golds default spread on Duka’s is 60pips. Does anyone know what the average slippage in pips expected on execution? Should I use a multiple of the default spread, say 160pips(2x default spread) slippage or is this to much? Is there a resource where I can find estimated slippage values online for each CFD or does anyone have some input into what values I should use?

I have the same issue with Bitcoin CFD’s as its spread is 150pips default and slippage on 1-10 pips make no affect at all to backtests really.

Thanks in advance.

Tony.

0

Massimo Scapini

Subscriber, bbp_participant, customer, community, sq-ultimate, 62 replies.

Visit profile

3 years ago #280748

I personally use the following idea: in a live scenario slippage should not be bigger than the 1Min price range (Max – Min), with a few exceptions.

Following this idea I have calculated the average and the std deviation of the price range (1 year of 1 Min data downloaded from Dukas). See attached table.

I then use the following formula for the MC test:

Max slippage = Multiplier * (Avg(Max-Min) + 2 * Std Dev(Max-Min))

2*Std Dev covers 95% of the possible price ranges, assuming a Gaussian Distribution

Multipliers is used to tune the test “aggressivsness”. I normally use 50% (which is normally equivalent to put slippage in the range of 2x – 3x Spread), but I increase/decrease it on the basis of the % of strategies that are discarded by the test.

Personally, I believe the a more accurate test should add a random slippage to each trade instead of changing it on each MC run, but I do agree that it is a good way to test a strategy robustness.

I hope this can help

NB. The method can be also be made more precise calculating the True Range instead of the simple Min-Max, but I preferred to keep things simple

 

Attachments:
You must be logged in to view attached files.

1

TONY DAVIS

Subscriber, bbp_participant, customer, community, sq-ultimate, 6 replies.

Visit profile

3 years ago #280840

Massimo thanks very much for your helpful input.

I’m interested in how you calculate the standard deviation of spread and the average 1minute range. Is this done through SQX or are you using some other software?

I’d like to carry out some tests of my own using this method on other pairs you don’t have in your list.

0

Massimo Scapini

Subscriber, bbp_participant, customer, community, sq-ultimate, 62 replies.

Visit profile

3 years ago #280842

Calculating the 1M range is easy. Just download the period you want (I use 1 Yr) of Dukascopy 1Min data using Sqx Data Manager, load them into excel and calculate the average and the standard dev of (max – min) of each bar.

I take the chanche to suggest a similar method to estimate the ATR multipliers if you use volatility based stop losses and profit targets. In this case you should download and calculate on the same Timeframes you use to trade.

For spreads you have instead to use your broker data. If your broker publishes the average spread use that for the standard tests and use a multiplier of the standard for the MC simulation (I use 2). My broker does not publish the average any more so for the standard I take the target they publish and multiply it by 1.5.

To be more precise, you should get tick data from your broker (which I plan to do sooner or later). To do so, you can find simple EAs on the Web (if you use Metatrader, you can find an example attached)

I wish you a high profit factor!

Attachments:
You must be logged in to view attached files.

1

Massimo Scapini

Subscriber, bbp_participant, customer, community, sq-ultimate, 62 replies.

Visit profile

1 year ago #288509

I have made the previous exercise more precise downloading tick data from MT5 instead of using M1 data.

Using 1 Year (or more) data is impossible through Excel (it can be several millions of rows !), so I have written a simple gawk script that you can run also in Windows enviroment if you download the program (it is not Windows native).

Es:

gawk -f CalculateSpreadAndSlippage.txt -v TickSize=0.01 Palladium.csv

You get

================= Palladium.csv ==================
80 Days 624455/624375 Spread/Slippage Ticks Analyzed

Min Spread : 0.750000 75.0 Pips
Average Spread : 2.057152 205.7 Pips
Sigma Spread : 0.463115 46.3 Pips

Min Slippage : 0.000000 0.0 Pips
Average Slippage : 0.270144 27.0 Pips
Sigma Slippage : 0.273029 27.3 Pips

You can use this data for simulations and MC Robustness Testing.

E.g.

  • Use 205 for Spread and 27 for Slippage in Builder
  • Use  from 75 to 343 for Spread MC simulations (from min to avg  + 3 * Sigma)
  • Use  from 0 to 108 for Slippage MC simulations (from min to avg  + 3 * Sigma)

 

 

Attachments:
You must be logged in to view attached files.

1

Viewing 4 replies - 1 through 4 (of 4 total)