FilledOrderPrice showing 0 on order filled event

Questions about MultiCharts and user contributed studies.
Fabio
Posts: 1
Joined: 14 Dec 2021

FilledOrderPrice showing 0 on order filled event

Postby Fabio » 31 Jan 2023

Hi,

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;
When the event is triggered I see that both FilledOrderAction and FilledOrderContracts are populated correctly, but FilledOrderPrice is filled correctly only for the first executed order and then it always shows 0.0 for the new orders.
Is it a bug with FilledOrderPrice?

Thanks,
Fabio

User avatar
Svetlana MultiCharts
Posts: 645
Joined: 19 Oct 2017
Has thanked: 3 times
Been thanked: 163 times

Re: FilledOrderPrice showing 0 on order filled event

Postby Svetlana MultiCharts » 01 Feb 2023

Hi Fabio,

We have reproduced the issue on our side. Sorry for inconvenience.
Our engineers will work on improving this behaviour to include the fix in one of the future versions.


Return to “MultiCharts”