Created
July 9, 2019 12:25
-
-
Save ety001/c5ebda464f750a6a32e4f83998e321cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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