Library for working with OptionsCity Software's City Trader REST API
Project description
Prerequisites:
[Python 2.7 or greater](https://www.python.org/downloads/release/python-2710/)
[Python setuptools](https://pypi.python.org/pypi/setuptools)
A City Trader Username and Password
A City Trader API client_id and client_secret
Examples:
1. Initialize client and retrieve new token from citytrader.request_client import RequestClient rc = RequestClient(server=”https://devservices.optionshop.com”, client_id=”<client_id>”, client_secret=”<client_secret>”, username=”<username>”, password=”<password>”)
2. Retrieve all orders all_orders = rc.request(request_type=”GET”, url=”orders”)
3. Retrieve single order single_order = rc.request(request_type=”GET”, url=”orders/<order_id>”)
4. Retrieve all product groups all_productgroups = rc.request(request_type=”GET”, url=”productgroups”)
5. Retrieve all instruments all_instruments = rc.request(request_type=”GET”, url=”instruments”)
6. Retrieve market data for a single instrument md_message = rc.request(request_type=”GET”, url=”marketdata?instrument_ids=<instrument_id>”)
7. Retrieve market data for multiple instruments md_messages = rc.request(request_type=”GET”, url=”marketdata?instrument_ids=<instrument_id_1>&instrument_ids=<instrument_id_2>”)
8. Retrieve market data for just Last and High prices md_messages_just_last_and_high = rc.request(request_type=”GET”, url=”marketdata?instrument_ids=<instrument_id_1>&instrument_ids=<instrument_id_2>&sides=Last&sides=High”)
9. Submit a day limit order order_results = rc.request(request_type=”POST”, url=”orderactions”, data={“acct_id”: <account_id>, “action_type”: “LimitOrderSub”, “instrument_id”: <instrument_id>, “limit_price”: <limit_price>, “quantity”: <quantity>, “side”: <side>, “time_in_force”: “Day”})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for CityTraderPythonLib-0.1-py2.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | c47ccebb205a0f0394bff818fe860c26ff10fac3969ff0d5720e4852baa71e73 |
|
MD5 | f4e44547199d5191ed5a1f8c307ec06a |
|
BLAKE2b-256 | 5f2b1e1f2961ef80d8729f9f79e05f383c0eaaee47902907a54dc46d7715989d |