Slippage

Created at 03 Mar 2025, 13:20
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
JO

josephp13rcy

Joined 22.01.2025

Slippage
03 Mar 2025, 13:20


Hello, can someone please let me know if slippage is being taken into consideration when backtesting? I have my logic running within OnBar(), I originally started coding in a slippage generator to then add to my entry on market orders but noticed this cannot be applied to the execute function, so assume it would have to be within print(). This is all assumptions though as I don't know if the slippage is already taken into consideration on historical data? 

Thank you


@josephp13rcy
Replies

firemyst
11 Mar 2025, 01:24

How can it be taken into account?

Backtesting won't move at the same speed as the markets. In real live environments, you have network issues, server load, and other miscellaneous things that happen that aren't present and/or can't be replicated in backtesting.


@firemyst

josephp13rcy
11 Mar 2025, 07:14 ( Updated at: 11 Mar 2025, 07:21 )

RE: Slippage

firemyst said: 

How can it be taken into account?

Backtesting won't move at the same speed as the markets. In real live environments, you have network issues, server load, and other miscellaneous things that happen that aren't present and/or can't be replicated in backtesting.

Broker data could include some form of average slippage. 


@josephp13rcy