Skip to content

Instantly share code, notes, and snippets.

@ety001
Created July 9, 2019 12:25
Show Gist options
  • Select an option

  • Save ety001/c5ebda464f750a6a32e4f83998e321cc to your computer and use it in GitHub Desktop.

Select an option

Save ety001/c5ebda464f750a6a32e4f83998e321cc to your computer and use it in GitHub Desktop.
for (1) {
check_buy_order(function(exist){
if (!exist) {
get_currenct_orderbook(function(orderbook){
get_current_balance(function(balance) {
// 根据设置判断是否下订单
if (need_order) {
make_order(function(result){
// 根据下订单的结果进行后续的操作
})
}
})
})
} else {
get_currenct_orderbook(function(orderbook){
// 根据设置判断是否取消订单
if (need_cancel) {
cancel_order(function(result){
// 取消订单后的一些其他的处理操作
})
}
})
}
});
check_sell_order(function(exist){
if (!exist) {
get_currenct_orderbook(function(orderbook){
get_current_balance(function(balance) {
// 根据设置判断是否下订单
if (need_order) {
make_order(function(result){
// 根据下订单的结果进行后续的操作
})
}
})
})
} else {
get_currenct_orderbook(function(orderbook){
// 根据设置判断是否取消订单
if (need_cancel) {
cancel_order(function(result){
// 取消订单后的一些其他的处理操作
})
}
})
}
});
sleep(x)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment