def CancelPendingOrders():
orders = _C(exchange.GetOrders)
Log(len(orders))
for order in orders:
exchange.CancelOrder(order.Id,order)
def onTick():
depth = _C(exchange.GetDepth)
askprice = depth.Asks[0].Price-0.01
bidprice = depth.Bids[0].Price+0.01
if bidprice<askprice:
bidprice = askprice+0.01
CancelPendingOrders()
exchange.Sell(askprice,30)
exchange.Buy(bidprice,30)
def main():
while (true):
onTick()
Sleep(2000)
Inventor quantificado - sonho pequenoO post pode ser lido aqui: https://www.fmz.com/bbs-topic/662 O mecanismo de reavaliação do nível de disco real é diferente do reavaliação do nível analógico.