- This repository contains codes for fetching historical stock market data for Cash Market and F&O segment using Breeze Connect API.
- It also contains codes for backtesting pre defined option strategies, and this code has also been published as a PyPI library at https://pypi.org/project/AlgoAshutosh/0.0.1/#description
- The repository contains codes for automatically placing orders with the broker according to the defined strategy.
1. Setup virtual environment for fetching historical stock market data / placing orders with broker :-
You must install the virtualenv package via pip
pip install virtualenv
You should create breeze virtual environment via virtualenv
virtualenv -p python3 breeze_venv
And then, You can activate virtual environment via source
source breeze_venv/bin/activate
Installing the client
pip install --upgrade breeze-connect
Or, You can also install the specific release version via pip
pip install breeze-connect==1.0.13
2. Setup virtual environment for backtesting option strategies on historical stock market data :-
Starting by creating a virtual environment in conda by the name vnv
conda create --name vnv
Switching to the above created virtual environment
source activate vnv
Installing jupyter notebook to work on it
conda install jupyter
Installing the AlgoAshutosh library from PyPI to work on it and backtest option strategies.
pip install AlgoAshutosh
Opening up jupyter notebook
jupyter-notebook
The code :
from AlgoAshutosh import *
object = ironCondor()
object.ironCondorStrategy(<location of put file>,<location of call file>,<location of futures file>,100,100,200,200,1,10,50)
Sample output be something like this :