EIDiamond / invest-bot

Trading bot based on Tinkoff Invest gRPC API
Apache License 2.0
31 stars 22 forks source link
moex python telegram-bot tinkoff-invest-api trading

Trading bot based on Tinkoff Invest Python gRPC client API

Project Status

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.

Description

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.

Features

Note: trade strategy is represented in code is just example and not a trade or invest recommendation.

Before Start

Dependencies

Do not forget to take TOKEN for API trading.

Telegram (optional)

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.

Required configuration (minimal)

  1. Open settings.ini file
  2. Specify token for trade API in TOKEN (section INVEST_API)
  3. (Optinal) Specify token for a telegram bot in TELEGRAM_BOT_TOKEN (section BLOG)
  4. (Optinal) Specify id of a telegram chat in TELEGRAM_CHAT_ID (section BLOG)

Run

Recommendation is to use python 3.10 (bot has been tested on 3.10 version include real trading).

Run main.py

Configuration

Configuration can be specified via settings.ini file.

Section INVEST_API

Token and app name for Тинькофф Инвестиции api.

Section BLOG

Section STRATEGY_ticker_name:

Section STRATEGY_ticker_name_SETTINGS:

Detailed settings for strategy. Strategy class reads and parses settings manually.

Note: Only one strategy for one stock in configuration.

Trading on stocks exchange

Before start:

Main session:

Trading schedule:

How to add a new strategy

Telegram messages

Information about:

Telegram messages are optional and can be disabled without any effect on trading.

Logging

All logs are written in logs/robot.log. Any kind of settings can be changed in main.py code

Project change log

Here

Disclaimer

The author is not responsible for any errors or omissions, or for the trade results obtained from the use of this bot.