
目次
ソースコード
//+------------------------------------------------------------------+
//| MTF-ParabolicSAR.mq4 |
//| Copyright 2022,Greeds Co., Ltd. |
//| https://greeds.net |
//+------------------------------------------------------------------+
#property strict
#property indicator_chart_window
#property indicator_color1 DodgerBlue
#property indicator_buffers 1
double Buf1[];
input ENUM_TIMEFRAMES in_timeFrame = PERIOD_CURRENT; // マルチタイムフレーム
input double in_step = 0.02; // ステップ
input double in_maximum = 0.2; // 最大値
input int code1 = 159; // アイコンのコード
int OnInit()
{
SetIndexBuffer(0, Buf1 );
SetIndexStyle(0, DRAW_ARROW , STYLE_SOLID , 3);
SetIndexArrow(0 , code1 );
return( INIT_SUCCEEDED );
}
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
int limit = Bars - prev_calculated;
for(int i=0; i<limit; i++)
{
int shift = iBarShift(NULL, in_timeFrame, time[i]);
double sar = iSAR(NULL,in_timeFrame,in_step,in_maximum,shift);
Buf1[i] = sar;
}
return(rates_total);
}
パラメータ

基本的にMT4標準の入力パラメータと同じにしています。
数値以外の設定項目に関しては、リストボックスで選択可能です。
- マルチタイムフレーム
- 期間
- 適用価格
上記コードで159をセットしている箇所の数字を変えれば好きなアイコンに変更可能です。コード内容はwingdingsで確認ください。
ダウンロード
“MTF-ParabolicSAR” をダウンロード
– 0 回のダウンロード –