ig rest trading api客户端
ig-rest-client的Python项目详细描述
ig rest trading api客户端
连接到IGrest交易api的小型python库(更多信息和api参考可在IG Labs网站上获得)。
安装
使用最新版本:
pip install ig-rest-client
使用当前主分支:
pip install git+https://github.com/wjszlachta/ig-rest-client.git
用法
对于演示帐户:
fromig_rest_clientimportIgRestSessionapi_key='...'account_id='...'rest_api_username='...'rest_api_password='...'session=IgRestSession(api_key,account_id,rest_api_username,rest_api_password)print(session.session_details())session.log_out()
对于实时帐户:
fromig_rest_clientimportIgRestSession,IG_REST_TRADING_API_LIVE_URLapi_key='...'account_id='...'rest_api_username='...'rest_api_password='...'session=IgRestSession(api_key,account_id,rest_api_username,rest_api_password,rest_api_url=IG_REST_TRADING_API_LIVE_URL)print(session.session_details())session.log_out()