Loading ...

交易所上新币第一时间挂单机器人

Author: 小草, Date: 2020-03-31 15:36:12
Tags: Study Trade-aided

会按固定间隔摆出挂单,用于交易所上新币第一时间挂单机器人。由于逻辑简单,未测试



function main() {
    exchange.SetTimeout(500) //保证较快的返回null,继续重试获取行情
    while(true){
        var ticker = exchange.GetTicker()
        if(!ticker){
            continue
        }else{
            Log('获取到行情,开始下单')
            for(var i=0;i<N;i++){
               if(Type == 0){
                    exchange.Buy(Start_Price-i*Spread,Amount+i*Amount_Step)
               }else{
                    exchange.Sell(Start_Price+i*Spread,Amount+i*Amount_Step)
               }
            }
            Log('完成挂单,退出程序')
            return
        }
    }
}


Related

More