|
1 |
| -## ccxt plugin for zvt |
| 1 | +[](https://github.com/zvtvz/zvt-ccxt) |
| 2 | +[](https://pypi.org/project/zvt-ccxt/) |
| 3 | +[](https://pypi.org/project/zvt-ccxt/) |
| 4 | +[](https://pypi.org/project/zvt-ccxt/) |
| 5 | +[](https://travis-ci.org/zvtvz/zvt-ccxt) |
| 6 | +[](http://hits.dwyl.io/zvtvz/zvt-ccxt) |
| 7 | + |
| 8 | +## How to use |
| 9 | +### 1.1 install |
| 10 | +``` |
| 11 | +pip install zvt-ccxt |
| 12 | +
|
| 13 | +pip show zvt-ccxt |
| 14 | +``` |
| 15 | + |
| 16 | +make sure use the latest version |
| 17 | +``` |
| 18 | +pip install --upgrade zvt-ccxt |
| 19 | +``` |
| 20 | + |
| 21 | +### 1.2 use in zvt way |
| 22 | +``` |
| 23 | +In [1]: from zvt_ccxt.domain import * |
| 24 | +
|
| 25 | +In [2]: Coin |
| 26 | +Out[2]: zvt_ccxt.domain.coin_meta.Coin |
| 27 | +
|
| 28 | +In [3]: Coin.record_data() |
| 29 | +Coin registered recorders:{'ccxt': <class 'zvt_ccxt.recorders.coin_recorder.CoinMetaRecorder'>} |
| 30 | +
|
| 31 | +2020-07-17 23:26:38,730 INFO MainThread init_markets for binance success |
| 32 | +2020-07-17 23:26:40,941 INFO MainThread init_markets for huobipro success |
| 33 | +In [4]: Coin.query_data() |
| 34 | +Out[4]: |
| 35 | + id entity_id timestamp entity_type exchange code name |
| 36 | +0 coin_binance_BTC/USDT coin_binance_BTC/USDT None coin binance BTC/USDT BTC/USDT |
| 37 | +1 coin_binance_ETH/USDT coin_binance_ETH/USDT None coin binance ETH/USDT ETH/USDT |
| 38 | +2 coin_binance_EOS/USDT coin_binance_EOS/USDT None coin binance EOS/USDT EOS/USDT |
| 39 | +3 coin_huobipro_BTC/USDT coin_huobipro_BTC/USDT None coin huobipro BTC/USDT BTC/USDT |
| 40 | +4 coin_huobipro_ETH/USDT coin_huobipro_ETH/USDT None coin huobipro ETH/USDT ETH/USDT |
| 41 | +5 coin_huobipro_EOS/USDT coin_huobipro_EOS/USDT None coin huobipro EOS/USDT EOS/USDT |
| 42 | +
|
| 43 | +
|
| 44 | +In [2]: Coin1dKdata.record_data() |
| 45 | +In [4]: Coin1dKdata.query_data(codes=['BTC/USDT']) |
| 46 | +Out[4]: |
| 47 | + id entity_id timestamp provider code name level open close high low volume turnover |
| 48 | +0 coin_binance_BTC/USDT_2017-10-22 coin_binance_BTC/USDT 2017-10-22 ccxt BTC/USDT BTC/USDT 1d 6003.27 5950.02 6060.00 5720.03 1362.092216 None |
| 49 | +1 coin_binance_BTC/USDT_2017-10-23 coin_binance_BTC/USDT 2017-10-23 ccxt BTC/USDT BTC/USDT 1d 5975.00 5915.93 6080.00 5621.03 1812.557715 None |
| 50 | +2 coin_binance_BTC/USDT_2017-10-24 coin_binance_BTC/USDT 2017-10-24 ccxt BTC/USDT BTC/USDT 1d 5909.47 5477.03 5925.00 5450.00 2580.418767 None |
| 51 | +3 coin_binance_BTC/USDT_2017-10-25 coin_binance_BTC/USDT 2017-10-25 ccxt BTC/USDT BTC/USDT 1d 5506.92 5689.99 5704.96 5286.98 2282.813205 None |
| 52 | +4 coin_binance_BTC/USDT_2017-10-26 coin_binance_BTC/USDT 2017-10-26 ccxt BTC/USDT BTC/USDT 1d 5670.10 5861.77 5939.99 5650.00 1972.965882 None |
| 53 | +.. ... ... ... ... ... ... ... ... ... ... ... ... ... |
| 54 | +995 coin_binance_BTC/USDT_2020-07-13 coin_binance_BTC/USDT 2020-07-13 ccxt BTC/USDT BTC/USDT 1d 9303.31 9242.62 9343.82 9200.89 42740.069115 None |
| 55 | +996 coin_binance_BTC/USDT_2020-07-14 coin_binance_BTC/USDT 2020-07-14 ccxt BTC/USDT BTC/USDT 1d 9242.61 9255.85 9279.54 9113.00 45772.552509 None |
| 56 | +997 coin_binance_BTC/USDT_2020-07-15 coin_binance_BTC/USDT 2020-07-15 ccxt BTC/USDT BTC/USDT 1d 9255.85 9197.60 9276.49 9160.57 39053.579665 None |
| 57 | +998 coin_binance_BTC/USDT_2020-07-16 coin_binance_BTC/USDT 2020-07-16 ccxt BTC/USDT BTC/USDT 1d 9197.60 9133.72 9226.15 9047.25 43375.571191 None |
| 58 | +999 coin_binance_BTC/USDT_2020-07-17 coin_binance_BTC/USDT 2020-07-17 ccxt BTC/USDT BTC/USDT 1d 9133.72 9157.72 9186.83 9089.81 21075.560207 None |
| 59 | +
|
| 60 | +[1000 rows x 13 columns] |
| 61 | +``` |
| 62 | + |
| 63 | + |
| 64 | +## 💌请作者喝杯咖啡 |
| 65 | + |
| 66 | +如果你觉得项目对你有帮助,可以请作者喝杯咖啡 |
| 67 | +<img src="https://raw.githubusercontent.com/zvtvz/zvt/master/docs/imgs/alipay-cn.png" width="25%" alt="Alipay"> |
| 68 | +<img src="https://raw.githubusercontent.com/zvtvz/zvt/master/docs/imgs/wechat-cn.png" width="25%" alt="Wechat"> |
| 69 | + |
| 70 | +## 🤝联系方式 |
| 71 | + |
| 72 | +个人微信:foolcage 添加暗号:zvt-ccxt |
| 73 | +<img src="https://raw.githubusercontent.com/zvtvz/zvt/master/docs/imgs/wechat.jpeg" width="25%" alt="Wechat"> |
| 74 | + |
| 75 | +------ |
| 76 | +微信公众号: |
| 77 | +<img src="https://raw.githubusercontent.com/zvtvz/zvt/master/docs/imgs/gongzhonghao.jpg" width="25%" alt="Wechat"> |
| 78 | + |
| 79 | +知乎专栏: |
| 80 | +https://zhuanlan.zhihu.com/automoney |
| 81 | + |
| 82 | +## Thanks |
| 83 | +<p><a href=https://www.jetbrains.com/?from=zvt><img src="https://raw.githubusercontent.com/zvtvz/zvt/master/docs/imgs/jetbrains.png" width="25%" alt="jetbrains"></a></p> |
0 commit comments