
目次
ソースコード
//+------------------------------------------------------------------+
//| MTF-Alligator.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 3
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 Lime
double Buf1[];
double Buf2[];
double Buf3[];
input ENUM_TIMEFRAMES in_timeFrame = PERIOD_CURRENT; // マルチタイムフレーム
input int InpJawsPeriod=13; // ジョーライン平均期間
input int InpJawsShift=8; // ジョーラインシフト
input int InpTeethPeriod=8; // トゥースライン平均期間
input int InpTeethShift=5; // トゥースラインシフト
input int InpLipsPeriod=5; // リップライン平均期間
input int InpLipsShift=3; // リップラインシフト
int OnInit()
{
SetIndexBuffer(0, Buf1 );
SetIndexBuffer(1, Buf2 );
SetIndexBuffer(2, Buf3 );
SetIndexShift(0,InpJawsShift);
SetIndexShift(1,InpTeethShift);
SetIndexShift(2,InpLipsShift);
SetIndexDrawBegin(0,InpJawsShift+InpJawsPeriod);
SetIndexDrawBegin(1,InpTeethShift+InpTeethPeriod);
SetIndexDrawBegin(2,InpLipsShift+InpLipsPeriod);
SetIndexStyle(0, DRAW_LINE , STYLE_SOLID , 1 );
SetIndexStyle(1, DRAW_LINE , STYLE_SOLID , 1 );
SetIndexStyle(2, DRAW_LINE , STYLE_SOLID , 1 );
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]);
int JawsShift=InpJawsShift;
int TeethShift=InpTeethShift;
int LipsShift=InpLipsShift;
if(JawsShift*Period()>in_timeFrame && in_timeFrame != NULL)
JawsShift = JawsShift*Period()/in_timeFrame;
if(TeethShift*Period()>in_timeFrame && in_timeFrame != NULL)
TeethShift = TeethShift*Period()/in_timeFrame;
if(LipsShift*Period()>in_timeFrame && in_timeFrame != NULL)
LipsShift = LipsShift*Period()/in_timeFrame;
double jaw = iAlligator(NULL,in_timeFrame,InpJawsPeriod,InpJawsShift,InpTeethPeriod,InpTeethShift,InpLipsPeriod,InpLipsShift,MODE_SMMA,PRICE_MEDIAN,MODE_GATORJAW,shift-JawsShift);
double teeth = iAlligator(NULL,in_timeFrame,InpJawsPeriod,InpJawsShift,InpTeethPeriod,InpTeethShift,InpLipsPeriod,InpLipsShift,MODE_SMMA,PRICE_MEDIAN,MODE_GATORTEETH,shift-TeethShift);
double lips = iAlligator(NULL,in_timeFrame,InpJawsPeriod,InpJawsShift,InpTeethPeriod,InpTeethShift,InpLipsPeriod,InpLipsShift,MODE_SMMA,PRICE_MEDIAN,MODE_GATORLIPS,shift-LipsShift);
Buf1[i] = jaw;
Buf2[i] = teeth;
Buf3[i] = lips;
}
return(rates_total);
}
パラメータ

基本的にMT4標準の入力パラメータと同じにしています。
数値以外の設定項目に関しては、リストボックスで選択可能です。
- マルチタイムフレーム
- ジョーライン平均期間
- トゥースライン平均期間
- トゥースラインシフト
- リップライン平均期間
- リップラインシフト
ダウンロード
“MTF-Alligator” をダウンロード
MTF-Alligator-2.ex4 – 28 回のダウンロード – 13.05 KB