GithubHelp home page GithubHelp logo

alex2304-tinkoff-contest-python's Introduction

Trade Dealer for the Tinkoff API contest

Overview of the system components

Торговая система с подключаемыми стратегиями.

Решение о торговле принимает стратегия. Всю остальную работу берет на себя система.

Сосредоточьтесь на описании и тестировании стратегий, не отвлекаясь на детали работы с API.

Подготовка к работе

Для работы вам понадобится версия python 3.7+.

Установите зависимости (unix/macOS):

# create virtualenv locally
python3 -m venv ./venv
source venv/bin/activate
# install required dependencies
pip install -r requirements.txt

Запуск трейдера

Установка токена доступа

Для торговли нужен access token с уровнем доступа FULL ACCESS. Для торговли в песочнице нужен специальный sandobx token.

Перейдите на сайт Tinkoff и создайте токены в разделе настройки.

Затем установите токены в переменные окружения:

# create the `example.env` file with the environment variables
cat > example.env << EOL
export PYTHONPATH=./:${PYTHONPATH}
# tinkoff API token with the FULL_ACCESS level
export INVEST_TOKEN=
# tinkoff API sandbox token
export SANDBOX_TOKEN=
# (optional) if you have multiple accounts -- please, specify ID of the account you want to trade on
#export ACCOUNT_ID=
# (optional) you can track the orders made by the bot with this name
#export APP_NAME=
EOL
# add to the file required values in your favorite editor (I use Sublime Text here)
subl example.env
# source the file to load the env variables
source example.env

Выбор и настройка стратегии

Реализация стратегий должна размещаться в папке traders/.

Чтобы начать торговлю по стратегии из файла rsi.py, используя конфигурацию из файла config/rsi_trader_moex.yaml:

python src/run_trader.py rsi -c config/rsi_trader_moex.yaml

Чтобы начать торговлю по стратегии EMA, используя другую конфигурацию из файла config/ema_trader_moex.yaml:

python src/run_trader.py ema -c config/ema_trader_moex.yaml

Чтобы написать свою стратегию, скопируйте один из файлов и реализуйте абстрактный метод make_decisions.

Отладка стратегий

TODO:

Обработка ошибок

TODO:

alex2304-tinkoff-contest-python's People

Contributors

alex2304 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.