본문 바로가기

bitcoin automated trading

[Bitcoin Automated Trading] Developing positive/negative bar discrimination

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

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

Referral Code : 21391362

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

 

The time to buy or sell a stock or coin is mostly when the trend is reversing. There is no problem if a person analyzes the chart and decides the trading direction, but in the case of automatic trading, it is difficult to grasp these points, so there is a lot of profit in sideways trading, but it is difficult to avoid losses if a long black candle comes out due to a sudden trend change. no see. In developing automated trading, you need to consider when to place a trade and when to place a stop. So, let's code the most basic distinction between black and white candlesticks.

We need to get the current candle data to distinguish between the black and white candlesticks. There is a method to get candle data, get_historical_klines_generator , but since it is a method to get candle data based on a point in time, the get_klines method is used. get_klines gets llimit based on current.

I will bring 5 15-minute candlesticks. If the current time is 8:00, 7:00, 7:15, 7:30, 7:45, 8:00 data will be fetched.

Five data were imported at 15-minute intervals.

Put it in a data frame and delete unnecessary data.

Calculating the black and white candlesticks is simple. A black candlestick appears when the closing price is greater than the opening price, and a black candlestick appears when the closing price is less than the opening price.

Four black and four black sticks came out one after another. If you check the actual chart, you will see 4 black and white candles.

 

 

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

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

Referral Code : 21391362

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