Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
cmic2019 committed Mar 10, 2018
1 parent 2a21b40 commit 6d2ea15
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .idea/hb.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -82,3 +83,7 @@ def get_symbol_analysis(symbol, probability):
pass
else:
pass

'''
get_symbol_analysis('payeth', 0.9, True)
'''
24 changes: 24 additions & 0 deletions 自动交易设计.txt
Original file line number Diff line number Diff line change
@@ -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后 卖单没有完全成交撤单 ()

0 comments on commit 6d2ea15

Please sign in to comment.