Skip to content

Repository files navigation

Binance Candlestick Data

Binance Candlestick Data is a Flask application that allows you to retrieve and save candlestick data from the Binance exchange and display candlestick charts on a web page.

Functionality

  • Retrieve candlestick data for a selected symbol (e.g., BTCUSDT, BNBUSDT, ETHUSDT) and interval (1 day, 4 hours, 1 hour) from the Binance exchange.

The user also has the ability to define the time interval at which the data will be saved in the UI - Save Interval field. By default, the interval will save data every 3600 seconds (1 hour).

I can also suggest adding a distributed task queue method, such as Celery. Additionally, it is possible to add a timer in the UI, which, once configured and activated, will initiate the saving of the specified data.

  • Save the retrieved data to a CSV file (crypto_info/data.csv) and a PostgreSQL database.

Sample image of data stored in DB img_1.png

Sample image of data stored in CSV img_2.png

  • Display a candlestick chart on the main page of the application. img.png

Tech

  • Flask
  • PosgreSQL
  • Docker
  • plotly

Installation via GitHub

To install the application using GitHub, follow these steps:

  1. Navigate to the folder on your computer where you want to clone the project.
  2. Execute the following command:
git clone https://github.com/VladyslavCherkashyn/Binance-Data-Collector-and-Visualization.git
  1. Change into the cloned project directory:
cd Binance-Data-Collector-and-Visualization
  1. Create a virtual environment for the project:
python -m venv venv
  1. Activate the virtual environment:
  • On Windows:
venv\Scripts\activate
  • On macOS:
source venv/bin/activate
  1. Install the dependencies:
pip install -r requirements.txt
  1. Run the bot:
python app.py

Configuration

To work with the application, you need to create a .env file in the project's root folder and set the following environment variables:

(Get free API Key at Binance)

  • ACTUAL_API_KEY: {Your Binance API key}
  • ACTUAL_SECRET_KEY: {Your Binance secret key}
  • POSTGRES_HOST: {PostgreSQL database host}
  • POSTGRES_DB: {PostgreSQL database name}
  • POSTGRES_USER: {PostgreSQL database user}
  • POSTGRES_PASSWORD: {PostgreSQL database password}

Installation via Docker

  • make sure you have installed Docker
  • Run docker-compose up --build

About

This project collects data from Binance API for various symbols and time intervals, and visualizes the data through a Flask-based web application. It provides an easy way to track and analyze cryptocurrency market trends using dynamic charts and market cap pie charts.

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages