How to calculate market slippage?

Created at 20 Jul 2017, 23:13
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!
obaum1@gmail.com's avatar

obaum1@gmail.com

Joined 06.06.2017

How to calculate market slippage?
20 Jul 2017, 23:13


Hey all :)

So I have a ton of problems with my robot but Im working hard and hopefully something good will happen someday..

But something i can't understand is how to calculate market slippage when opening or closing a position?

the problem is that the data I read from the market is not uptodate and because market movements its very hard to open a position in the wanted entryPrice.

How can i strategize a window that if i close or open a position im taking in to account that slippage?
*i tried to add a certain amount of pips when closing a position. EXAMPLE: EURUSD Buy 1.1627 -> so actual buy set to 1.1625. -> but its not giving me the result I want and it feel like a guess and I don't like guessing when im coding :)  
 

 Thanks!!!


@obaum1@gmail.com
Replies

BeardPower
21 Jul 2017, 00:54

Hi,

You can calculate slippage by subtracting the fill price from the entry price, calculate the average slippage and add it as a markup to your next order(s).

Unfortunately, cTrader does not support stop limit orders, so you cannot specify a limit price and it will not protect you from negative slippage.


@BeardPower

Spotware
21 Jul 2017, 09:10

Dear BeardPower,

Thanks for providing the answer to the question. We just wanted to add that Stop Limit orders are now supported in cTrader. Please see the relevant announcement here. Stop Limit orders will be incorporated in cAlgo.API in a future release. In the meanwhile if you want to limit your slippage, you can specify market range in your market orders. Market range for market orders is available in cAlgo.API.

Best Regards,

cTrader Team


@Spotware

juangmez87
11 Feb 2018, 12:55

RE:

Spotware said:

Dear BeardPower,

Thanks for providing the answer to the question. We just wanted to add that Stop Limit orders are now supported in cTrader. Please see the relevant announcement here. Stop Limit orders will be incorporated in cAlgo.API in a future release. In the meanwhile if you want to limit your slippage, you can specify market range in your market orders. Market range for market orders is available in cAlgo.API.

Best Regards,

cTrader Team

 

Hello, And how I can use market Range with a PlaceStopOrder to control de slippage? thank you very much!


@juangmez87

fxwisdom1@gmail.com
29 May 2018, 19:06

I have a feedback for cTrader

 

1. When an order opened, make sure the TARGET ENTRY PRICE is still intact. That way we can calculate the slippage by subtracting the FILL PRICE - TARGET ENTRY PRICE.

In MT4, for example buy stop order at 1.34512 and SL is at 1.34412. stop loss diff is 100 pips

When the order got filled with slippage at 1.35612 and SL is still fixed at 1.34412. stop loss diff is 200

Hence we can calculate the slippage by the stop loss diference. 200-100 which is 100 pips slippage.

 

So an idea to detect slippage on specific order for cTrader/cAlgo

For example buy stop order at 1.35512 and SL 100 pips.

When the order got filled with slippage at 1.34612 and SL is 100 pips in relative to the filled order. <<< This is fine

But you should put another variable into  Positions object.

With that we can calculate the slippage = FILL PRICE - TARGET ENTRY PRICE

1.35512-1.34512 = 100 pips slippage


@fxwisdom1@gmail.com