https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d9358a09-abfb-4f51-9248-fad50350c86a/USDJPY_iDaily.png

Average True Range(真の値幅の平均)の略で、各バーの高値と安値の値幅を一定期間平均した指標です。価格変動の大きさ(ボラティリティ)を表します。

関数書式

double  iATR(
   string              [symbol](<https://toyolab-fx.notion.site/7010417f6ffc4d43aaca4a8b77bafcfd>),           // 銘柄
   ENUM_TIMEFRAMES     [timeframe](<https://toyolab-fx.notion.site/7010417f6ffc4d43aaca4a8b77bafcfd>),        // 時間軸
   int                 period,           // 計算する期間
   int                 [shift](<https://toyolab-fx.notion.site/7010417f6ffc4d43aaca4a8b77bafcfd>)             // 計算するバーの位置
   );

ATRのパラメータは、計算する期間periodです。

使用例

計算方法

現在のバーにおけるATRATR[0]は、真の値幅TR[i]の単純移動平均をとって求めます。

ATR[0] = SMA(TR[i], period)

TR[i]Max(High[i], Close[i+1]) - Min(Low[i], Close[i+1])(真の値幅)

SMA(TR[i], period)TR[i]の単純移動平均