backtrader-moexalgo


Namebacktrader-moexalgo JSON
Version 1.0.9 PyPI version JSON
download
home_pagehttps://github.com/WISEPLAT/backtrader_moexalgo
SummaryMOEX API AlgoPack integration with Backtrader
upload_time2024-01-02 13:18:20
maintainer
docs_urlNone
authorwiseplat
requires_python>=3.7
licenseMIT License
keywords trading development
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # backtrader_moexalgo



Интеграция MOEX API AlgoPack с [Backtrader](https://github.com/WISEPLAT/backtrader ).

Этот код был написан для Хакатона [GO ALGO](https://goalgo.ru ) организатором которого выступает биржа [MOEX](https://www.moex.com/ru/algopack/about ).  



С помощью этой интеграции вы можете делать:

- Тестирование вашей стратегии на исторических данных с биржи [MOEX](https://www.moex.com/ru/algopack/about ) + [Backtrader](https://github.com/WISEPLAT/backtrader )

- Запускать торговые системы для автоматической торговли на бирже [MOEX](https://www.moex.com/ru/algopack/about ) + [Backtrader](https://github.com/WISEPLAT/backtrader )

   - Для Live торговли вам необходимо установить дополнительные бесплатные библиотеки, например:

     - брокер Финам: [MOEX](https://www.moex.com/ru/algopack/about) + [Backtrader](https://github.com/WISEPLAT/backtrader ) +  [FinamPy](https://github.com/cia76/FinamPy ) // Live торговля

     - брокер Алор: [MOEX](https://www.moex.com/ru/algopack/about) + [Backtrader](https://github.com/WISEPLAT/backtrader ) +  [AlorPy](https://github.com/cia76/AlorPy ) // Live торговля

     - для ЛЮБОГО брокера, у которого есть терминал Quik: [MOEX](https://www.moex.com/ru/algopack/about) + [Backtrader](https://github.com/WISEPLAT/backtrader ) +  [QuikPy](https://github.com/cia76/QuikPy ) // Live торговля

- Загружать live, исторические данные и Super Candles с биржи [MOEX](https://www.moex.com/ru/algopack/about )

- Создавать и тестировать свои торговые стратегии пользуясь возможностями библиотеки [Backtrader](https://github.com/WISEPLAT/backtrader )

  - Много полезной документации о том, как делать стратегии есть [здесь](https://www.backtrader.com/docu/quickstart/quickstart/ ).



Для подключения к API мы используем библиотеку [moexalgo](https://github.com/moexalgo/moexalgo).



**Обучающее видео по работе с этой библиотекой можно посмотреть [на YouTube](https://youtu.be/SmcQF2jPxsQ ) и [на RuTube](https://rutube.ru/video/private/ba9e19f36c98d45ac9caf5b399dda6ca/?p=2T_4kwuwMz9aQAY3kFxYfQ )**



## Установка

1) Самый простой способ:

```shell

pip install backtrader_moexalgo

```

или

```shell

git clone https://github.com/WISEPLAT/backtrader_moexalgo

```

или

```shell

pip install git+https://github.com/WISEPLAT/backtrader_moexalgo.git

```



2) Пожалуйста, используйте backtrader из моего репозитория (так как вы можете размещать в нем свои коммиты). Установите его:

```shell

pip install git+https://github.com/WISEPLAT/backtrader.git

```

-- Могу ли я использовать ваш интерфейс для moexalgo с оригинальным backtrader?



-- Да, вы можете использовать оригинальный backtrader, так как автор оригинального backtrader одобрил все мои изменения.



Вот ссылка: [mementum/backtrader#472](https://github.com/mementum/backtrader/pull/472)



3) У нас есть некоторые зависимости, вам нужно их установить:

```shell

pip install numpy pandas backtrader moexalgo requests websockets matplotlib

```



### Начало работы

Чтобы было легче разобраться как всё работает, сделано множество примеров в папках **DataExamplesMoexAlgo_ru** и **StrategyExamplesMoexAlgo_ru**.



```shell

Внимание! Для получения Super Candles - необходима авторизация на сайте Московской биржи.



1. Активируйте эту строку:

store = MoexAlgoStore(login=ConfigMOEX.Login, password=ConfigMOEX.Password)  # Хранилище AlgoPack + авторизация на Московской Бирже



2. Заполните ваши учетные данные в файле Config.py

class Config:

    Login = '<Адрес электронной почты>'  # Адрес электронной почты, указанный при регистрации на сайте moex.com

    Password = '<Пароль>'  # Пароль от учетной записи на сайте moex.com

```



В папке **DataExamplesMoexAlgo_ru** находится код примеров по работе с биржевыми данными через API интерфейс [MOEX](https://www.moex.com/ru/algopack/about ).



* **01 - Symbol.py** - торговая стратегия для получения исторических и "живых" данных одного тикера по одному таймфрейму

  * Реализована возможность получения Super Candles, свечей с расширенным набором параметров

* **02 - Symbol data to DF.py** - экспорт в csv файл исторических данных одного тикера по одному таймфрейму

* **03 - Symbols.py** - торговая стратегия для нескольких тикеров по одному таймфрейму

* **04 - Rollover.py** - запуск торговой стратегии на склейке данных из файла с историческими данными и последней загруженной истории с брокера

* **05 - Timeframes.py** - торговая стратегия для одного тикера по разным таймфреймам

* **Strategy.py** - Пример торговой стратегии, которая только выводит данные по тикеру/тикерам OHLCV



В папке **StrategyExamplesMoexAlgo_ru** находится код примеров стратегий.  



* **01 - Live Trade - broker Alor.py** - Пример торговой стратегии в live режиме для тикера SBER - брокер Алор. 

  * Пример выставления заявок на биржу через брокера Алор и их снятие.

    * Пожалуйста, имейте в виду! Это live режим - если на рынке произойдет значительное изменение цены в сторону понижения более чем на 0.5% - ордер может быть выполнен.... 

    * **Не забудьте после теста снять с биржи выставленные заявки!**

* **01 - Live Trade - broker Finam.py** - Пример торговой стратегии в live режиме для тикера SBER - брокер Финам. 

  * Пример выставления заявок на биржу через брокера Финам и их снятие.

    * Пожалуйста, имейте в виду! Это live режим - если на рынке произойдет значительное изменение цены в сторону понижения более чем на 0.5% - ордер может быть выполнен.... 

    * **Не забудьте после теста снять с биржи выставленные заявки!**

* **01 - Live Trade - brokers with Quik.py** - Пример торговой стратегии в live режиме для тикера SBER - любые брокеры с терминалом Quik. 

  * Пример выставления заявок на биржу через брокеров с терминалом Quik и их снятие.

    * Пожалуйста, имейте в виду! Это live режим - если на рынке произойдет значительное изменение цены в сторону понижения более чем на 0.5% - ордер может быть выполнен.... 

    * **Не забудьте после теста снять с биржи выставленные заявки!**



* **02 - Offline Backtest.py** - Пример торговой стратегии для теста на истории - не live режим - для двух тикеров SBER и LKOH.

  * В стратегии показано как применять индикаторы (SMA, RSI) к нескольким тикерам одновременно.

    * Не live режим - для тестирования стратегий без отправки заявок на биржу!

* **03 - Offline Backtest MultiPortfolio.py** - Пример торговой стратегии для теста на истории - не live режим - для множества тикеров, которые можно передавать в стратегию списком (SBER, LKOH, AFLT, GMKN). 

  * В стратегии показано как применять индикаторы (SMA, RSI) к нескольким тикерам одновременно.

    * Не live режим - для тестирования стратегий без отправки заявок на биржу!

* **04 - Offline Backtest Indicators.py** - Пример торговой стратегии для теста на истории с использованием индикаторов SMA и RSI - не live режим - для двух тикеров SBER и LKOH. 

  * В стратегии показано как применять индикаторы (SMA, RSI) к нескольким тикерам одновременно.

    * генерит 177% дохода на момент записи видео )) 

    * Не live режим - для тестирования стратегий без отправки заявок на биржу!



## Спасибо

- backtrader: очень простая и классная библиотека!

- Команде разработчиков MOEX [moexalgo](https://github.com/moexalgo/moexalgo): Для создания оболочки MOEX API, сокращающей большую часть работы.

- Игорю Чечету: за классные бесплатные библиотеки для live торговли реализующие подключения к брокерам 



## Важно

Исправление ошибок, доработка и развитие библиотеки осуществляется автором и сообществом!



**Пушьте ваши коммиты!** 



# Условия использования

Библиотека backtrader_moexalgo позволяющая делать интеграцию Backtrader и MOEX API - это **Программа** созданная исключительно для удобства работы.

При использовании **Программы** Пользователь обязан соблюдать положения действующего законодательства Российской Федерации или своей страны.

Использование **Программы** предлагается по принципу «Как есть» («AS IS»). Никаких гарантий, как устных, так и письменных не прилагается и не предусматривается.

Автор и сообщество не дает гарантии, что все ошибки **Программы** были устранены, соответственно автор и сообщество не несет никакой ответственности за

последствия использования **Программы**, включая, но, не ограничиваясь любым ущербом оборудованию, компьютерам, мобильным устройствам, 

программному обеспечению Пользователя вызванным или связанным с использованием **Программы**, а также за любые финансовые потери,

понесенные Пользователем в результате использования **Программы**.

Никто не ответственен за потерю данных, убытки, ущерб, включаю случайный или косвенный, упущенную выгоду, потерю доходов или любые другие потери,

связанные с использованием **Программы**.



**Программа** распространяется на условиях лицензии [MIT](https://choosealicense.com/licenses/mit).



## История звезд

Пожалуйста, поставьте Звезду 🌟 этому коду



[![Star History Chart](https://api.star-history.com/svg?repos=WISEPLAT/backtrader_moexalgo&type=Timeline)](https://star-history.com/#WISEPLAT/backtrader_moexalgo&Timeline)



## Star History

Please, put a Star 🌟 for this code



==========================================================================





# backtrader_moexalgo

MOEX API integration with [Backtrader](https://github.com/WISEPLAT/backtrader).

This code was written for [GO ALGO](https://goalgo.ru ) Hackathon, organized by the [MOEX](https://www.moex.com/ru/algopack/about ) exchange.



With this integration you can do:

 - Backtesting your strategy on historical data from the exchange [MOEX](https://www.moex.com/ru/algopack/about ) + [Backtrader](https://github.com/WISEPLAT/backtrader )  // Backtesting 

 - Launch trading systems for automatic trading on the exchange [MOEX](https://www.moex.com/ru/algopack/about) + [Backtrader](https://github.com/WISEPLAT/backtrader ) // Live trading

   - For Live trading you need install free additional libraries, like these:

     - broker Finam: [MOEX](https://www.moex.com/ru/algopack/about) + [Backtrader](https://github.com/WISEPLAT/backtrader ) +  [FinamPy](https://github.com/cia76/FinamPy ) // Live trading

     - broker Alor: [MOEX](https://www.moex.com/ru/algopack/about) + [Backtrader](https://github.com/WISEPLAT/backtrader ) +  [AlorPy](https://github.com/cia76/AlorPy ) // Live trading

     - ANY broker with the use of Quik terminal: [MOEX](https://www.moex.com/ru/algopack/about) + [Backtrader](https://github.com/WISEPLAT/backtrader ) +  [QuikPy](https://github.com/cia76/QuikPy ) // Live trading

 - Download live, historical data and Super Candles for tickers from the exchange [MOEX](https://www.moex.com/ru/algopack/about)

- Create and test your trading strategies using the library's features [Backtrader](https://github.com/WISEPLAT/backtrader )

  - There is a lot of useful documentation on how to make strategies [(see here)](https://www.backtrader.com/docu/quickstart/quickstart/ ).



For API connection we are using library [moexalgo](https://github.com/moexalgo/moexalgo).



**A tutorial video with this library can be viewed [on YouTube](https://youtu.be/SmcQF2jPxsQ ) and [on RuTube](https://rutube.ru/video/private/ba9e19f36c98d45ac9caf5b399dda6ca/?p=2T_4kwuwMz9aQAY3kFxYfQ )**



## Installation

1) The simplest way:

```shell

pip install backtrader_moexalgo

```

or

```shell

git clone https://github.com/WISEPLAT/backtrader_moexalgo

```

or

```shell

pip install git+https://github.com/WISEPLAT/backtrader_moexalgo.git

```



2) Please use backtrader from my repository (as your can push your commits in it). Install it:

```shell

pip install git+https://github.com/WISEPLAT/backtrader.git

```

-- Can I use your interface for moexalgo with original backtrader?



-- Yes, you can use original backtrader, as the author of original backtrader had approved all my changes. 



Here is the link: [mementum/backtrader#472](https://github.com/mementum/backtrader/pull/472)



3) We have some dependencies, you need to install them: 

```shell

pip install numpy pandas backtrader moexalgo requests websockets matplotlib

```



### Getting started

To make it easier to figure out how everything works, many examples have been made in the folders **DataExamplesMoexAlgo** and **StrategyExamplesMoexAlgo**.



```shell

Attention! To receive Super Candles, you need to log in to the Moscow Exchange website.



1. Activate this line:

store = MoexAlgoStore(login=ConfigMOEX.Login, password=ConfigMOEX.Password)  # Storage AlgoPack + authorization on the Moscow Stock Exchange



2. Fill in your credentials in the file Config.py

class Config:

    Login = '<Email address>'  # The email address provided during registration on the site moex.com

    Password = '<Password>'  # The password for the account on the site moex.com

```



The **DataExamplesMoexAlgo** folder contains the code of examples for working with exchange data via the [MOEX](https://www.moex.com/ru/algopack/about ) API.



* **01 - Symbol.py** - trading strategy for obtaining historical and "live" data of one ticker for one timeframe

  * The possibility of obtaining Super Candles, candles with an extended set of parameters is implemented

* **02 - Symbol data to DF.py** - export to csv file of historical data of one ticker for one timeframe

* **03 - Symbols.py** - trading strategy for multiple tickers on the same timeframe

* **04 - Rollover.py** - launch of a trading strategy based on gluing data from a file with historical data and the last downloaded history from the broker

* **05 - Timeframes.py** - trading strategy is running on different timeframes.

* **Strategy.py** - An example of a trading strategy that only outputs data of the OHLCV for ticker/tickers



The **StrategyExamplesMoexAlgo** folder contains the code of sample strategies.



* **01 - Live Trade - broker Alor.py** - An example of a live trading strategy for SBER ticker - broker Alor.

  * Example of placing and cancel orders on the exchange with the use of broker Alor.

    * Please be aware! This is Live order - if market has a big change down in value of price more than 0.5% - the order will be completed.... 

    * **Do not forget to cancel the submitted orders from the exchange after the test!**

* **01 - Live Trade - broker Finam.py** - An example of a live trading strategy for SBER ticker - broker Finam.

  * Example of placing and cancel orders on the exchange with the use of broker Finam.

    * Please be aware! This is Live order - if market has a big change down in value of price more than 0.5% - the order will be completed.... 

    * **Do not forget to cancel the submitted orders from the exchange after the test!**

* **01 - Live Trade - broker brokers with Quik.py** - An example of a live trading strategy for SBER ticker - any brokers with terminal Quik.

  * Example of placing and cancel orders on the exchange with the use of broker with terminal Quik.

    * Please be aware! This is Live order - if market has a big change down in value of price more than 0.5% - the order will be completed.... 

    * **Do not forget to cancel the submitted orders from the exchange after the test!**



* **02 - Offline Backtest.py** - An example of a trading strategy on a historical data - not live mode - for two SBER and LKOH tickers.

  * The strategy shows how to apply indicators (SMA, RSI) to several tickers at the same time.

    * Not a live mode - for testing strategies without sending orders to the exchange!

* **03 - Offline Backtest MultiPortfolio.py** - An example of a trading strategy on a historical data - not live mode - for a set of tickers that can be transferred to the strategy in a list (SBER, LKOH, AFLT, GMKN).

  * The strategy shows how to apply indicators (SMA, RSI) to several tickers at the same time.

    * Not a live mode - for testing strategies without sending orders to the exchange!

* **04 - Offline Backtest Indicators.py** - An example of a trading strategy for a history test using SMA and RSI indicators - not live mode - for two SBER and LKOH tickers.

  * The strategy shows how to apply indicators (SMA, RSI) to several tickers at the same time.

    * generates 177% of revenue at the time of video recording))

    * Non-live mode - for testing strategies without sending orders to the exchange!



## Thanks

- backtrader: Very simple and cool library!

- Team of MOEX [moexalgo](https://github.com/moexalgo/moexalgo): For creating MOEX API wrapper, shortening a lot of work.

- Igor Chechet: for free cool libraries for live trading by connection to brokers 



## License

[MIT](https://choosealicense.com/licenses/mit)



## Important

Error correction, revision and development of the library is carried out by the author and the community!



**Push your commits!**



## Terms of Use

The backtrader_moexalgo library, which allows you to integrate Backtrader and MOEX API, is the **Program** created solely for the convenience of work.

When using the **Program**, the User is obliged to comply with the provisions of the current legislation of his country.

Using the **Program** are offered on an "AS IS" basis. No guarantees, either oral or written, are attached and are not provided.

The author and the community does not guarantee that all errors of the **Program** have been eliminated, respectively, the author and the community do not bear any responsibility for

the consequences of using the **Program**, including, but not limited to, any damage to equipment, computers, mobile devices,

User software caused by or related to the use of the **Program**, as well as for any financial losses

incurred by the User as a result of using the **Program**.

No one is responsible for data loss, losses, damages, including accidental or indirect, lost profits, loss of revenue or any other losses

related to the use of the **Program**.



The **Program** is distributed under the terms of the [MIT](https://choosealicense.com/licenses/mit ) license.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/WISEPLAT/backtrader_moexalgo",
    "name": "backtrader-moexalgo",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "trading,development",
    "author": "wiseplat",
    "author_email": "oshpagin@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/27/13/328f4436e42e504182a036445a9e611218ee45524f764c99709917287926/backtrader_moexalgo-1.0.9.tar.gz",
    "platform": null,
    "description": "# backtrader_moexalgo\r\n\r\n\r\n\r\n\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f MOEX API AlgoPack \u0441 [Backtrader](https://github.com/WISEPLAT/backtrader ).\r\n\r\n\u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0434\u043b\u044f \u0425\u0430\u043a\u0430\u0442\u043e\u043d\u0430 [GO ALGO](https://goalgo.ru ) \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0431\u0438\u0440\u0436\u0430 [MOEX](https://www.moex.com/ru/algopack/about ).  \r\n\r\n\r\n\r\n\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u0435\u043b\u0430\u0442\u044c:\r\n\r\n- \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0431\u0438\u0440\u0436\u0438 [MOEX](https://www.moex.com/ru/algopack/about ) + [Backtrader](https://github.com/WISEPLAT/backtrader )\r\n\r\n- \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0442\u043e\u0440\u0433\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u0438 \u043d\u0430 \u0431\u0438\u0440\u0436\u0435 [MOEX](https://www.moex.com/ru/algopack/about ) + [Backtrader](https://github.com/WISEPLAT/backtrader )\r\n\r\n   - \u0414\u043b\u044f Live \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:\r\n\r\n     - \u0431\u0440\u043e\u043a\u0435\u0440 \u0424\u0438\u043d\u0430\u043c: [MOEX](https://www.moex.com/ru/algopack/about) + [Backtrader](https://github.com/WISEPLAT/backtrader ) +  [FinamPy](https://github.com/cia76/FinamPy ) // Live \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u044f\r\n\r\n     - \u0431\u0440\u043e\u043a\u0435\u0440 \u0410\u043b\u043e\u0440: [MOEX](https://www.moex.com/ru/algopack/about) + [Backtrader](https://github.com/WISEPLAT/backtrader ) +  [AlorPy](https://github.com/cia76/AlorPy ) // Live \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u044f\r\n\r\n     - \u0434\u043b\u044f \u041b\u042e\u0411\u041e\u0413\u041e \u0431\u0440\u043e\u043a\u0435\u0440\u0430, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b Quik: [MOEX](https://www.moex.com/ru/algopack/about) + [Backtrader](https://github.com/WISEPLAT/backtrader ) +  [QuikPy](https://github.com/cia76/QuikPy ) // Live \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u044f\r\n\r\n- \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c live, \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 Super Candles \u0441 \u0431\u0438\u0440\u0436\u0438 [MOEX](https://www.moex.com/ru/algopack/about )\r\n\r\n- \u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0442\u043e\u0440\u0433\u043e\u0432\u044b\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 [Backtrader](https://github.com/WISEPLAT/backtrader )\r\n\r\n  - \u041c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0435\u0441\u0442\u044c [\u0437\u0434\u0435\u0441\u044c](https://www.backtrader.com/docu/quickstart/quickstart/ ).\r\n\r\n\r\n\r\n\u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a API \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 [moexalgo](https://github.com/moexalgo/moexalgo).\r\n\r\n\r\n\r\n**\u041e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0435 \u0432\u0438\u0434\u0435\u043e \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c [\u043d\u0430 YouTube](https://youtu.be/SmcQF2jPxsQ ) \u0438 [\u043d\u0430 RuTube](https://rutube.ru/video/private/ba9e19f36c98d45ac9caf5b399dda6ca/?p=2T_4kwuwMz9aQAY3kFxYfQ )**\r\n\r\n\r\n\r\n## \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\r\n\r\n1) \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431:\r\n\r\n```shell\r\n\r\npip install backtrader_moexalgo\r\n\r\n```\r\n\r\n\u0438\u043b\u0438\r\n\r\n```shell\r\n\r\ngit clone https://github.com/WISEPLAT/backtrader_moexalgo\r\n\r\n```\r\n\r\n\u0438\u043b\u0438\r\n\r\n```shell\r\n\r\npip install git+https://github.com/WISEPLAT/backtrader_moexalgo.git\r\n\r\n```\r\n\r\n\r\n\r\n2) \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 backtrader \u0438\u0437 \u043c\u043e\u0435\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f (\u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0432 \u043d\u0435\u043c \u0441\u0432\u043e\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u044b). \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0435\u0433\u043e:\r\n\r\n```shell\r\n\r\npip install git+https://github.com/WISEPLAT/backtrader.git\r\n\r\n```\r\n\r\n-- \u041c\u043e\u0433\u0443 \u043b\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f moexalgo \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c backtrader?\r\n\r\n\r\n\r\n-- \u0414\u0430, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 backtrader, \u0442\u0430\u043a \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u0440 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e backtrader \u043e\u0434\u043e\u0431\u0440\u0438\u043b \u0432\u0441\u0435 \u043c\u043e\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.\r\n\r\n\r\n\r\n\u0412\u043e\u0442 \u0441\u0441\u044b\u043b\u043a\u0430: [mementum/backtrader#472](https://github.com/mementum/backtrader/pull/472)\r\n\r\n\r\n\r\n3) \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c:\r\n\r\n```shell\r\n\r\npip install numpy pandas backtrader moexalgo requests websockets matplotlib\r\n\r\n```\r\n\r\n\r\n\r\n### \u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b\r\n\r\n\u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u0447\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0432 \u043f\u0430\u043f\u043a\u0430\u0445 **DataExamplesMoexAlgo_ru** \u0438 **StrategyExamplesMoexAlgo_ru**.\r\n\r\n\r\n\r\n```shell\r\n\r\n\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f Super Candles - \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u041c\u043e\u0441\u043a\u043e\u0432\u0441\u043a\u043e\u0439 \u0431\u0438\u0440\u0436\u0438.\r\n\r\n\r\n\r\n1. \u0410\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0439\u0442\u0435 \u044d\u0442\u0443 \u0441\u0442\u0440\u043e\u043a\u0443:\r\n\r\nstore = MoexAlgoStore(login=ConfigMOEX.Login, password=ConfigMOEX.Password)  # \u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 AlgoPack + \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 \u041c\u043e\u0441\u043a\u043e\u0432\u0441\u043a\u043e\u0439 \u0411\u0438\u0440\u0436\u0435\r\n\r\n\r\n\r\n2. \u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0432\u0430\u0448\u0438 \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 Config.py\r\n\r\nclass Config:\r\n\r\n    Login = '<\u0410\u0434\u0440\u0435\u0441 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b>'  # \u0410\u0434\u0440\u0435\u0441 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 moex.com\r\n\r\n    Password = '<\u041f\u0430\u0440\u043e\u043b\u044c>'  # \u041f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 moex.com\r\n\r\n```\r\n\r\n\r\n\r\n\u0412 \u043f\u0430\u043f\u043a\u0435 **DataExamplesMoexAlgo_ru** \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0438\u0440\u0436\u0435\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 API \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 [MOEX](https://www.moex.com/ru/algopack/about ).\r\n\r\n\r\n\r\n* **01 - Symbol.py** - \u0442\u043e\u0440\u0433\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \"\u0436\u0438\u0432\u044b\u0445\" \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043a\u0435\u0440\u0430 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0442\u0430\u0439\u043c\u0444\u0440\u0435\u0439\u043c\u0443\r\n\r\n  * \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f Super Candles, \u0441\u0432\u0435\u0447\u0435\u0439 \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432\r\n\r\n* **02 - Symbol data to DF.py** - \u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u0432 csv \u0444\u0430\u0439\u043b \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043a\u0435\u0440\u0430 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0442\u0430\u0439\u043c\u0444\u0440\u0435\u0439\u043c\u0443\r\n\r\n* **03 - Symbols.py** - \u0442\u043e\u0440\u0433\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0438\u043a\u0435\u0440\u043e\u0432 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0442\u0430\u0439\u043c\u0444\u0440\u0435\u0439\u043c\u0443\r\n\r\n* **04 - Rollover.py** - \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043d\u0430 \u0441\u043a\u043b\u0435\u0439\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0441 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0441 \u0431\u0440\u043e\u043a\u0435\u0440\u0430\r\n\r\n* **05 - Timeframes.py** - \u0442\u043e\u0440\u0433\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043a\u0435\u0440\u0430 \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0442\u0430\u0439\u043c\u0444\u0440\u0435\u0439\u043c\u0430\u043c\r\n\r\n* **Strategy.py** - \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0442\u0438\u043a\u0435\u0440\u0443/\u0442\u0438\u043a\u0435\u0440\u0430\u043c OHLCV\r\n\r\n\r\n\r\n\u0412 \u043f\u0430\u043f\u043a\u0435 **StrategyExamplesMoexAlgo_ru** \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439.  \r\n\r\n\r\n\r\n* **01 - Live Trade - broker Alor.py** - \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0432 live \u0440\u0435\u0436\u0438\u043c\u0435 \u0434\u043b\u044f \u0442\u0438\u043a\u0435\u0440\u0430 SBER - \u0431\u0440\u043e\u043a\u0435\u0440 \u0410\u043b\u043e\u0440. \r\n\r\n  * \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u044f\u0432\u043e\u043a \u043d\u0430 \u0431\u0438\u0440\u0436\u0443 \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u043e\u043a\u0435\u0440\u0430 \u0410\u043b\u043e\u0440 \u0438 \u0438\u0445 \u0441\u043d\u044f\u0442\u0438\u0435.\r\n\r\n    * \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0438\u043c\u0435\u0439\u0442\u0435 \u0432 \u0432\u0438\u0434\u0443! \u042d\u0442\u043e live \u0440\u0435\u0436\u0438\u043c - \u0435\u0441\u043b\u0438 \u043d\u0430 \u0440\u044b\u043d\u043a\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0446\u0435\u043d\u044b \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043f\u043e\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043d\u0430 0.5% - \u043e\u0440\u0434\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d.... \r\n\r\n    * **\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u0430 \u0441\u043d\u044f\u0442\u044c \u0441 \u0431\u0438\u0440\u0436\u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u044f\u0432\u043a\u0438!**\r\n\r\n* **01 - Live Trade - broker Finam.py** - \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0432 live \u0440\u0435\u0436\u0438\u043c\u0435 \u0434\u043b\u044f \u0442\u0438\u043a\u0435\u0440\u0430 SBER - \u0431\u0440\u043e\u043a\u0435\u0440 \u0424\u0438\u043d\u0430\u043c. \r\n\r\n  * \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u044f\u0432\u043e\u043a \u043d\u0430 \u0431\u0438\u0440\u0436\u0443 \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u043e\u043a\u0435\u0440\u0430 \u0424\u0438\u043d\u0430\u043c \u0438 \u0438\u0445 \u0441\u043d\u044f\u0442\u0438\u0435.\r\n\r\n    * \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0438\u043c\u0435\u0439\u0442\u0435 \u0432 \u0432\u0438\u0434\u0443! \u042d\u0442\u043e live \u0440\u0435\u0436\u0438\u043c - \u0435\u0441\u043b\u0438 \u043d\u0430 \u0440\u044b\u043d\u043a\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0446\u0435\u043d\u044b \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043f\u043e\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043d\u0430 0.5% - \u043e\u0440\u0434\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d.... \r\n\r\n    * **\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u0430 \u0441\u043d\u044f\u0442\u044c \u0441 \u0431\u0438\u0440\u0436\u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u044f\u0432\u043a\u0438!**\r\n\r\n* **01 - Live Trade - brokers with Quik.py** - \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0432 live \u0440\u0435\u0436\u0438\u043c\u0435 \u0434\u043b\u044f \u0442\u0438\u043a\u0435\u0440\u0430 SBER - \u043b\u044e\u0431\u044b\u0435 \u0431\u0440\u043e\u043a\u0435\u0440\u044b \u0441 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u043e\u043c Quik. \r\n\r\n  * \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u044f\u0432\u043e\u043a \u043d\u0430 \u0431\u0438\u0440\u0436\u0443 \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u043e\u043a\u0435\u0440\u043e\u0432 \u0441 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u043e\u043c Quik \u0438 \u0438\u0445 \u0441\u043d\u044f\u0442\u0438\u0435.\r\n\r\n    * \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0438\u043c\u0435\u0439\u0442\u0435 \u0432 \u0432\u0438\u0434\u0443! \u042d\u0442\u043e live \u0440\u0435\u0436\u0438\u043c - \u0435\u0441\u043b\u0438 \u043d\u0430 \u0440\u044b\u043d\u043a\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0446\u0435\u043d\u044b \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043f\u043e\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043d\u0430 0.5% - \u043e\u0440\u0434\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d.... \r\n\r\n    * **\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u0430 \u0441\u043d\u044f\u0442\u044c \u0441 \u0431\u0438\u0440\u0436\u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u044f\u0432\u043a\u0438!**\r\n\r\n\r\n\r\n* **02 - Offline Backtest.py** - \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430 \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 - \u043d\u0435 live \u0440\u0435\u0436\u0438\u043c - \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u0442\u0438\u043a\u0435\u0440\u043e\u0432 SBER \u0438 LKOH.\r\n\r\n  * \u0412 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u044b (SMA, RSI) \u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0442\u0438\u043a\u0435\u0440\u0430\u043c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\r\n\r\n    * \u041d\u0435 live \u0440\u0435\u0436\u0438\u043c - \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0431\u0435\u0437 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u044f\u0432\u043e\u043a \u043d\u0430 \u0431\u0438\u0440\u0436\u0443!\r\n\r\n* **03 - Offline Backtest MultiPortfolio.py** - \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430 \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 - \u043d\u0435 live \u0440\u0435\u0436\u0438\u043c - \u0434\u043b\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043a\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0441\u043f\u0438\u0441\u043a\u043e\u043c (SBER, LKOH, AFLT, GMKN). \r\n\r\n  * \u0412 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u044b (SMA, RSI) \u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0442\u0438\u043a\u0435\u0440\u0430\u043c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\r\n\r\n    * \u041d\u0435 live \u0440\u0435\u0436\u0438\u043c - \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0431\u0435\u0437 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u044f\u0432\u043e\u043a \u043d\u0430 \u0431\u0438\u0440\u0436\u0443!\r\n\r\n* **04 - Offline Backtest Indicators.py** - \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430 \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 SMA \u0438 RSI - \u043d\u0435 live \u0440\u0435\u0436\u0438\u043c - \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u0442\u0438\u043a\u0435\u0440\u043e\u0432 SBER \u0438 LKOH. \r\n\r\n  * \u0412 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u044b (SMA, RSI) \u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0442\u0438\u043a\u0435\u0440\u0430\u043c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\r\n\r\n    * \u0433\u0435\u043d\u0435\u0440\u0438\u0442 177% \u0434\u043e\u0445\u043e\u0434\u0430 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432\u0438\u0434\u0435\u043e )) \r\n\r\n    * \u041d\u0435 live \u0440\u0435\u0436\u0438\u043c - \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0431\u0435\u0437 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u044f\u0432\u043e\u043a \u043d\u0430 \u0431\u0438\u0440\u0436\u0443!\r\n\r\n\r\n\r\n## \u0421\u043f\u0430\u0441\u0438\u0431\u043e\r\n\r\n- backtrader: \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0438 \u043a\u043b\u0430\u0441\u0441\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430!\r\n\r\n- \u041a\u043e\u043c\u0430\u043d\u0434\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 MOEX [moexalgo](https://github.com/moexalgo/moexalgo): \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 MOEX API, \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u044e\u0449\u0435\u0439 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b.\r\n\r\n- \u0418\u0433\u043e\u0440\u044e \u0427\u0435\u0447\u0435\u0442\u0443: \u0437\u0430 \u043a\u043b\u0430\u0441\u0441\u043d\u044b\u0435 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f live \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0440\u043e\u043a\u0435\u0440\u0430\u043c \r\n\r\n\r\n\r\n## \u0412\u0430\u0436\u043d\u043e\r\n\r\n\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a, \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u0440\u043e\u043c \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c!\r\n\r\n\r\n\r\n**\u041f\u0443\u0448\u044c\u0442\u0435 \u0432\u0430\u0448\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u044b!** \r\n\r\n\r\n\r\n# \u0423\u0441\u043b\u043e\u0432\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f\r\n\r\n\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 backtrader_moexalgo \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e Backtrader \u0438 MOEX API - \u044d\u0442\u043e **\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430** \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0440\u0430\u0431\u043e\u0442\u044b.\r\n\r\n\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 **\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b** \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0431\u044f\u0437\u0430\u043d \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0430\u043a\u043e\u043d\u043e\u0434\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0420\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u043e\u0439 \u0424\u0435\u0434\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u044b.\r\n\r\n\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 **\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b** \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u00ab\u041a\u0430\u043a \u0435\u0441\u0442\u044c\u00bb (\u00abAS IS\u00bb). \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0439, \u043a\u0430\u043a \u0443\u0441\u0442\u043d\u044b\u0445, \u0442\u0430\u043a \u0438 \u043f\u0438\u0441\u044c\u043c\u0435\u043d\u043d\u044b\u0445 \u043d\u0435 \u043f\u0440\u0438\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f.\r\n\r\n\u0410\u0432\u0442\u043e\u0440 \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u043d\u0435 \u0434\u0430\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438, \u0447\u0442\u043e \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 **\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b** \u0431\u044b\u043b\u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u044b, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0430\u0432\u0442\u043e\u0440 \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u043d\u0435 \u043d\u0435\u0441\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\r\n\r\n\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f **\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b**, \u0432\u043a\u043b\u044e\u0447\u0430\u044f, \u043d\u043e, \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044f\u0441\u044c \u043b\u044e\u0431\u044b\u043c \u0443\u0449\u0435\u0440\u0431\u043e\u043c \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044e, \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u043c, \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c, \r\n\r\n\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u043c\u0443 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044e \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u044b\u0437\u0432\u0430\u043d\u043d\u044b\u043c \u0438\u043b\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c **\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b**, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430 \u043b\u044e\u0431\u044b\u0435 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0435 \u043f\u043e\u0442\u0435\u0440\u0438,\r\n\r\n\u043f\u043e\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0435 \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f **\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b**.\r\n\r\n\u041d\u0438\u043a\u0442\u043e \u043d\u0435 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u0435\u043d \u0437\u0430 \u043f\u043e\u0442\u0435\u0440\u044e \u0434\u0430\u043d\u043d\u044b\u0445, \u0443\u0431\u044b\u0442\u043a\u0438, \u0443\u0449\u0435\u0440\u0431, \u0432\u043a\u043b\u044e\u0447\u0430\u044e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0438\u043b\u0438 \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u044b\u0439, \u0443\u043f\u0443\u0449\u0435\u043d\u043d\u0443\u044e \u0432\u044b\u0433\u043e\u0434\u0443, \u043f\u043e\u0442\u0435\u0440\u044e \u0434\u043e\u0445\u043e\u0434\u043e\u0432 \u0438\u043b\u0438 \u043b\u044e\u0431\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u0442\u0435\u0440\u0438,\r\n\r\n\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c **\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b**.\r\n\r\n\r\n\r\n**\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430** \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438 [MIT](https://choosealicense.com/licenses/mit).\r\n\r\n\r\n\r\n## \u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0437\u0432\u0435\u0437\u0434\r\n\r\n\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0417\u0432\u0435\u0437\u0434\u0443 \ud83c\udf1f \u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434\u0443\r\n\r\n\r\n\r\n[![Star History Chart](https://api.star-history.com/svg?repos=WISEPLAT/backtrader_moexalgo&type=Timeline)](https://star-history.com/#WISEPLAT/backtrader_moexalgo&Timeline)\r\n\r\n\r\n\r\n## Star History\r\n\r\nPlease, put a Star \ud83c\udf1f for this code\r\n\r\n\r\n\r\n==========================================================================\r\n\r\n\r\n\r\n\r\n\r\n# backtrader_moexalgo\r\n\r\nMOEX API integration with [Backtrader](https://github.com/WISEPLAT/backtrader).\r\n\r\nThis code was written for [GO ALGO](https://goalgo.ru ) Hackathon, organized by the [MOEX](https://www.moex.com/ru/algopack/about ) exchange.\r\n\r\n\r\n\r\nWith this integration you can do:\r\n\r\n - Backtesting your strategy on historical data from the exchange [MOEX](https://www.moex.com/ru/algopack/about ) + [Backtrader](https://github.com/WISEPLAT/backtrader )  // Backtesting \r\n\r\n - Launch trading systems for automatic trading on the exchange [MOEX](https://www.moex.com/ru/algopack/about) + [Backtrader](https://github.com/WISEPLAT/backtrader ) // Live trading\r\n\r\n   - For Live trading you need install free additional libraries, like these:\r\n\r\n     - broker Finam: [MOEX](https://www.moex.com/ru/algopack/about) + [Backtrader](https://github.com/WISEPLAT/backtrader ) +  [FinamPy](https://github.com/cia76/FinamPy ) // Live trading\r\n\r\n     - broker Alor: [MOEX](https://www.moex.com/ru/algopack/about) + [Backtrader](https://github.com/WISEPLAT/backtrader ) +  [AlorPy](https://github.com/cia76/AlorPy ) // Live trading\r\n\r\n     - ANY broker with the use of Quik terminal: [MOEX](https://www.moex.com/ru/algopack/about) + [Backtrader](https://github.com/WISEPLAT/backtrader ) +  [QuikPy](https://github.com/cia76/QuikPy ) // Live trading\r\n\r\n - Download live, historical data and Super Candles for tickers from the exchange [MOEX](https://www.moex.com/ru/algopack/about)\r\n\r\n- Create and test your trading strategies using the library's features [Backtrader](https://github.com/WISEPLAT/backtrader )\r\n\r\n  - There is a lot of useful documentation on how to make strategies [(see here)](https://www.backtrader.com/docu/quickstart/quickstart/ ).\r\n\r\n\r\n\r\nFor API connection we are using library [moexalgo](https://github.com/moexalgo/moexalgo).\r\n\r\n\r\n\r\n**A tutorial video with this library can be viewed [on YouTube](https://youtu.be/SmcQF2jPxsQ ) and [on RuTube](https://rutube.ru/video/private/ba9e19f36c98d45ac9caf5b399dda6ca/?p=2T_4kwuwMz9aQAY3kFxYfQ )**\r\n\r\n\r\n\r\n## Installation\r\n\r\n1) The simplest way:\r\n\r\n```shell\r\n\r\npip install backtrader_moexalgo\r\n\r\n```\r\n\r\nor\r\n\r\n```shell\r\n\r\ngit clone https://github.com/WISEPLAT/backtrader_moexalgo\r\n\r\n```\r\n\r\nor\r\n\r\n```shell\r\n\r\npip install git+https://github.com/WISEPLAT/backtrader_moexalgo.git\r\n\r\n```\r\n\r\n\r\n\r\n2) Please use backtrader from my repository (as your can push your commits in it). Install it:\r\n\r\n```shell\r\n\r\npip install git+https://github.com/WISEPLAT/backtrader.git\r\n\r\n```\r\n\r\n-- Can I use your interface for moexalgo with original backtrader?\r\n\r\n\r\n\r\n-- Yes, you can use original backtrader, as the author of original backtrader had approved all my changes. \r\n\r\n\r\n\r\nHere is the link: [mementum/backtrader#472](https://github.com/mementum/backtrader/pull/472)\r\n\r\n\r\n\r\n3) We have some dependencies, you need to install them: \r\n\r\n```shell\r\n\r\npip install numpy pandas backtrader moexalgo requests websockets matplotlib\r\n\r\n```\r\n\r\n\r\n\r\n### Getting started\r\n\r\nTo make it easier to figure out how everything works, many examples have been made in the folders **DataExamplesMoexAlgo** and **StrategyExamplesMoexAlgo**.\r\n\r\n\r\n\r\n```shell\r\n\r\nAttention! To receive Super Candles, you need to log in to the Moscow Exchange website.\r\n\r\n\r\n\r\n1. Activate this line:\r\n\r\nstore = MoexAlgoStore(login=ConfigMOEX.Login, password=ConfigMOEX.Password)  # Storage AlgoPack + authorization on the Moscow Stock Exchange\r\n\r\n\r\n\r\n2. Fill in your credentials in the file Config.py\r\n\r\nclass Config:\r\n\r\n    Login = '<Email address>'  # The email address provided during registration on the site moex.com\r\n\r\n    Password = '<Password>'  # The password for the account on the site moex.com\r\n\r\n```\r\n\r\n\r\n\r\nThe **DataExamplesMoexAlgo** folder contains the code of examples for working with exchange data via the [MOEX](https://www.moex.com/ru/algopack/about ) API.\r\n\r\n\r\n\r\n* **01 - Symbol.py** - trading strategy for obtaining historical and \"live\" data of one ticker for one timeframe\r\n\r\n  * The possibility of obtaining Super Candles, candles with an extended set of parameters is implemented\r\n\r\n* **02 - Symbol data to DF.py** - export to csv file of historical data of one ticker for one timeframe\r\n\r\n* **03 - Symbols.py** - trading strategy for multiple tickers on the same timeframe\r\n\r\n* **04 - Rollover.py** - launch of a trading strategy based on gluing data from a file with historical data and the last downloaded history from the broker\r\n\r\n* **05 - Timeframes.py** - trading strategy is running on different timeframes.\r\n\r\n* **Strategy.py** - An example of a trading strategy that only outputs data of the OHLCV for ticker/tickers\r\n\r\n\r\n\r\nThe **StrategyExamplesMoexAlgo** folder contains the code of sample strategies.\r\n\r\n\r\n\r\n* **01 - Live Trade - broker Alor.py** - An example of a live trading strategy for SBER ticker - broker Alor.\r\n\r\n  * Example of placing and cancel orders on the exchange with the use of broker Alor.\r\n\r\n    * Please be aware! This is Live order - if market has a big change down in value of price more than 0.5% - the order will be completed.... \r\n\r\n    * **Do not forget to cancel the submitted orders from the exchange after the test!**\r\n\r\n* **01 - Live Trade - broker Finam.py** - An example of a live trading strategy for SBER ticker - broker Finam.\r\n\r\n  * Example of placing and cancel orders on the exchange with the use of broker Finam.\r\n\r\n    * Please be aware! This is Live order - if market has a big change down in value of price more than 0.5% - the order will be completed.... \r\n\r\n    * **Do not forget to cancel the submitted orders from the exchange after the test!**\r\n\r\n* **01 - Live Trade - broker brokers with Quik.py** - An example of a live trading strategy for SBER ticker - any brokers with terminal Quik.\r\n\r\n  * Example of placing and cancel orders on the exchange with the use of broker with terminal Quik.\r\n\r\n    * Please be aware! This is Live order - if market has a big change down in value of price more than 0.5% - the order will be completed.... \r\n\r\n    * **Do not forget to cancel the submitted orders from the exchange after the test!**\r\n\r\n\r\n\r\n* **02 - Offline Backtest.py** - An example of a trading strategy on a historical data - not live mode - for two SBER and LKOH tickers.\r\n\r\n  * The strategy shows how to apply indicators (SMA, RSI) to several tickers at the same time.\r\n\r\n    * Not a live mode - for testing strategies without sending orders to the exchange!\r\n\r\n* **03 - Offline Backtest MultiPortfolio.py** - An example of a trading strategy on a historical data - not live mode - for a set of tickers that can be transferred to the strategy in a list (SBER, LKOH, AFLT, GMKN).\r\n\r\n  * The strategy shows how to apply indicators (SMA, RSI) to several tickers at the same time.\r\n\r\n    * Not a live mode - for testing strategies without sending orders to the exchange!\r\n\r\n* **04 - Offline Backtest Indicators.py** - An example of a trading strategy for a history test using SMA and RSI indicators - not live mode - for two SBER and LKOH tickers.\r\n\r\n  * The strategy shows how to apply indicators (SMA, RSI) to several tickers at the same time.\r\n\r\n    * generates 177% of revenue at the time of video recording))\r\n\r\n    * Non-live mode - for testing strategies without sending orders to the exchange!\r\n\r\n\r\n\r\n## Thanks\r\n\r\n- backtrader: Very simple and cool library!\r\n\r\n- Team of MOEX [moexalgo](https://github.com/moexalgo/moexalgo): For creating MOEX API wrapper, shortening a lot of work.\r\n\r\n- Igor Chechet: for free cool libraries for live trading by connection to brokers \r\n\r\n\r\n\r\n## License\r\n\r\n[MIT](https://choosealicense.com/licenses/mit)\r\n\r\n\r\n\r\n## Important\r\n\r\nError correction, revision and development of the library is carried out by the author and the community!\r\n\r\n\r\n\r\n**Push your commits!**\r\n\r\n\r\n\r\n## Terms of Use\r\n\r\nThe backtrader_moexalgo library, which allows you to integrate Backtrader and MOEX API, is the **Program** created solely for the convenience of work.\r\n\r\nWhen using the **Program**, the User is obliged to comply with the provisions of the current legislation of his country.\r\n\r\nUsing the **Program** are offered on an \"AS IS\" basis. No guarantees, either oral or written, are attached and are not provided.\r\n\r\nThe author and the community does not guarantee that all errors of the **Program** have been eliminated, respectively, the author and the community do not bear any responsibility for\r\n\r\nthe consequences of using the **Program**, including, but not limited to, any damage to equipment, computers, mobile devices,\r\n\r\nUser software caused by or related to the use of the **Program**, as well as for any financial losses\r\n\r\nincurred by the User as a result of using the **Program**.\r\n\r\nNo one is responsible for data loss, losses, damages, including accidental or indirect, lost profits, loss of revenue or any other losses\r\n\r\nrelated to the use of the **Program**.\r\n\r\n\r\n\r\nThe **Program** is distributed under the terms of the [MIT](https://choosealicense.com/licenses/mit ) license.\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "MOEX API AlgoPack integration with Backtrader",
    "version": "1.0.9",
    "project_urls": {
        "Documentation": "https://github.com/WISEPLAT/backtrader_moexalgo/blob/master/README.md",
        "Homepage": "https://github.com/WISEPLAT/backtrader_moexalgo"
    },
    "split_keywords": [
        "trading",
        "development"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "23a039b95e0f39098ebd8cb5fcd9087fea65af49f3055c9a2e30c2cdb33027fa",
                "md5": "cab582c35bc1373ffadd9c7676ab4b67",
                "sha256": "84a07f3babe1417c557036cc717dc5552aaba27f6972fe930afa5010a430f6ed"
            },
            "downloads": -1,
            "filename": "backtrader_moexalgo-1.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cab582c35bc1373ffadd9c7676ab4b67",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 15647,
            "upload_time": "2024-01-02T13:18:19",
            "upload_time_iso_8601": "2024-01-02T13:18:19.041317Z",
            "url": "https://files.pythonhosted.org/packages/23/a0/39b95e0f39098ebd8cb5fcd9087fea65af49f3055c9a2e30c2cdb33027fa/backtrader_moexalgo-1.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2713328f4436e42e504182a036445a9e611218ee45524f764c99709917287926",
                "md5": "b4d2a83277bc6f4e6e74e658da929fa5",
                "sha256": "6aaa342d68f08d56a73a56b6e87cf4b363b0d3d5ddf8641bf5c69cdc4b1e7d37"
            },
            "downloads": -1,
            "filename": "backtrader_moexalgo-1.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "b4d2a83277bc6f4e6e74e658da929fa5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 22045,
            "upload_time": "2024-01-02T13:18:20",
            "upload_time_iso_8601": "2024-01-02T13:18:20.861737Z",
            "url": "https://files.pythonhosted.org/packages/27/13/328f4436e42e504182a036445a9e611218ee45524f764c99709917287926/backtrader_moexalgo-1.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-02 13:18:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "WISEPLAT",
    "github_project": "backtrader_moexalgo",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "backtrader-moexalgo"
}
        
Elapsed time: 0.15088s