Binance_interface APP 币本位合约行情-历史K线
量化交易研究群(VX) = py_ted
1. APP 币本位合约行情-历史K线函数总览
方法 |
解释 |
get_history_candle |
获取产品的历史K线数据 |
get_history_candle_latest |
获取产品指定数量的最新历史K线数据 |
get_history_candle_by_date |
获取产品指定日期的历史K线数据 |
get_history_candle_latest_ts |
获取历史K线数据中最新的毫秒时间戳 |
update_history_candle |
更新产品历史K线数据到指定时间 |
candle_to_df |
将Binance的candle转化为DataFrame |
2. 模型实例化
from binance_interface.app import BinanceCM
from binance_interface.app.utils import eprint
import paux.date
proxy_host = None
key = 'xxxx'
secret = 'xxxx'
binanceCM = BinanceCM(
key=key,
secret=secret,
proxy_host=proxy_host,
timezone='Asia/Shanghai',
)
market = binanceCM.market
3. 获取产品的历史K线数据 get_history_candle
candle_result = market.get_history_candle(
symbol='BTCUSD_PERP',
start='2023-01-01 00:00:00',
end='2023-01-01 23:59:00',
bar='1m',
)
eprint(