Skip to content

A Python project for downloading OHLCV data for ticker pairs in various exchanges, providing source data for backtesting software and trading bots.

License

Notifications You must be signed in to change notification settings

leolorenzato/CTMP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CTMP - Crypto Tickers Market Price

The Repository

This repository is where CTMP it's developed together with the help of the community. This source code is available to everyone under the standard MIT license.

CTMP

CTMP is an application developed in Python3 that helps people to download OHLCV market data for various ticker pairs. Dowloaded OHLCV data is saved in SQLite databases, ready to be used by backtesting software, or, generally speaking, by providing source data for trading algorithms. Users can also use downloaded data to perform various type of statistics on tickers' market price/volume. This project implements CCXT library, or other trading libraries to retreive data from exchanges.

It runs on Windows, macOS, and Linux. To get the latest release check out the Releases section.

Features

Supported exchanges in this early release are:

Thanks to CCXT, many other exchanges are really easy to implement.

Supported markets are:

Supported ticker pairs are:

  • Binance:
    • BTC/USDT: spot and future perpetuals
    • ETH/USDT: spot and future perpetuals
  • ByBit:
    • BTC/USDT: spot and future perpetuals
    • ETH/USDT, spot and future perpetuals
  • Bitfinex:
    • BTC/USDT: spot
    • ETH/USDT: spot

Many other ticker pairs will be supported soon. Your contribution in implementing other exchanges or ticker pairs would be really appreciated. Try and check out how easy it will be!

Supported timeframes for all tickers are:

  • 1 minute (1m)
  • 1 hour (1h)
  • 1 day (1d)

Running the code

In the project folder run on your terminal:

pip install -r requirements.txt

to install dependecies.
Edit the main.json file located inside the folder

/params

An example of the main.json file could be the following:

{
    "tickers": 
    [
        "Binance_spot_BTC_USDT_1h",
        "ByBit_futureperp_ETH_USDT_1h",
        "Bitfinex_spot_BTC_USDT_1m",
        "ByBit_spot_ETH_USDT_1d"
    ]
}

Then just run the main file:

python3 main.py

Results will be saved inside directories located at:

 /db

Tickers' .json files which contain ticker pairs' parameters used to download OHLCV data are located at:

/params/exchanges

Logs

All logs are showed in the terminal.

Market types in logs follow this notation:

  • spot: AAA/BBB (ex. BTC/USDT)
  • future perpetuals: AAA/BBB:BBB (ex. BTC/USDT:USDT)

Contributing

This project is not complete at all, it could have bugs and lots of new features to add (exchanges, tickers, ...).
It can be a powerful tool for anyone who wants to backtest a trading algorithm with millions of market price data or to run their own trading bot providing new data each minute, hour or day.
If you find this tool useful you can participate in many ways, for example:

License

Copyright (c) Leonardo Lorenzato. All rights reserved.

Licensed under the MIT license.