A trading bot for the Tinkoff Invest broker.
Only history loading is implemented at the moment.
- A Tinkoff Invest account and an access token
- PostgreSQL
- Current user's right to create a database in it
pip install -r requirements.txt
Tested on Ubuntu 22.04.
- Set the environment variable
INVEST_TOKENto your Tinkoff Invest access token:
export INVEST_TOKEN=your_tokenAlternatively, save this line to a script and source it (dot-call) before using the bot:
. load-token.shWhen running the bot from an IDE, you can set the environment variable in its project settings.
Make sure your token doesn't get commited to a repository or get outside your computer in any other way.
Add or remove function calls in trading_bot.py as you see fit and run it.
host.deploy()— Deploy the trading bot on this machine.host.update_instruments()— Download and save the information about available instruments and their properties.host.download_history()— Download the candle history to the database.