Hi there, 

I was reading and asking Mia about why in backtesting the order fill price is correct but in live trading is not recovering it. I tried using Binance as my data provider, I tried not using the OnOrderEvent function, but the result if always the same. I backtest works but in Live trading not. I attach part of my code here so you can help me. In FiveMinuteReceiver function I send an order and save the order under a new variable like this: 

self.LongEntryTicket = self.MarketOrder(self.symbol.Symbol, self.quantity, False, 'LONG')

In OnData function I get the fillprice like this:

if self.LongEntryTicket is not None:

                order = self.Transactions.GetOrderById(self.LongEntryTicket.OrderId)

                if order.Status == OrderStatus.Filled:

                        if order.Tag == 'LONG' or order.Tag == 'LONG NEXT':

                                if self.LongFillPrice is None or order.Price < self.LongFillPrice:

                                        self.LongFillPrice = order.Price

Here I establish my stop loss later in the Ondata function (the main issue that I need to solve as Binance doesnt allow StopMarketOrder): 

        if self.LongFillPrice is not  None and self.Portfolio[self.symbol.Symbol].Quantity > 0:

                if self.Securities[self.symbol.Symbol].Price > self.LongFillPrice:

                        self.LongFillPrice = self.Securities[self.symbol.Symbol].Price

                self.BUYorder_sl_price = self.LongFillPrice * (1 - self.slPercent)

           self.Debug('Price: ' + str(self.Securities[self.symbol.Symbol].Price) + ' LONG_SL: ' + str(self.BUYorder_sl_price) )

First of all, this Debug works in Backtest but not in live trading (thats my main evidence)

Later in the Ondata fucntion I execute the stoploss like this:

if self.Portfolio[self.symbol.Symbol].Quantity > 0:

                if self.BUYorder_sl_price != None:

                        if self.Securities[self.symbol.Symbol].Price <= self.BUYorder_sl_price:

                                self.quantity = self.Portfolio[self.symbol.Symbol].Quantity

                                self.MktOrder = self.MarketOrder(self.symbol.Symbol, -self.quantity, False, 'SL LONG')

                                self.BUYorder_sl_price = None

                                self.BUYorder_tp_price = None

                                self.LongFillPrice = None