본문 바로가기

카테고리 없음

[Bitcoin Automated Trading] Automatically trade all coins using Upbit RSI

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

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

Referral Code : 21391362

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

 

This time, we will use RSI to automatically trade all coins listed on Upbit. The only difference is the Upbit API, but other technical aspects are the same as Binance. You can make it quickly by modifying the code created in Binance just a little.

 

※ Be careful because Upbit has a smaller query volume per second/minute than Binance.

 

 

1. reset

Call the /v1/market/all API to get a list of all coins. Among them, there are KRW and BTC markets, but since I plan to trade only the KRW market, I only filter coins that start with KRW.

Call the /vr/orders/chance API to get coin information. Find and save the won value needed for trading. And to filter only coins that can be traded, only coins with a status value of active are filtered.

 

 

2. RSI Scheduler

Find the RSI of all coins saved in 1. The formula for calculating RSI is the same as Binance. The difference is that Upbit can only retrieve a maximum of 200 pieces of data. And since the data is imported in order of latest date, the data must be sorted by oldest date.

 

The RSI calculation numbers were conservative. The window value was set to 21 based on 1hour bars. (windows default 14)

Run the scheduler so that RSI is calculated every minute.

 

 

3. uy logic

It is possible to purchase only with a minimum quantity, but since there is a commission, sales are made without the commission. Then, selling is impossible due to insufficient minimum quantity. Therefore, the additional quantity must be adjusted to the minimum quantity. You can double or triple the minimum trading quantity calculated earlier.

 

When the purchase is completed, a flag value is given so that the coin can proceed to the sell logic.

 

 

4. sell logic

Obtain the entire quantity of the coin in your current wallet and sell it at the market price. When the sale is completed, a flag value is given so that the coin can proceed to the purchase logic again.

 

 

5. main logic

Check the RSI of all coins and proceed with buy/sell logic according to conditions.

 

 

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

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

Referral Code : 21391362

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