The actual command "GetAccountValue" doesn't give the actual realized PnL as soon as the trade is closed, instead gives the info that doesn't include the last trade until a new bar begins. Technically, is not an easy task trying to program a snippet that can overcome that lack of real info.
Please consider modifying the command "GetAccountValue" that can actually gives really the actual realized PnL account that includes the last trade closed as soon as it's filled
Thanks
Comment