The project status is an example of trading bot and isn't ready for any production using. The provided trade strategy is just an example and have negative profit by the end.
Here is trading bot for MOEX Exchange with ability to send information about trading to a telegram chat. The bot is using Tinkoff Invest Python gRPC client api.
Note: trade strategy is represented in code is just example and not a trade or invest recommendation.
$ pip install tinkoff-investments
$ pip install -U aiogram
Open brokerage account Тинькофф Инвестиции and top up your account:
Do not forget to take TOKEN for API trading.
Register your bot via @BotFather.
Create a chat and get chat_id.
PS. Please use Google to find detailed instruction how to get chat_id.
settings.ini
fileTOKEN
(section INVEST_API
)TELEGRAM_BOT_TOKEN
(section BLOG
)TELEGRAM_CHAT_ID
(section BLOG
)Recommendation is to use python 3.10 (bot has been tested on 3.10 version include real trading).
Run main.py
Configuration can be specified via settings.ini file.
Token and app name for Тинькофф Инвестиции api.
Minimal amount of rub on account for start trading.
Settings for time management. Bot trades only in main trade session. Bot ignore pre\post market etc.
Settings for trade strategies.
Section STRATEGY_ticker_name:
STRATEGY_NAME
- name of algorithmTICKER
- ticker name (human-friendly name for telegram messages)FIGI
- figi of stock. Required for APIMAX_LOTS_PER_ORDER
- Maximum count of lots per orderSection STRATEGY_ticker_name_SETTINGS:
Detailed settings for strategy. Strategy class reads and parses settings manually.
Note: Only one strategy for one stock in configuration.
Before start:
Main session:
Trading schedule:
STRATEGY_NAME
Information about:
Telegram messages are optional and can be disabled without any effect on trading.
All logs are written in logs/robot.log. Any kind of settings can be changed in main.py code
The author is not responsible for any errors or omissions, or for the trade results obtained from the use of this bot.