본문 바로가기

bitcoin automated trading

[Bitcoin Automated Trading] Determining transaction outliers on Binance and Upbit

------------------------------------------------------------------------------------------------------------------

https://accounts.binance.com/register?ref=21391362 <- Get Discount on Binance Futures Fees With Referral Code

Referral Code : 21391362

------------------------------------------------------------------------------------------------------------------

 

If you look at the chart, there are cases where the trading volume suddenly surges and the chart rises sharply. This is usually seen in an accumulation pattern after a sharp drop. You can search for multiple stocks to find charts with rapid increases in trading volume and set a buying point that matches the chart pattern you think of.

 

It is essential because it is a basic technical part when creating chart patterns in the future. Let's do programming to determine outliers when there are sudden changes in trading volume and price. There are several algorithms, and we will use sklearn's IsolcationForest to learn and retrieve the data.

 

 

1. binance

 

n the following picture, we will look for areas where volume and price have changed significantly, and we will retrieve candle data belonging to the corresponding picture area.

The area corresponding to the picture above is 2023/09/27 17:00:00 ~ 2023/10/02 07:00:00 on a 1-hour chart.

Because the time is displayed in UTC, it is inconvenient to view, so use the apply function to convert all times into an easy to read format. And if you use the closing price as is, you will find abnormally rising or falling prices within the currently collected closing prices. What we want is data that has risen momentarily, but if data that increases slowly occurs, we may get unwanted results, so we use the deviation from the previous closing price as the data.

 

Call the shift method to shift the rows one space at a time and find the difference between the current closing price and the previous closing price.

Only the closing price deviation and transaction volume data are extracted and standardized. And in order to focus on trading volume rather than the deviation of the closing price, the weight was set to 2 times.

Create an Isolation Forest model and train it. The important thing here is the contamination value. The smaller this value, the more outlier values are found. You can find outliers by adjusting contamination and weight.

If trading volume explodes in a negative candle, there is a high probability that it will fall, so negative candles are excluded.

If you check the results, only high volumes appear as outlier data.

 

2. upbit

Upbit method is the same as Binance's, although the method of importing data is slightly different.

Since the data label name is different from Binance, we will set it to be the same as Binance.

ther than that, the code is the same.

This is the result.

 

------------------------------------------------------------------------------------------------------------------

https://accounts.binance.com/register?ref=21391362 <- Get Discount on Binance Futures Fees With Referral Code

Referral Code : 21391362

------------------------------------------------------------------------------------------------------------------