
Hi I sent a market order with 1% stop loss condition like below.
def on_marketdatafeed(self, md, ab): order = AlgoAPIUtil.OrderObject( instrument = md.instrument, trailingstop = 0.01, openclose = 'open', buysell = 1, #1=buy, -1=sell ordertype = 0, #0=market, 1=limit, 2=stop volume = 0.01 ) self.evt.sendOrder(order)
From the console log, I see that it can successfully open an order. However, the order with the same trade ID is immediately closed at the same timestamp which lead to an immediate loss. Anyone know what is the problem?