ETF 基金的相關性
在這個程式練習中,你將透過建立散佈圖,探索兩檔熱門 ETF——SPDR S&P 500(SPY)與 Invesco QQQ——的成交量之間的相關性。開始吧!
已為你載入兩個名為 spy 與 qqq 的 DataFrame,內含上述基金的歷史價格。DataFrames 與 Plots 套件也已匯入並可直接使用。
本練習屬於課程
Julia 資料視覺化入門
練習說明
- 繪製散佈圖:x 軸放 SPY 的交易
volume,y 軸放 QQQ 的交易volume,加入black的迴歸線,linewidth設為2.5、markercolor設為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
____(____)
____(____)