The first time a new currency was posted on the exchange

Author: The grass, Date: 2020-03-31 15:36:12
Tags: StudyTrade-aided

The robot will place pending orders at fixed intervals for the first time on the exchange.

The principle:

Add a trade pair after starting to run, continuously try to access the market, if you can access the market, indicate the start of the trade, the strategy will be hung, do not get enough indicates not open, continue to try again waiting.



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

gg50933064It's too slow! No manual speed! Is there an upgrade?

MAIKEOThank the grass god.