Python trading library for the Rotman Interactive Software.
Project description
RIT-trading-python
Python trading module for the Rotman Interactive Trader trading software. PyPI page.
Installation with pip: pip install ritpytrading
Full documentation available online.
A GitHub markdown flavor documentation can be found at documentation/README.md.
Prerequisites
Python 3.x
The RIT Client only supports Windows OS. However, development of the PyPI ritpytrading package can be in done in Linux/BSD environments as well.
The full documentation for the RIT Client REST API can be found at Swaggerhub. The documentation is also present in a JSON format in the swagger_client_generated folder.
Installing
RIT Client Software
The RIT Client for Windows can be downloaded at http://rit.rotman.utoronto.ca/software.asp.
Instructions for setting up an RIT demonstration client account for the Liability Trading 3 case file can be found at RIT’s website at http://rit.rotman.utoronto.ca/demo.asp.
Virtual environment packages with virtualenv or anaconda should be used for both Windows and Linux/BSD based systems.
Windows
Initialize the repository with git. Detailed instructions to download git for windows can be found at atlassian. The repository can then be initialized with git using:
$ git clone https://github.com/SamSamhuns/RIT-trading-python
Two options are available after this:
Anaconda is recommended for Windows system. Set up up a virtual conda environment first. Then open the anaconda prompt and use the command conda install --yes --file requirements.txt to install all modules from requirements.txt.
Or Install python and add it to your PATH system variable. Then install the pip package if not installed already also adding it to the PATH system variable. Then run the following commands.
$ pip install virtualenv $ virtualenv venv $ .\venv\Scripts\activate $ pip install -r requirements.txt
Note: When using PowerShell in Windows, the virtual environment has to be activated with .\venv\Scripts\activate.ps1
Linux/BSD
After cloning the repository, install the required python packages using pip.
$ git clone https://github.com/SamSamhuns/RIT-trading-python $ pip install virtualenv $ virtualenv venv $ source venv/bin/activate $ pip install -r requirements.txt
Building dists and running tests using makefile
For Windows, different options are available for using makefile. GnuWin’s make provides a native port for Windows (without requiring a full runtime environment like Cygwin). After installing GnuWin, add C:\Program Files (x86)\GnuWin32\bin to your system PATH variable to run makefiles from any directory.
For Windows, run makefile commands with make -f Makefile.win <directive>. Example make -f Makefile.win help
For Linux/BSD, run makefile commands with make <directive>.
Run the following command to get a list of all Makefile command options.
$ make help
To run tests
$ make test $ make test-all
To ensure the README.rst will be rendered in PyPI [might be outdated. Check twine check below]
$ python setup.py check --restructuredtext
To report any problems rendering your README. If your markup renders fine, the command will output Checking distribution FILENAME: Passed. To run the check on sdist and wheel.
$ twine check dist/*
To build the source and wheel package.
$ make dist
Running tests with the python unittest module
Once python has been added to the PATH system variable in Windows, the code for running the scripts on Windows and Linux/BSD based systems are the same.
From the main directory, run:
$ python -m unittest
If no tests are run from the command above, run the verbose mode.
Verbose mode
$ python -m unittest discover -v
Usage (Only on Windows)
IMPORTANT:
The RIT Trading client must also be running to make sure the REST RIT API Client requests can be made.
In each script your RIT Client API key must be entered and the requests module be imported to make API calls.
The API and API Orders mode must be enabled in the RIT Client for the python module to send order requests.
To test out the ritpytrading package, install using pip inside a virtual environment:
$ pip install ritpytrading
Examples scripts are present inside the examples folder. Documentation for usage available here.
Built With
Python 3 - The Programming tool used
Versioning
Version tracked with Git
License
This project is licensed under the Apahce 2.0 License - see the LICENSE.md file for details
Acknowledgments
Rotman School of Manangement, University of Toronto http://www.rotman.utoronto.ca/
Rotman Interactive Trader http://rit.rotman.utoronto.ca/
Python open source libraries
Joel Hasbrouck, NYU Stern Principles of Securities Trading, FINC-UB.0049, Spring 201. http://people.stern.nyu.edu/jhasbrou/
This project directory was created based on Cookiecutter and the audreyr/cookiecutter-pypackage project template.
README conversion for PyPI. Pandoc.org.
Contributions
Disclaimer
All RIT software and external RIT links are provided by the Rotman School of Management and are their exclusive property.
History
0.1.0 (2018-12-14)
First release on PyPI.
0.1.1 (2018-12-15)
Second release on PyPI.
0.1.2 (2018-12-15)
Third release on PyPI with correctly rendering README.
0.1.3 (2019-01-11)
Fourth release with major corrections.
0.1.4 (2019-03-11)
Fifth release with proper rst readme.
0.1.5 (2019-07-11)
Sixth release with full documentation added.
0.1.6 (2020-01-27)
Seventh release with bugs fixed in submit_cancel_orders.py.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ritpytrading-0.1.6.tar.gz
.
File metadata
- Download URL: ritpytrading-0.1.6.tar.gz
- Upload date:
- Size: 127.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73845608e830db320a64e7ebabcd5e77ff7f5a8df8cbc7cce1aa05a6354eccaa |
|
MD5 | 065e7c5b129339137a98810862021b80 |
|
BLAKE2b-256 | 5501166e24b50abd41a3776d4ce7b1c4566c1769bc6a54a83f7ee70b08fcbfa3 |
File details
Details for the file ritpytrading-0.1.6-py2.py3-none-any.whl
.
File metadata
- Download URL: ritpytrading-0.1.6-py2.py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5634ea482158b559a347c4111c35791f52c39f1dcb5e4620ab2f276393e40ed1 |
|
MD5 | 37a1af0e308f4c1144e661fe54dc2a12 |
|
BLAKE2b-256 | 5af68f54be2ac142dc81ed3ea7c7f31d08a2890871ec63c4c6166777507c86e4 |