Skip to content

Example tool to analyze market data such as candles and trades

License

Notifications You must be signed in to change notification settings

EIDiamond/analyze_market_data

Repository files navigation

Description

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

Before Start

Dependencies

$ pip install tinkoff-investments
$ pip install -U matplotlib
$ pip install pandas

Run

Recommendation is to use python 3.10.

Run main.py

Configuration

Configuration can be specified via settings.ini file.

Section ANALYZE

  • FROM_DAYS - count of days for data providers from NOW (negative number are disable filtration by date)
  • FIGI - stock figi for research
  • PROVIDER_NAME - name of analyze provider to run (RSI_CALCULATION - is an example, you are free to add your own ideas)

Section DATA_PROVIDER

Section DATA_PROVIDER_SETTINGS

  • 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

Section PROVIDER_NAME (RSI_CALCULATION in example)

  • 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

How to add a new analyze provider with your own best idea

  • 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

Enjoy it.

RSI_CALCULATION example

  • Just an example how you can develop your own indicator and use it by tool.

Use case

  1. Download market data using tinkoff_market_data_collector project
  2. Research data and find an idea for trade strategy using analyze_market_data project
  3. Test and tune your trade strategy using trade_backtesting project
  4. Trade by invest-bot and your own strategy.
  5. Profit!

Example

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.

Logging

All logs are written in logs/analyze.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 tool.

About

Example tool to analyze market data such as candles and trades

Topics

Resources

License

Stars

Watchers

Forks

Languages