icustom Keltner_Channelバンド

私は以下のKeltner_Channel戦略を採用してEAでそのバンドを利用しようとしていますが、mql4で個々のバンドを参照できるようにするのに問題があります(ボリンジャーバンドでできるように)。これまで試してみました、 "KeltnerP = iCustom(NULL、0、" Keltner_Channel "、0,0,0); Bバンドの場合、ハイバンドまたはローバンドを参照するのに6番目のパラメータ(updated_price)を使用できます。 (下記)、カスタム指標を持っていてもそのような運はありません。

STDU = iBands(NULL、0,14,2,0,0,1,0);

#property copyright "Copyright?2005、MetaQuotes Software Corp."
#property link "https://www.metaquotes.net/"

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1赤
#property indicator_color2ブルー
#property indicator_color3 赤
// —-入力パラメータ
外部整数期間= 10。
// —-
二重upper []、middle []、lower []。

// ———————————————– ——————-
// |カスタム指標初期化機能|
// ———————————————– ——————-
int init()
{
SetIndexBuffer(0、上限);
SetIndexStyle(0、DRAW_LINE);
SetIndexShift(0、0);
SetIndexDrawBegin(0、0);
// —-
SetIndexBuffer(1、middle);
SetIndexStyle(1、DRAW_LINE、STYLE_DASHDOT);
SetIndexShift(1、0);
SetIndexDrawBegin(1、0);
// —-
SetIndexBuffer(2、lower);
SetIndexStyle(2、DRAW_LINE);
SetIndexShift 2、0);
SetIndexDrawBegin(2、0);
// —-データウィンドウラベルの名前
SetIndexLabel(0、 "KChanUp(" 期間 ")");
SetIndexLabel(1、 "KChanMid(" 期間 ")");
SetIndexLabel(2、 "KChanLow(" 期間 ")");
// —-
(0)を返します。
}
// ———————————————– ——————-
// |顧客インディケーター脱初期化関数
// ———————————————– ——————-
int deinit()
{
// —-
(0)を返します。
}
// ———————————————– ——————-
// |カスタム指標反復関数
// —————————————– —— ——————-
int start()
{
int制限。
ダブル平均
int count_bars = IndicatorCounted();
if(counts_bars <0)
戻り値(-1)。
if(counts_bars> 0)
counting_bars–;
limit =バー – count_bars。
// —-
for(int x = 0; x <limit; x )
{
middle [x] = iMA(NULL、0、ピリオド、0、MODE_SMA、PRICE_TYPICAL、x)。
avg = findAvg(period、x);
upper [x] = middle [x] avg。
lower [x] = middle [x] – 平均。
}
(0)を返します。
}
// ———————————————– ——————-
// | |
// ———————————————– ——————-
double findAvg(int period、int shift)
{
二重合計= 0。
(int x = shift; x <(shift period); x )
{
sum = High [x] – Low [x]。
}
sum = sum / period;
戻り値(合計)


こんにちはバウアーB

あなたはこれらが必要です。

upper = iCustom(NULL、0、 "Keltner_Channel"、10,0,0);

middle = iCustom(NULL、0、 "Keltner_Channel"、10,1,0);

lower = iCustom(NULL、0、 "Keltner_Channel"、10,2,0);


ルプター:

美しく動作します、ありがとう。

BB


こんにちは、インディケーターRSIにケルトナーチャンネルを適用するにはどうすればいいですか?




4229: https://www.mql5.com/en/forum/119901


Originally posted 2019-08-04 00:59:27.

Translate »