
目次
パラメータ

上記コードで159をセットしている箇所の数字を変えれば好きなアイコンに変更可能です。
コード内容はwingdingsで確認ください。
ソースコード
//+------------------------------------------------------------------+
//| MTF-Fractals.mq4 |
//| Copyright 2022,Greeds Co., Ltd. |
//| https://greeds.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022,Greeds Co., Ltd."
#property link "https://greeds.net"
#property version "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
double Buf1[];
double Buf2[];
input ENUM_TIMEFRAMES timeFrame = PERIOD_CURRENT; // マルチタイムフレーム
input int code1 = 159; // 上アイコンのコード
input int code2 = 159; // 下アイコンのコード
input color in_color =Red; // 色
int OnInit()
{
SetIndexBuffer(0, Buf1 );
SetIndexBuffer(1, Buf2 );
SetIndexArrow(0 , code1 );
SetIndexArrow(1 , code2 );
SetIndexStyle(0, DRAW_ARROW , STYLE_SOLID , 5 ,in_color);
SetIndexStyle(1, DRAW_ARROW , STYLE_SOLID , 5 ,in_color);
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, timeFrame, time[i]);
double uf = iFractals(NULL, timeFrame, MODE_UPPER, shift);
double lf = iFractals(NULL, timeFrame, MODE_LOWER, shift);
Buf1[i] = uf;
Buf2[i] = lf;
}
return(rates_total);
}
ダウンロード
“MTF-Fractals” をダウンロード
MTF-Fractals-2.ex4 – 31 回のダウンロード – 10.54 KB