This code utility should help you in logging your daily algo trades done.
Currently built for Aliceblue you could tweek your code accordingly to make work with other broker apis
Remember i'm using here SQLLite3 db as well here.even you can tweek your script to use sqllite3 db only instead of mysql.
- Step 1 : Configure the env_credential.json file in credentials folder
- This utility is configured here for Aliceblue, telegram and your mysql database dependencies. Tweek code as needed.
- Step 2 : Create the table for logging using the create table script placed in db_setups/create_journaltable.sql
- Step 3 : Install the dependencies by running pip install requirements.txt
You could also schedule the logging to be automatic to running only on weekdays.
Below expression would run daily at 3.30PM from Mon-Fri. If you're running Linux/Ubuntu Machine you schedule it using crontab expression. crontab expression could be as bin below sample
30 15 * * 1-5 /home/path-to-python-env/python /path-to-file/algo-trades-logger/tradelogger.py
Choose your environement where you've dependencies installed and then run below command.
python tradelogger.py