This is an example tool to analyze market data such as candles and trades.
Find your own ideas and test it by using backtesting tool trade_backtesting project.
Best ideas can be a strategy for trading bot invest-bot project
$ pip install tinkoff-investments
$ pip install -U matplotlib
$ pip install pandas
Recommendation is to use python 3.10.
Run main.py
Configuration can be specified via settings.ini file.
FROM_DAYS
- count of days for data providers from NOW (negative number are disable filtration by date)FIGI
- stock figi for researchPROVIDER_NAME
- name of analyze provider to run (RSI_CALCULATION
- is an example, you are free to add your own ideas)
NAME
- name of data provider:- 'TinkoffDownloaded' for market data downloaded by tinkoff_market_data_collector project
- 'TinkoffHistoryData' for market data downloaded from 'https://invest-public-api.tinkoff.ru/history-data' More information
- 'TinkoffAPIGetAllCandles' is getting history candles from tinkoff api online. Requires API Token.
- if name is
TinkoffDownloaded
- 'ROOT_PATH' - path to root folder with downloaded market data
- if name is
TinkoffHistoryData
- 'ROOT_PATH' - path to root folder with downloaded market data
- if name is
TinkoffAPIGetAllCandles
- 'TOKEN' - token for Тинькофф Инвестиции api.
- Name of section must be the same as
ANALYZE
.PROVIDER_NAME
, other section names will be ignored - All settings in the section will be provided as *args to the init method of provider class
- Write a new class (or classes) with your idea
- Put (create before) it to specific folder under
analyze
folder - The new class must have
IAnalyzeProvider
as super class - Give a name for the new class for configuration (
PROVIDER_NAME
) - Extend
AnalyzeProviderFactory
class by the name and return the new class by the name - Specify new settings in
settings.ini
file.- Put the new class name to
ANALYZE
.PROVIDER_NAME
- Create separate section
PROVIDER_NAME
with args for__init__
method
- Put the new class name to
Enjoy it.
- Just an example how you can develop your own indicator and use it by tool.
- Download market data using tinkoff_market_data_collector project
- Research data and find an idea for trade strategy using analyze_market_data project
- Test and tune your trade strategy using trade_backtesting project
- Trade by invest-bot and your own strategy.
- Profit!
Your can find example in code:
- Let's imagine your have great idea to invent your own idicator. Rsi idicator was selected for example.
- RSI Calculation alghoritm has been written for research tool
- It has been tested by backtesting
- And now you are able to make your desicion.
All logs are written in logs/analyze.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 tool.