This app is for semi-automatic trading with zerodha. This is tested on python>3.9 and <=3.12.0.
setup TOTP for your zerodha account. This is necessary to programatically access your broker account and do trade functions. copy the alpha numeric representation of TOTP to your clipboard, as mentioned in step 13.8 of zerodha totp setup. Remember to store this TOTP code from clipboard to some file in your system. We will need it later.
you need to download python 3.9.13 and install the appropriate version for your operating system.
Git is required so you can clone any Github repository. We also need it to provide continuous integration and delivery. Usually you need to download 64-bit version of Git The default choice of installation is fine for most cases. You may opt out from experimental features, while installing Git
You can give any folder name or Create a New folder in any folder.
Here, C:\ecomsense
is the directory, where you want to install this software.
terminal
directory is for actually project files & dependencies which will be installed.
mkdir C:\ecomsense\
cd C:\ecomsense
mkdir terminal
cd terminal
git clone https://github.com/ecomsense/virajs-excel.git
if successful, you should be able to see a new directory virajs-excel
under the current directory
There is a script which will automatically do everything to setup project.
# 1. change the directory to virajs-excel.
cd virajs-excel
# Now you will be in "C:\ecomsense\terminal\virajs-excel" directory.
- Run
one_time_setup.bat
and wait for sometime to complete the download.
Before we run the application, the credential file needs to be created. Please create a file named as virajs-excel.yml
in terminal
folder which you created earlier. Open it in notepad or any other text editor. Modify it suitably according to your stock broker credentials.
zerodha:
userid: <userid>
password: <password>
totp: <totp>
api_key: <api_key>
secret: <secret>
-
Copy the above code and paste it to the
virajs-excel.yml
file interminal
folder and replace all the placeholders with actual details. -
Note: Make sure you will be in virajs-excel directory.
-
run
run_algo.bat
There are two bat files run_algo.bat
and update.bat
in this folder virajs-excel
. create desktop shortcuts for them. This way one can run the program by clicking on the run_algo
without having to run complicated commands from the command line. The update
shortcut can be clicked whenever the user wants to get the latest updates.
If we have successfully installed the application, clicking on the run_algo
will start the program. It is basically an one liner which activates the virtualenv by running terminal\venv\Scripts\activate
and then starts the python script using python main.py
which is inside terminal\virajs-excel\src