Skip to content

ashutosh-2024/AlgoTrading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AlgoTrading

Downloads PyPI PyPI - License

  1. This repository contains codes for fetching historical stock market data for Cash Market and F&O segment using Breeze Connect API.

  2. 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

  3. The repository contains codes for automatically placing orders with the broker according to the defined strategy.

Setup virtual environment

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

Running a backtesting strategy example:

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 :

Screenshot 2022-07-12 at 12 01 07 PM

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages