Tại sao các kết quả kiểm tra lại ở cấp độ tương tự và thực không giống nhau, được thiết lập là BTC_USDT của TokenNet, chiến lược xem bài đăng

Tác giả:gaof05210, Tạo: 2019-08-01 14:54:24, Cập nhật: 2019-08-01 15:19:30

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)

Thêm nữa

Giấc mơ nhỏBạn có thể xem bài viết này: https://www.fmz.com/bbs-topic/662 Kiểm tra lại ở mức độ thực và Kiểm tra lại ở mức độ giả lập khác nhau.