Taking spread into account
Author: kkrisz
Creation Date: 10/23/2013 3:08 PM
profile picture

kkrisz

#1
Hello,

I would like to backtest a strategy which I would like to trade using CFD (stocks and commodities) in the real world. As you might know CFDs might have a relatively big spread. As the spread can significantly alter the trading performance (in some extreme cases it can take 1% of the profit away) I would like to take it into account when backtesting the strategy.

Is there any best practice or workaround to work with spreads?

Thanks,
Krisztian
profile picture

Eugene

#2
Haven't tried it myself, but maybe creating a custom commission schedule might work?

Community.Commissions
profile picture

kkrisz

#3
Eugene,

Thanks for the hint. As I understand I can develop a custom commission logic using the library but my problem with this approach is that I do not want to assign a commission as a dollar value to each trade. What I would like is to modify my actual entry and exit prices of the system and add spread to them. For example if my system supposed to buy at 100.00, then the actual execution should be 100.15 in case my spread is 0.15.

I tried to implement this logic using the slippage configuration but it did not work consistently. I configured 15 ticks of slippage (for futures) but the actual entry and exit price difference was not 15 ticks in every case. Do I misunderstand here the way slippage supposed to work?

Krisztian
profile picture

Eugene

#4
Slippage might work to simulate spread. For more information on how slippage works (and when it does not apply), see the User Guide: Preferences > Slippage & Round Lots. If you have a specific case where slippage didn't work consistently, we'll explain it.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).