加密貨幣 - 情緒指標
在沒有時間盯盤以及頻繁做短線進出情況下,較適合的方式不外乎定期定額,若可以搭配情緒指標,在市場情緒低迷時,可以以較低成本的金額投資商品,並且在市場情高昂時高歌離席。
常見的加密貨幣情緒指標有 恐慌指數(Greed and Fear Index) 與 資金費率(Funding Rate)。這裡介紹另一種觀察市場情緒的指標:應用程式排行。
應用程式排行
原理
加密貨幣交易所發行在行動裝置 iOS 以及 Android 作業系統的應用程式下載量(使用量)可依照其排行而定。若排行越前面,其使用量越高,代表越多用戶參與這個市場。反之排名越後,使用量越低,越少用戶參與市場。
應用程式排行可以充分反應市場情緒,參與市場者越多,象徵市場情緒升溫,隨時有高點反轉的可能,是個警示訊號。反之參與市場者越少,象徵市場情緒過冷,可以適時搭配其他指標進場布局。
這裡使用 Binance 台灣 在 iOS 上的排行為例,以 Python 抓取數據並分析加密市場的情緒熱度。
資料來源
以網站 Sensor Tower 每日公佈的應用程式排行為資料來源,使用 Python 抓取 Binance 台灣在財經類別的排行,分析用戶參與市場的熱度。
數據處理
使用 Python 的 requests 函式庫,爬取網站資料:
url = 'https://app.sensortower.com/api/ios/category/category_history?app_ids%5B%5D=1436799971&categories%5B%5D=6015&categories%5B%5D=0&categories%5B%5D=36&chart_type_ids%5B%5D=topfreeapplications&chart_type_ids%5B%5D=topfreeipadapplications&chart_type_ids%5B%5D=toppaidapplications&countries%5B%5D=TW'
response = requests.get(
url=url
)
轉為 DataFrame 格式:
df = pd.DataFrame(response.json()['1436799971']['TW']['6015']['topfreeapplications']['graphData'], columns=['timestamp', 'rank', 'status'])
df.set_index('timestamp', inplace=True)
df.index = pd.to_datetime(df.index*1000000000, utc=True)
df = df.drop(['status'], axis=1)
我們有興趣的資料欄位需透過 1436799971
, TW
, 6015
, topfreeapplications
以及graphData
索引而得,並且捨去不需要的欄位。
df
呈現的資料如下:
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
分析
繪製排行歷史
df.plot(figsize=[20, 10])
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
由於網站限制存取 2 個月的資料,因此呈現效果有限。剛好手邊有個比較完整的歷史數據如下:
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
在接近 2024 年有一天抓到了排名 500 的資料,推測是當天沒有排名或是沒有抓取到,因此移除此筆並沿用前一日的排名:
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
與 BTC 走勢一起繪製:
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
將排名曲線以 20 日平均繪製,去除雜訊:
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
可以大致看出,排名曲線與比特幣走勢呈現反向。
我們也可以縮進 (zoom in) 至較短的時間區段,觀察走勢,較不易受全局的龐大尺度影響。
- 首先觀察 2017 年底至 2018 年初,此段歷經暴漲與暴跌。
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
可以看到 2017 年底的漲幅,伴隨著使用量上升,象徵用戶積極參與市場。從 2017 年底至 2018 年初,使用量一直維持著名列前茅,而後得跌勢也可以發現使用量大量下滑。
- 2020 年三月至十月,比特幣經歷了暴跌與大幅成長,兩者的走勢出現反向的趨勢。
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
- 2020 年九月至 2022 年 6 月,比特幣連續經歷了兩次 ATH 與 Luna 暴雷事件,兩者的走勢出現反向的趨勢。
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Coinbase 數據
這裡只分析了 Binance 台灣的 iOS 使用情形,同時參考 Coinbase 於美國的使用情形,是否有同樣的走勢:
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
將排名曲線以 20 日平均繪製,去除雜訊:
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
直接觀察 2020 年九月至 2022 年 6 月:
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
可以看出 Coinbase 於美國的使用情形與 Binance 台灣的使用情形相似。
結論
應用程式排行雖無法指出可以精準抄底的時機,但對於逃頂有清楚的指示,且台灣與美國用戶的使用情形相似。
若能再納入 Upbit 於韓國的排行合併較完整的情緒指標。
程式碼連結
首先下載完整的 Binance iOS 應用程式排行:
TW Binance iOS
再至 Colab 連結:
Sentiment analyze
於左方檔案列表新增資料夾,可自行命名,此處以 data 為範例,將以上的應用程式排行檔案移至新增的資料夾。