トレンド強度-相関オシレータ単品と同じ値段で周期解析がついてきます。
トレンド・周期解析を組み合わせて相場を制する!

またさらに、予測移動平均ボリンジャーバンドとのセット販売も開始しました。単品で購入するよりお買い得となっていますので、よろしければ、こちらもご検討ください。
価格の行き過ぎ、トレンド、周期を確認して相場を制するセット






//+------------------------------------------------------------------+
//| MyOtherTimeMA.mq4 |
//| Heecho |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Heecho"
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#property indicator_chart_window
// バッファーを指定する。
#property indicator_buffers 1
// プロット数を指定する。
#property indicator_plots 1
#property indicator_label1 "OtherTimeMA"
#property indicator_type1 DRAW_LINE
#property indicator_color1 clrRed
#property indicator_style1 STYLE_SOLID
#property indicator_width1 1
// 他時間の移動平均線
double ma[];
input ENUM_TIMEFRAMES MATimeframe = PERIOD_H1;
// 他時間の移動平均線のタイプ
input ENUM_MA_METHOD MAType = MODE_EMA;
// 他時間の価格種別
input ENUM_APPLIED_PRICE MAPrice = PRICE_CLOSE;
// 他時間の移動平均線を求めるバーの数
input int MAPeriod = 10;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
if ( MAPeriod <= 0 )
{
return INIT_PARAMETERS_INCORRECT;
}
SetIndexBuffer( 0, ma );
IndicatorShortName( "OtherTimeMA" );
return INIT_SUCCEEDED;
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
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 period = Period();
if ( period > MATimeframe )
{
return rates_total;
}
for ( int i = rates_total - prev_calculated - 1; i >= 0; i-- )
{
int index = iBarShift( NULL, MATimeframe, time[ i ] );
double val = iMA( NULL, MATimeframe, MAPeriod, 0, MAType, MAPrice, index );
if ( val != ma[ i ] )
{
ma[ i ] = val;
for ( int j = 1; 1; j++ )
{
if ( i + j >= rates_total )
{
break;
}
int index2 = iBarShift( NULL, MATimeframe, time[ i + j ] );
if ( index != index2 )
{
break;
}
ma[ i + j ] = val;
}
}
}
return rates_total - 1;
}















