I am trying to build a signal which tracks slippage (difference between the order price registered in the strategy and the order price executed at the broker).
This is a partial version of the code where I get a problem:
Code: Select all
Vars: strategy_name(""), side(""), price(""), lots(""), print_line("");
If getappinfo(Aicalcreason) = calcreason_orderfilled and LastBarOnChart then
Begin
strategy_name = strategy_name + " ";
If FilledOrderAction = 1 then side = "Buy " else side = "Sell ";
price = NumToStr(FilledOrderPrice, 2) + " ";
lots = NumToStr(FilledOrderContracts, 2) + " ";
End;
Is it a bug with FilledOrderPrice?
Thanks,
Fabio