開始使用免費開始

ETF 基金的相關性

在這個程式練習中,你將透過建立散佈圖,探索兩檔熱門 ETF——SPDR S&P 500(SPY)與 Invesco QQQ——的成交量之間的相關性。開始吧!

已為你載入兩個名為 spyqqq 的 DataFrame,內含上述基金的歷史價格。DataFramesPlots 套件也已匯入並可直接使用。

本練習屬於課程

Julia 資料視覺化入門

檢視課程

練習說明

  • 繪製散佈圖:x 軸放 SPY 的交易 volume,y 軸放 QQQ 的交易 volume,加入 black 的迴歸線,linewidth 設為 2.5markercolor 設為 pink,並隱藏圖例。
  • 在散佈圖上新增標題:"Correlation Between SPY & QQQ Traded Volumes"
  • 將 x 軸標示為 "SPY Daily Traded Volume",y 軸標示為 "QQQ Daily Traded Volume"

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Make a scatter plot
____(
	____.____,
    ____.____,
    smooth=____,
    linewidth=____,
    linecolor=:____,
    label=____,
    markercolor=:____
)
# Add a title to the figure
____(____)
# Label the x and y axes
____(____)
____(____)
編輯並執行程式碼