From 6d2ea15858c6776112da424a2d1700ac18694c78 Mon Sep 17 00:00:00 2001 From: yu miao Date: Sat, 10 Mar 2018 10:34:57 +0800 Subject: [PATCH] ... --- .idea/hb.iml | 2 +- .idea/misc.xml | 2 +- .idea/vcs.xml | 6 +++++ analysis.py | 9 +++++-- ...4\346\230\223\350\256\276\350\256\241.txt" | 24 +++++++++++++++++++ 5 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 .idea/vcs.xml create mode 100644 "\350\207\252\345\212\250\344\272\244\346\230\223\350\256\276\350\256\241.txt" diff --git a/.idea/hb.iml b/.idea/hb.iml index 20b5050..8bcac88 100644 --- a/.idea/hb.iml +++ b/.idea/hb.iml @@ -2,7 +2,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 4eb320b..b98fdde 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/analysis.py b/analysis.py index 16b1c98..d10df72 100644 --- a/analysis.py +++ b/analysis.py @@ -54,7 +54,7 @@ def show_analysis_table(kline_list, hour, t): return out -def get_symbol_analysis(symbol, probability): +def get_symbol_analysis(symbol, probability, show_detail=False): kline_list = get_kline_ex(symbol,"60min",2000) # 分析 max_income = 0 @@ -65,7 +65,8 @@ def get_symbol_analysis(symbol, probability): if out["income"] > max_income and out["scale"] > probability: max_income = out["income"] max_out = out - # print(out) + if show_detail: + print(out) print(symbol + " max_out: ") print(max_out) @@ -82,3 +83,7 @@ def get_symbol_analysis(symbol, probability): pass else: pass + +''' +get_symbol_analysis('payeth', 0.9, True) +''' diff --git "a/\350\207\252\345\212\250\344\272\244\346\230\223\350\256\276\350\256\241.txt" "b/\350\207\252\345\212\250\344\272\244\346\230\223\350\256\276\350\256\241.txt" new file mode 100644 index 0000000..be15007 --- /dev/null +++ "b/\350\207\252\345\212\250\344\272\244\346\230\223\350\256\276\350\256\241.txt" @@ -0,0 +1,24 @@ +symbol, amount, exec_time, buy_order_id,sell_order_id, price,status,t + + +1 -> 挂单 time + 30s + + 查询现有数量 now_amount + + 到达给定时间(exec_time)30秒后,获取最后一小时交易品种(symbol)K线开盘价作为开盘价(price),用给定数量(amount)- 现有数量(now_amount) 价格挂单,挂单成功后保存订单id(order_id)和买入价格(price),状态(status)变为挂单 + + +2 -> 挂卖单 time + 1h + 10m + 给定时间1小时10分钟后,查询卖出数量(当前账户品种数量), 用买入价格(price)* 盈利(t)作为买车价格挂单 + + + + +特殊情况处理 + +A -> 给定时间一小时后没成交取消买单 time + 1h + 给定时间1小时后用订单id(order_id)取消挂单 + + +B -> 给定时间23:50后 卖单没有完全成交撤单 () +