Hi,
I'm trying to test my strategy and have some problems with slippage...
I submit orders using the following code...
String label = ...
double amount = ...
double price = ...
double stopLossPrice = ...
double takeProfitPrice = ...
double slippage = 5;
engine.submitOrder(label, instrument, IEngine.OrderCommand.BUY, amount, price, slippage, stopLossPrice, takeProfitPrice);
and see following messages...
17:47:04 Wed Jan 05 23:59:44 UTC 2011 - placed order: BUY 0.001 @ 1.3329
17:47:04 Wed Jan 05 23:59:44 UTC 2011 - [ORDER_SUBMIT_OK] Order B_4_20110427174704 submitted - openPrice: 1.3329; takeProfit: 1.3339; stopLoss: 1.3299
17:47:04 Wed Jan 05 23:59:44 UTC 2011 - [ORDER_FILL_OK] Order B_4_20110427174704 filled at: 1.3157
17:47:04 Wed Jan 05 23:59:44 UTC 2011 - [ORDER_CLOSE_OK] Order B_4_20110427174704 closed at: 1.3156
so the order was submitted with the price equal to 1.3329 and slippage equal to 5 (in pips), but was filled at 1.3157 which is really far away from what it should be. Changing the slippage value to 0 makes absolutely no difference.
Could you please explain me why does this happen and how can I fix it.
best regards,
genga