Moving average convergence and divergence is one of the most popular and widely used indicators in secondary market trading. It is mainly based on the exponential moving average to determine the moving trend of the underlying asset.
Components of MACD: Two lines (the MACD line and the signal line), and one histogram.
MACD Line: It is the 12-day exponential moving average (EMA) minus the 26-day exponential moving average. Compared with the simple moving average, the exponential moving average places more emphasis on recent prices and could better reflect price fluctuations in the short term. By utilizing 12-day EMA minus 26-day EMA, MACD line could capture the short term capital flow in a more precise way. If the MACD line is greater than zero, the trend of buying in the short term is relatively stronger.
Signal Line: It is the 9-day exponential moving average of the MACD line. When the MACD line crosses the signal line, it sometimes indicates that the market trend may start to reverse, especially when it occurs in an area far from the zero axis.
Histograms: It vividly captures the difference between MACD line and signal line.
（1M BTC/USD MACD Chart, source form TradingView）
Some common MACD indicators
The histogram goes from negative to positive: Long underlying asset
The histogram goes from positive to negative: Short underlying asset
The MACD line crosses the signal line downwardly: Longs start to close their positions
The signal line crosses the MACD line upwardly： Shorts start to close their positions
(for more information regarding MACD strategy, please go to https://www.investopedia.com/articles/trading/08/macd-stochastic-double-cross.asp)
Introduction of Bonfida’s MACD Strategy Bots
On the explore page, we have created four daily MACD strategy bots of BTC, ETH, SRM and FIDA.
Initial deposits were USDC when those pools were created.
When the histogram goes from negative to positive, the pool will use all its assets to buy the base currency (BTC/ETH/SRM/FIDA).
When the histogram goes from positive to negative, the pool will sell all of the base currency (BTC/ETH/SRM/FIDA).
The order size is 100% of what is available in the pool.
(please kindly note that it’s an immediate-or-cancel order, meaning under the situation of thin liquidity, the order may not get filled completely. The unfilled part would get canceled. )
Now let’s take a close look at the MACD FIDA bot
The automated trading bot was launched in early March, and currently 1 pool token = 0.01 USDC + 0.544 FIDA. When the pool was created, 1 pool token = 1 USDC.
Inception performance is calculated by (current value of LP token — initial value of LP token)/ initial value of LP token. The number stands at 12.9% currently.
The MACD FIDA bot automates trades based on the direction of histogram. If you are interested in this strategy, you can directly deposit LP tokens into the pool. (https://bots.bonfida.org/#/pool/3u6zrpaW9uRfpVqZYwCAiQLvQpiY1JmCCdvZV8ydro4r)
Also, you can refer to the below link for all on-chain transactions done by the pool https://explorer.solana.com/address/G6PRQ1Cu4sNH9AjJq89F47XSYSsAt1toW8BuTgeoCpPr
For those who want to build their own MACD bots, and want to use the MACD line or the signal line as trading alerts, please kindly refer to our video tutorial and integrate those indicators with TradingView. https://www.youtube.com/watch?v=6BFmyi0qnEI&t=1s
Bonfida Bots documentation: https://bonfida.github.io/bonfida-bot-docs/