Skip to content

lgimyuen/Python-CityIndex-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python CityIndex API

Introduction

CityIndex API written in Python

Dependency

This package depends on Python-requests http://www.python-requests.org/

Usage

Note: API is a singleton class.

Init

api = API(username, password)

Authentication

Login

Return True or False. Note: The session token will be stored in api.session.

api.login()

Logout

Return True or False

api.logout()

Account Information

Trading Account Information

Result is stored in api.trading_account_info Return False if failed.

api.get_trading_account_info()

Margin

Get Margin Information

Result is stored in api.client_account_margin Return False if failed.

api.get_client_account_margin()

Market Information

Get Full Market Information

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)

Prices

Price bar history

api.get_pricebar_history(symbol, interval, span, pricebars, priceType)

Trades and orders

Simulate Trade Order

api.simulate_trade_order(symbol, cmd, qty, data)

Place Market Order

api.send_market_order(symbol, cmd, qty, data, stoploss=0.0, takeprofit=0.0):

Modify Order

api.modify_order(symbol, order, stoploss=0.0, takeprofit=0.0)

Close Order

api.close_order(symbol, order, data)

Get Order History

api.get_order_history()

Get Order

api.get_order(orderID)

Cross Rate

api.cross_rate(symbol, cmd, data)

About

CityIndex API written in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages