CityIndex API written in Python
This package depends on Python-requests http://www.python-requests.org/
Note: API is a singleton class.
api = API(username, password)
Return True
or False
.
Note: The session token will be stored in api.session
.
api.login()
Return True
or False
api.logout()
Result is stored in api.trading_account_info
Return False
if failed.
api.get_trading_account_info()
Result is stored in api.client_account_margin
Return False
if failed.
api.get_client_account_margin()
Result is stored in api.market_info
Return False
if failed.
Click here for the list of Market Tag ID.
api.get_full_market_info(market_tag_id)
api.get_pricebar_history(symbol, interval, span, pricebars, priceType)
api.simulate_trade_order(symbol, cmd, qty, data)
api.send_market_order(symbol, cmd, qty, data, stoploss=0.0, takeprofit=0.0):
api.modify_order(symbol, order, stoploss=0.0, takeprofit=0.0)
api.close_order(symbol, order, data)
api.get_order_history()
api.get_order(orderID)
api.cross_rate(symbol, cmd, data)