Loading ...

超频30秒玩玩乐

Author: jcinedc, Date: 2021-08-20 18:24:27
Tags:


def main():
    import random
    time_mm = []
    while True:
        exchange.SetContractType("swap")
        exchange.SetMarginLevel(10)
        ticker = _C(exchange.GetTicker)
        account = _C(exchange.GetAccount)
        position = exchange.GetPosition()
        r = _C(exchange.GetRecords, PERIOD_M1)
        _CDelay(2000)

        num = random.randint(0,1)
        if num == 0:
            exchange.SetDirection("sell")
            exchange.Sell(-1, aa,"随机做空")
            Sleep(1000*time)
            exchange.SetDirection("closesell")
            exchange.Buy(-1, aa)
        elif num == 1:
            exchange.SetDirection("buy")
            exchange.Buy(-1, aa,"随机做多")
            Sleep(1000*time)
            exchange.SetDirection("closebuy")
            exchange.Sell(-1, aa)
    Sleep(1000)


More

clhyxa 打给我也行

种根葱 直接把钱打给交易所多好?还费这劲写代码