avatar of gaof05210 gaof05210
집중하다 사신
0
집중하다
0
수행원

시뮬레이션 레벨과 실제 레벨의 백테스트 결과가 다른 이유는 무엇입니까? 설정은 모두 Huobi.com의 BTC_USDT입니다. 전략은 게시물을 참조하세요.

만든 날짜: 2019-08-01 14:54:24, 업데이트 날짜: 2019-08-01 15:19:30
comments   1
hits   1868
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)