Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. for (1) {
  2. check_buy_order(function(exist){
  3. if (!exist) {
  4. get_currenct_orderbook(function(orderbook){
  5. get_current_balance(function(balance) {
  6. // 根据设置判断是否下订单
  7. if (need_order) {
  8. make_order(function(result){
  9. // 根据下订单的结果进行后续的操作
  10. })
  11. }
  12. })
  13. })
  14. } else {
  15. get_currenct_orderbook(function(orderbook){
  16. // 根据设置判断是否取消订单
  17. if (need_cancel) {
  18. cancel_order(function(result){
  19. // 取消订单后的一些其他的处理操作
  20. })
  21. }
  22. })
  23. }
  24. });
  25.  
  26. check_sell_order(function(exist){
  27. if (!exist) {
  28. get_currenct_orderbook(function(orderbook){
  29. get_current_balance(function(balance) {
  30. // 根据设置判断是否下订单
  31. if (need_order) {
  32. make_order(function(result){
  33. // 根据下订单的结果进行后续的操作
  34. })
  35. }
  36. })
  37. })
  38. } else {
  39. get_currenct_orderbook(function(orderbook){
  40. // 根据设置判断是否取消订单
  41. if (need_cancel) {
  42. cancel_order(function(result){
  43. // 取消订单后的一些其他的处理操作
  44. })
  45. }
  46. })
  47. }
  48. });
  49. sleep(x)
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement