emtl¶
- emtl.cancel_order(order_str: str)[source]¶
取消交易接口.
- Parameters:
order_str (str) – 订单字符串, 由成交日期+成交编号组成. 在create_order和query_order接口, Wtrq的值是成交日期, Wtbh的值是成交编号, 格式为: 20240520_130662
- emtl.create_order(stock_code, trade_type, market: str, price: float, amount: int)[source]¶
交易接口, 买入或卖出.
- Parameters:
stock_code (str) – 股票代码
trade_type (str) – 交易方向,B for buy, S for sell
market (str) – 股票市场,HA 上海, SA
price (float) – 股票价格
amount (int) – 买入/卖出数量
- emtl.login(username: str = '', password: str = '', duration: int = 30) str | None [source]¶
登录接口.
- Parameters:
username (str) – 用户名
password (str) – 密码(明文)
duration (int, optional) – 在线时长(分钟), defaults to 30
- Returns:
- emtl.query_funds_flow(size, start_time, end_time)[source]¶
查询资金.
- Parameters:
size (int) – 请求的数据的条目数
start_time (str) – 起始时间, 格式”%Y-%m-%d”
end_time (str) – 起始时间, 格式”%Y-%m-%d”
- Return dict:
- emtl.query_history_orders(size, start_time, end_time)[source]¶
查询历史订单.
- Parameters:
size (int) – 请求的数据的条目数
start_time (str) – 起始时间, 格式”%Y-%m-%d”
end_time (str) – 起始时间, 格式”%Y-%m-%d”
- Return dict: