After making some tests with 2 different strategies where happens this situation in the most recent bar, with firstly 1 trade exit and secondly 1 trade entry in the Open and exit in the Close, then the platform show the same situation in both cases, where the list of trades seems to be ok except for the last trade that is shown with the opposite direction in Strategy Performance / Trades ($) section. So, to see this situation you could just test with a sample strategy that has an exit and an entry exactly in the last bar, a strategy like a SMA crossover where in the last bar there is a trade exit then immediately there is a new trade entry, with everything in a default and very simple way: market orders, all orders in OnBarUpdate(), no stop-losses because an exit is met when an entry is also met.
Other details are that the 2 strategies tested don’t contain any specific conditions in the codes about some action in the most recent bar in the chart, and the last trade is being closed possibly by a default platform action when all the loaded data is historical and there are no more new bars on the right side.
Other way to confirm this problem was by going to the Strategy Performance / Orders ($) section, where as you can see in the pictures, it seems to show the last trade in the correct way, but at the same time the Strategy Performance / Trades ($) section shows the last trade in the opposite way, taking the most recent bar Close as the entry price and the most recent bar Open as the exit price (opposite).
One of the most relevant problems seen with this situation is that even when the chart and the Strategy Performance / Orders ($) section, both show the correct information about the last trade, then the Strategy Performance / Summary ($) section show the information and the statistics considering that last trade in the opposite way, i.e. adding the last trade in the picture to the short trades list when that trade is in fact a long trade, so, being the summary information inaccurate: net profit, profit factor, number of trades, etc.
Please see the details in the 2 attached pictures and thank you for the support about this.

Comment