共用方式為


相對力度指數公式 (Chart 控制項)

相對力度指數 (Relative Strength Index) 公式是一種動量擺動公式,比較收盤價的上漲量與下跌量,並輸出介於 0 到 100 的值。趨近 100 的值表示價格即將下跌,趨近 0 的值表示價格即將上漲。

相對強弱指標 (Relative Strength Index) 的範例圖

公式詳細資料

語法

Chart.DataManipulator.FinancialFormula(
    FinancialFormula.RelativeStrengthIndex,
    "Period,StdDev",
    "Price",
    "UpperBand,LowerBand")

參數

這個公式接受一個選擇性參數。

  • Period
    計算相對力度指數的期間。預設值為 10。

輸入值

這個公式接受一個輸入 Y 值。

  • Price
    計算相對力度指數的收盤價。

輸出值

這個公式輸出一個 Y 值。

  • RSI
    相對力度指數。

備註

折線圖類型是方便顯示公式輸出的圖表類型。

範例

下列範例會從 Series1 的第四個 Y 值接受輸入 (Series1:Y4),然後將相對力度指標輸出至 Series2 (Series2:Y)。它也會指定 15 天期間。

Chart1.DataManipulator.FinancialFormula (FinancialFormula.RelativeStrengthIndex, "15", "Series1:Y4", "Series2:Y")
Chart1.DataManipulator.FinancialFormula (FinancialFormula.RelativeStrengthIndex, "15", "Series1:Y4", "Series2:Y");

請參閱

參考

System.Windows.Forms.DataVisualization.Charting

System.Web.UI.DataVisualization.Charting

其他資源

財務公式

套用公式