30 Star 60 Fork 28

feiwang / TensorFlow-Bitcoin-Robot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
get_trades.py 627 Bytes
一键复制 编辑 原始数据 按行查看 历史
feiwang 提交于 2017-08-17 17:27 . init
#coding:utf-8
import json
import requests
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
def get_trades():
re=requests.get('https://api.btctrade.com/api/trades?coin=btc')
content=re.content
trades=json.loads(content)
date=[]
price=[]
amount=[]
for trade in trades:
date.append(trade['date'])
price.append(trade['price'])
amount.append(trade['amount'])
return date,price,amount
def main():
date,price,amount =get_trades()
print(len(price))
plt.figure()
plt.plot(date, price)
plt.show()
if __name__ == '__main__':
main()
Python
1
https://gitee.com/fendouai/TensorFlow-Bitcoin-Robot.git
git@gitee.com:fendouai/TensorFlow-Bitcoin-Robot.git
fendouai
TensorFlow-Bitcoin-Robot
TensorFlow-Bitcoin-Robot
master

搜索帮助