You will need the following to successfully execute the recipes in this chapter:
- Python 3.7+
- The pyalgotrading Python package ($ pip install pyalgotrading)
The latest Jupyter notebook for this chapter can be found on GitHub at https://github.com/PacktPublishing/Python-Algorithmic-Trading-Cookbook.
The following code will help you set up the broker connection with Zerodha, which will be used in all the recipes in this chapter. Please make sure you have followed these steps before trying out any recipes.
The first thing needed for setting up connectivity with the broker is getting the API keys. The broker would provide unique keys to each customer, typically as an api-key and api-secret key pair. These API keys are chargeable, usually on a monthly subscription basis. You need to get your copy of api-key and api-secret from the broker website before starting this. You can refer to Appendix I for more details.
Execute the following steps:
- Import the necessary modules...