tqsdk.account - 账户类

class tqsdk.account.TqAccount(broker_id: str, account_id: str, password: str, front_broker: Optional[str] = None, front_url: Optional[str] = None, td_url: Optional[str] = None, account_type: str = 'FUTURE')

天勤实盘类

创建天勤实盘实例

Args:

broker_id (str): 期货公司,支持的期货公司列表 https://www.shinnytech.com/blog/tq-support-broker/

account_id (str): 帐号

password (str): 密码

front_broker(str): [可选]CTP交易前置的Broker ID, 用于连接次席服务器, eg: "2020"

front_url(str): [可选]CTP交易前置地址, 用于连接次席服务器, eg: "tcp://1.2.3.4:1234/"

td_url(str): [可选]用于指定账户连接的交易服务器地址, eg: "tcp://1.2.3.4:1234/"

account_type(str): [可选]用于指定账户类型
  • FUTURE [默认]: 期货账户

  • SPOT: 股票现货账户

class tqsdk.account.TqKq(td_url: Optional[str] = None)

创建快期模拟账户实例