본문 바로가기

bitcoin automated trading

[Bitcoin Automated Trading] Creating Binance MACD

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

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

Referral Code : 21391362

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

 

In this lesson, we will create a MACD indicator in Python.

 

 

1. About MACD auxiliary indicator (refer to Wikipedia)
This is an indicator used for technical analysis of stock prices created by Geraid Appel. As a moving average convergence and divergence index, it is designed to indicate changes in the strength, direction, momentum, and duration of stock trends. MACD is a collection of three time series calculated from historical price data (mostly incremental), these three time series are unique to MACD: “Signal”, “Mean” and “Spread”. MACD is the difference between the long-term exponential moving average and the short-term exponential moving average, and the average is the exponential moving average of MACD itself.

 

 

2. MACD calculation method
MACD = Short-term exponential moving average - Long-term exponential moving average
Signal = K-day exponential moving average of MACD
Histogram = MACD - Signal

 

 

3. MACD programming
Using the ta library, you can easily obtain MACD, signals, and histograms. The histogram can be created by calling the macd_diff method.

 

This is the result.

 

 

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

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

Referral Code : 21391362

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