Skip to content

dsdante/trading-bot-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A trading bot

A trading bot for the Tinkoff Invest broker.

Only history loading is implemented at the moment.

1. Prerequisites

  • 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.

2. Usage

2.1 Setting a broker access token

  1. Set the environment variable INVEST_TOKEN to your Tinkoff Invest access token:
export INVEST_TOKEN=your_token

Alternatively, save this line to a script and source it (dot-call) before using the bot:

. load-token.sh

When 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.

2.2 Running the bot

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages