What Idea about Crypto MACD Quadrant ?
The Crypto MACD Quadrant Chart represents an overhead analysis of MACD, including multiple cryptocurrencies in a single chart.
First, import the necessary libraries and dataset:
import pandas as pd
import yfinance as yf
import pandas_ta as ta
Create a ticker list and download data with a 2-day period and 1-day interval from Yahoo Finance:
ticker_list = ['ETH-USD','BNB-USD',
'MATIC-USD','SOL-USD',
'STETH-USD',
'APE18876-USD','APT21794-USD','RPL-USD','MINA-USD','GMX11857-USD']
data=yf.download(ticker_list,period='2y',interval='1d',group_by='column')
data.fillna(method='ffill',inplace=True)
data
[*********************100%***********************] 10 of 10 completed
Adj Close | … | Volume | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
APE18876-USD | APT21794-USD | BNB-USD | ETH-USD | GMX11857-USD | MATIC-USD | MINA-USD | RPL-USD | SOL-USD | STETH-USD | … | |||||||||||
Date | |||||||||||||||||||||
2021-03-05 | NaN | NaN | 226.372559 | 1533.275024 | NaN | 0.215171 | NaN | 9.587042 | 12.610443 | 1487.038452 | … | ||||||||||
2021-03-06 | NaN | NaN | 226.666855 | 1654.741577 | NaN | 0.212986 | NaN | 11.096388 | 13.036458 | 1598.337280 | … | ||||||||||
2021-03-07 | NaN | NaN | 240.179214 | 1723.153809 | NaN | 0.212243 | NaN | 11.574694 | 13.877732 | 1635.332031 | … | ||||||||||
2021-03-08 | NaN | NaN | 240.318665 | 1834.727905 | NaN | 0.216622 | NaN | 11.501017 | 13.602188 | 1782.575073 | … | ||||||||||
2021-03-09 | NaN | NaN | 293.463226 | 1868.048828 | NaN | 0.298981 | NaN | 11.463948 | 14.846311 | 1828.224976 | … | ||||||||||
… | … | … | … | … | … | … | … | … | … | … | |||||||||||
2023-03-01 | 5.079369 | 13.468860 | 302.907471 | 1663.433716 | 76.884392 | 1.248236 | 0.987073 | 47.010098 | 22.506432 | 1654.108276 | … | ||||||||||
2023-03-02 | 4.988062 | 12.849195 | 299.946167 | 1647.319336 | 72.696312 | 1.224773 | 0.975576 | 44.179371 | 21.984879 | 1634.482910 | … | ||||||||||
2023-03-03 | 4.796895 | 11.733995 | 290.282837 | 1569.167603 | 67.885429 | 1.167757 | 0.880477 | 41.080841 | 21.399353 | 1564.199707 | … | ||||||||||
2023-03-04 | 4.740286 | 11.285681 | 289.503876 | 1566.923950 | 65.682594 | 1.126445 | 0.823928 | 39.204273 | 20.966839 | 1560.422241 | … | ||||||||||
2023-03-05 | 4.827668 | 11.350739 | 290.976166 | 1570.858398 | 68.485413 | 1.140472 | 0.834682 | 40.372326 | 21.251341 | 1560.697998 | … |
731 rows × 60 columns
Stack and sort the data:
df=data.stack()
df=df.sort_index(level=1)
df.index.names=['Date','Crypto']
df
Adj Close | Close | High | Low | Open | Volume | ||
---|---|---|---|---|---|---|---|
Date | Crypto | ||||||
2022-03-18 | APE18876-USD | 12.962820 | 12.962820 | 17.754013 | 8.530408 | 8.530408 | 8.934642e+09 |
2022-03-19 | APE18876-USD | 11.564206 | 11.564206 | 14.543621 | 11.515112 | 13.001595 | 2.837336e+09 |
2022-03-20 | APE18876-USD | 9.603505 | 9.603505 | 11.905575 | 9.536022 | 11.613140 | 2.048782e+09 |
2022-03-21 | APE18876-USD | 10.495659 | 10.495659 | 10.981939 | 9.593103 | 9.604387 | 2.104739e+09 |
2022-03-22 | APE18876-USD | 12.264291 | 12.264291 | 12.539398 | 10.264086 | 10.526184 | 2.496987e+09 |
… | … | … | … | … | … | … | … |
2023-03-01 | STETH-USD | 1654.108276 | 1654.108276 | 1654.108276 | 1603.750366 | 1606.542847 | 8.079148e+06 |
2023-03-02 | STETH-USD | 1634.482910 | 1634.482910 | 1656.544922 | 1618.158813 | 1654.072021 | 1.228412e+07 |
2023-03-03 | STETH-USD | 1564.199707 | 1564.199707 | 1637.809082 | 1554.247559 | 1634.432983 | 1.160703e+07 |
2023-03-04 | STETH-USD | 1560.422241 | 1560.422241 | 1576.032837 | 1552.539673 | 1563.850220 | 5.734705e+06 |
2023-03-05 | STETH-USD | 1560.697998 | 1560.697998 | 1574.151733 | 1556.519653 | 1559.845459 | 4.187357e+06 |
6058 rows × 6 columns
Reset the index and apply the MACD indicator:
df2=df.reset_index().set_index('Crypto')
df2.ta.macd(append=True)
df2
Date | Adj Close | Close | High | Low | Open | Volume | MACD_12_26_9 | MACDh_12_26_9 | MACDs_12_26_9 | |
---|---|---|---|---|---|---|---|---|---|---|
Crypto | ||||||||||
APE18876-USD | 2022-03-18 | 12.962820 | 12.962820 | 17.754013 | 8.530408 | 8.530408 | 8.934642e+09 | NaN | NaN | NaN |
APE18876-USD | 2022-03-19 | 11.564206 | 11.564206 | 14.543621 | 11.515112 | 13.001595 | 2.837336e+09 | NaN | NaN | NaN |
APE18876-USD | 2022-03-20 | 9.603505 | 9.603505 | 11.905575 | 9.536022 | 11.613140 | 2.048782e+09 | NaN | NaN | NaN |
APE18876-USD | 2022-03-21 | 10.495659 | 10.495659 | 10.981939 | 9.593103 | 9.604387 | 2.104739e+09 | NaN | NaN | NaN |
APE18876-USD | 2022-03-22 | 12.264291 | 12.264291 | 12.539398 | 10.264086 | 10.526184 | 2.496987e+09 | NaN | NaN | NaN |
… | … | … | … | … | … | … | … | … | … | … |
STETH-USD | 2023-03-01 | 1654.108276 | 1654.108276 | 1654.108276 | 1603.750366 | 1606.542847 | 8.079148e+06 | 19.224583 | -3.993186 | 23.217769 |
STETH-USD | 2023-03-02 | 1634.482910 | 1634.482910 | 1656.544922 | 1618.158813 | 1654.072021 | 1.228412e+07 | 18.686858 | -3.624730 | 22.311587 |
STETH-USD | 2023-03-03 | 1564.199707 | 1564.199707 | 1637.809082 | 1554.247559 | 1634.432983 | 1.160703e+07 | 12.445969 | -7.892494 | 20.338463 |
STETH-USD | 2023-03-04 | 1560.422241 | 1560.422241 | 1576.032837 | 1552.539673 | 1563.850220 | 5.734705e+06 | 7.113214 | -10.580200 | 17.693414 |
STETH-USD | 2023-03-05 | 1560.697998 | 1560.697998 | 1574.151733 | 1556.519653 | 1559.845459 | 4.187357e+06 | 2.876064 | -11.853879 | 14.729944 |
6058 rows × 10 columns
set date index
df3=df2.reset_index().set_index('Date')
df3
Crypto | Adj Close | Close | High | Low | Open | Volume | MACD_12_26_9 | MACDh_12_26_9 | MACDs_12_26_9 | |
---|---|---|---|---|---|---|---|---|---|---|
Date | ||||||||||
2022-03-18 | APE18876-USD | 12.962820 | 12.962820 | 17.754013 | 8.530408 | 8.530408 | 8.934642e+09 | NaN | NaN | NaN |
2022-03-19 | APE18876-USD | 11.564206 | 11.564206 | 14.543621 | 11.515112 | 13.001595 | 2.837336e+09 | NaN | NaN | NaN |
2022-03-20 | APE18876-USD | 9.603505 | 9.603505 | 11.905575 | 9.536022 | 11.613140 | 2.048782e+09 | NaN | NaN | NaN |
2022-03-21 | APE18876-USD | 10.495659 | 10.495659 | 10.981939 | 9.593103 | 9.604387 | 2.104739e+09 | NaN | NaN | NaN |
2022-03-22 | APE18876-USD | 12.264291 | 12.264291 | 12.539398 | 10.264086 | 10.526184 | 2.496987e+09 | NaN | NaN | NaN |
… | … | … | … | … | … | … | … | … | … | … |
2023-03-01 | STETH-USD | 1654.108276 | 1654.108276 | 1654.108276 | 1603.750366 | 1606.542847 | 8.079148e+06 | 19.224583 | -3.993186 | 23.217769 |
2023-03-02 | STETH-USD | 1634.482910 | 1634.482910 | 1656.544922 | 1618.158813 | 1654.072021 | 1.228412e+07 | 18.686858 | -3.624730 | 22.311587 |
2023-03-03 | STETH-USD | 1564.199707 | 1564.199707 | 1637.809082 | 1554.247559 | 1634.432983 | 1.160703e+07 | 12.445969 | -7.892494 | 20.338463 |
2023-03-04 | STETH-USD | 1560.422241 | 1560.422241 | 1576.032837 | 1552.539673 | 1563.850220 | 5.734705e+06 | 7.113214 | -10.580200 | 17.693414 |
2023-03-05 | STETH-USD | 1560.697998 | 1560.697998 | 1574.151733 | 1556.519653 | 1559.845459 | 4.187357e+06 | 2.876064 | -11.853879 | 14.729944 |
6058 rows × 10 columns
Rename the columns for better readability:
df3['Crypto'] = df3['Crypto'].replace(['APE18876-USD', 'GMX11857-USD', 'APT21794-USD','STETH-USD'], ['APE-USD', 'GMX-USD', 'APT-USD','LIDO-USD'])
df4=df3.loc['2023-03-02']
df4
Crypto | Adj Close | Close | High | Low | Open | Volume | MACD_12_26_9 | MACDh_12_26_9 | MACDs_12_26_9 | |
---|---|---|---|---|---|---|---|---|---|---|
Date | ||||||||||
2023-03-02 | APE-USD | 4.988062 | 4.988062 | 5.104061 | 4.921388 | 5.079257 | 9.000440e+07 | -0.104042 | -0.059181 | -0.044860 |
2023-03-02 | APT-USD | 12.849195 | 12.849195 | 13.642705 | 12.571703 | 13.466647 | 5.861577e+08 | -0.308790 | -0.211423 | -0.097368 |
2023-03-02 | BNB-USD | 299.946167 | 299.946167 | 303.554169 | 296.519165 | 302.916107 | 3.705169e+08 | -1.571700 | -1.541174 | -0.030525 |
2023-03-02 | ETH-USD | 1647.319336 | 1647.319336 | 1672.051147 | 1622.599976 | 1663.549072 | 7.080951e+09 | 15.701750 | -4.316912 | 20.018662 |
2023-03-02 | GMX-USD | 72.696312 | 72.696312 | 77.671501 | 70.998405 | 76.880371 | 5.926574e+07 | 2.728219 | -1.062914 | 3.791132 |
2023-03-02 | MATIC-USD | 1.224773 | 1.224773 | 1.251312 | 1.194467 | 1.248277 | 3.711185e+08 | 0.011767 | -0.030469 | 0.042236 |
2023-03-02 | MINA-USD | 0.975576 | 0.975576 | 1.029503 | 0.937374 | 0.986832 | 8.006786e+07 | 0.035254 | -0.018854 | 0.054108 |
2023-03-02 | RPL-USD | 44.179371 | 44.179371 | 47.090614 | 42.897507 | 47.002228 | 1.258407e+07 | 1.549927 | -0.966228 | 2.516155 |
2023-03-02 | SOL-USD | 21.984879 | 21.984879 | 22.575216 | 21.732510 | 22.505314 | 3.225454e+08 | 0.018106 | -0.272208 | 0.290314 |
2023-03-02 | LIDO-USD | 1634.482910 | 1634.482910 | 1656.544922 | 1618.158813 | 1654.072021 | 1.228412e+07 | 18.686858 | -3.624730 | 22.311587 |
visulization section
import plotly.express as px
fig = px.scatter(df4,x='MACD_12_26_9',y='MACDh_12_26_9',color='Crypto',text='Crypto',hover_data=['Crypto','Close'],title='RSI Quadrant : CRYPTO 10 TOKEN')
fig.update_traces(marker={'size':14})
fig.update_traces(textposition='top center')
fig.add_vline(x=0,line_color="red")
fig.add_hline(y=0,line_color="red")
fig.show()
This code provides a comprehensive overview of the MACD values for various cryptocurrencies in a single chart, allowing for easier analysis and comparison.
Conclusion
In conclusion, the Crypto MACD Quadrant Chart provides a comprehensive and efficient way to analyze the performance of multiple cryptocurrencies in a single visual representation. By incorporating MACD indicators, the chart offers valuable insights into the market momentum and potential trend reversals, enabling investors to make informed decisions when trading or investing in cryptocurrencies.
The benefits of using the Crypto MACD Quadrant Chart include:
Time-saving: Instead of analyzing individual charts for each cryptocurrency, the quadrant chart consolidates the information, allowing for a quick and efficient overview of market trends.
Enhanced decision-making: By utilizing the MACD indicator, the chart provides valuable information on market momentum, enabling investors to identify potential buy or sell signals.
Comparative analysis: The quadrant chart allows for easy comparison of the performance of various cryptocurrencies,
Improved risk management: By gaining a better understanding of market trends and momentum, investors can develop more effective risk management strategies and protect their investments from potential losses.