Hello,I'm trying to have my code execute a trade with a stop trailing loss but no initial stop loss. For this I submit a ticket with 0 Price and update this ticket later when price is above the current one.self.MarketOrder(symbol, self.quantity[symbol], False, str(self.Securities[symbol].Price)) self.stopMarketTicket = self.StopMarketOrder(symbol, 0 - self.quantity[symbol], 0 * self.Securities[symbol].Close, str(self.Securities[symbol].Price))

In Backtesting, I am getting some orders filled with 0 USD on the FillPrice, selling the asset before the intended (It's selling at current price rather than 0 but still comes as a loss)

2020-11-09 08:00:00 :    Time: 11/09/2020 13:00:00 OrderID: 638 EventID: 2 Symbol: BTCUSD Status: Filled Quantity: -0.00360321 FillQuantity: -0.00360321 FillPrice: 0 USD StopPrice: 0 OrderFee: 0.1122399915 USD

Doesn't matter which value I put on the StopPrice, It keeps getting triggred.Maybe there is abetter way to approach the problem. Thank you. 

 

 

Author