PDA

View Full Version : How do I test for slippage?


bwiemers
29th December 2003, 09:20 AM
I'm currently testing my system and would like to know what the best way is to test for slippage?

I've tested against all of the position types (Default, Limit, Market and worst case).

Does anybody know if there is a better way to test for slippage against my system so that I can further stress test it to ensure that it is robust enough to use?

Regards

Bernie

Jose
29th December 2003, 02:59 PM
Hi Bernie,

The way I usually apply slippage is at the MetaStock end, in the TradeSim MS exploration.

In the example below, I introduce 2% slippage to my entries/exits on Open for a total of 4% slippage.

---8<--------------------

{EntryTrigger/ExitTrigger code...}

Slippage:=2; {Slippage %}
EntryPrice:=OPEN*(1+Slippage/100);
EntryPrice:=If(EntryPrice>H,H,EntryPrice);
ExitPrice:=OPEN*(1-Slippage/100);
ExitPrice:=If(ExitPrice<L,L,ExitPrice);

{TradeSim.Initialize, etc...}

---8<--------------------


In the example below, I introduce 1% slippage to my entries/exits when price hits a stop - previous day's High/Low in this case - for a total of 2% slippage.

---8<--------------------

{EntryTrigger/ExitTrigger code...}

Slippage:=1; {Slippage %}

EntryPrice:=
If(H>Ref(H,-1),Ref(H,-1)*(1+Slippage/100),H);
EntryPrice:=If(EntryPrice>H,H,EntryPrice);
ExitPrice:= If(L<Ref(L,-1),Ref(L,-1)*(1-Slippage/100),L);
ExitPrice:=If(ExitPrice<L,L,ExitPrice);

{TradeSim.Initialize, etc...}

---8<--------------------


Regards,
jose

bwiemers
1st January 2004, 04:19 AM
Hi Jose,

Thanks for posting a solution to my problem regarding slippage.

It has certainly helped.

Bernie