iAO

iAO-title MQL4リファレンス

iAO

オーサムオシレーター(Awesome Oscillator、AO)
相場の勢いを測る指標

書式

double iAO(
 string symbol, // 通貨
 int timeframe, // 時間足
 int shift // シフト
);

引 数

symbol
 通貨。NULLは現在の通貨を意味します。
timeframe
 時間足。ENUM_TIMEFRAMES列挙値のいずれかを指定できます。0は現在の時間足を意味します。
shift
 現在のバーを起点としたシフト数。0は現在のバーを意味します。

戻り値

オーサムオシレーター(Awesome Oscillator)の値

サンプル

int tempShift05 = iBarShift(NULL, 0, StringToTime(“2023.12.14 05:00”), true);
double result05 = iAO(NULL, 0, tempShift05);
int tempShift06 = iBarShift(NULL, 0, StringToTime(“2023.12.14 06:00”), true);
double result06 = iAO(NULL, 0, tempShift06);
Comment(“現在のiAOを表示します” + “\n”
+ “result05=” + (string)result05 + “\n”
+ “result06=” + (string)result06);

実行結果
iAO-result-plus

※1時間足チャートのAOです。
 ピークである「05:00」足のValue「41.396」の後、「06:00」足のValue「40.446」は
 値が減少した為、06:00足のAOは赤線に切り替わっています。

サンプル

int tempShift09 = iBarShift(NULL, 0, StringToTime(“2023.12.13 09:00”), true);
double result09 = iAO(NULL, 0, tempShift09);
int tempShift10 = iBarShift(NULL, 0, StringToTime(“2023.12.13 10:00”), true);
double result10 = iAO(NULL, 0, tempShift10);
Comment(“現在のiAOを表示します” + “\n”
+ “result09=” + (string)result09 + “\n”
+ “result10=” + (string)result10);

実行結果
iAO-result-minus

※ピークである「09:00」足のValue「-4.741」の後、「10:00」足のValue「-4.424」は
 値が増加した為、10:00足のAOは青線に切り替わっています。

ウィンドウ上は、小数第3位まで表示するよう四捨五入しているようですが、
iAO関数で取得する値は、丸めていません。
もしウィンドウ上のValue値が同じ場合でも、iAO関数で取得した小数第4位以降の値が違えば、
赤線/青線の判定は できますね。

タイトルとURLをコピーしました