- वर्ग
- गुओजियान_प्रथम
गुओजियान_प्रथम
लेखक:
लियुगुओजियन, दिनांक: 2018-08-28 20:03:50
टैगः
औजार
/*backtest
start: 2018-08-27 00:00:00
end: 2018-08-28 20:00:00
period: 1m
exchanges: [{"eid":"Huobi","currency":"LTC_BTC"}]
*/
function main() {
Log(max);
Log(min);
var a = 1;
while(true){
Log(exchange.GetAccount());
var ticker = exchange.GetTicker();
Log(ticker);
if(ticker.High >= max){
//Log("当前最高价"+ticker.High);
//Log("将所有USDT换成BTC");
Log("卖出1");
exchange.Sell(-1, 1);
Log(exchange.GetAccount());
}
if(ticker.Low <= min){
Log("买入1");
exchange.Buy(-1, 1);
Log(exchange.GetAccount());
break;
}
a++;
Sleep(60000); // 一分钟
}
}
function onexit(){
Log("onexit");
}
function onerror(){
Log("onerror");
}
function init(){
Log("init");
}
संबंधित
अधिक