Skip to content

A script that allows you to track your own Etherium movements

Notifications You must be signed in to change notification settings

brestok-1/job_trading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ethereum tracking script 📈


I made a script that tracks Ethereum's own movements, without the influence of Bitcoin. Thanks to this project, I got acquainted with the Binance API, as well as with such mathematical concepts as correlation, the level of cointegration, the construction of linear regression models, and many others.

Description


I was given a test task:

  1. You need to determine the price movements of the ETHUSDT futures, excluding movements caused by the influence of the BTCUSDT price. Describe the methodology you chose, the parameters you selected, and why.
  2. Write a Python program that tracks the real-time price of ETHUSDT futures with minimal delay, and using the method you selected, determines its own price movements. When the price changes by 1% in the last 60 minutes, the program outputs a message to the console. The program should continue to run, constantly reading the current price.

I have solved this task. I had to get acquainted with different methods and technologies of Data Science.

Technologies

Languages

Python

Libraries

Python-binance NumPy Pandas Matplotlib

First, I received data from the last 120 BTCUSDT and ETHUSDT klines and convert them to Pandas Dataframe objects. Next, I determined the correlation levels of Pierce and cointegration by taking the closed price data of BTCUSDT as a constant. Next, I created a linear regression model, specifying the BTCUSDT data as a constant, and thus, in the obtained parameters, I determined the level of influence of BTCUSDT on ETHUSDT. Next, I analyzed the model and calculated the predicted effect of BTCUSDT price changes on ETHUSDT price changes by multiplying the BTCUSDT price variables by the factor 'BTC_IMPACT', which represents the force of influence, and built a graph consisting of the price movement of BTCUSDT, ETHUSDT and ETHUSDT's own movements. I got a dataframe with data of my own movements and wrote a function that determines the percentage of price change ETHUSDT.

Project setup

Via virtual environment

  1. Create and activate a python virtual environment
  2. In the terminal, enter the following command:
pip3 install -r requirements.txt
  1. Create a .env file and paste the data from the .env.example file into it
  2. Log in to Binance, go to this page and create a new API key.
  3. Copy the API Key and Secret Key, paste their values into the BINANCE_API_KEY and BINANCE_SECRET_KEY variables.
  4. Run the file main.

Thank you for using my script! 👋

Releases

No releases published

Packages

No packages published

Languages