移動平均 - ページ 105

 
person77:
ファンタスティック - 非常によくmladenを動作しますありがとうございました。

ご迷惑でなければ、いくつかお願いがあります。

1. 4本のMAが同調しているときに、価格が後退して指定されたMAにタッチした場合。

(この場合、2番目に短いMAである赤の15EMA)矢印とアラートを出して欲しい。

その後、小さい1Mの時間枠に変更し、そこでショートのシグナルを探します。

私は水平線と垂直線を挿入し、小さい1Mの時間枠のバックテストでどこ(ポイントA)を見るべきか簡単に分かるようにしている。

2. ヒストグラム・バーを表示するために、4マ・シンク・インディに2つか3つのマがシンクロしていることだけを探すように依頼できますか?(ここでやろうとしていることは、1Mの条件添付を参照してください。)

人77

このインジケータはプライスタッチを表示するように設計、予測されていないのが残念です。また、そのようなインジケータは既に存在すると思います。

2,3masバージョン:"if (ma1<ma2 && ma2<3" ...などのような比較を参照しているコードの""を"="に置き換え、3つの異なるmasまたは同じ値に2つのmasのペアを設定すると、インディケータで2masが表示されるようになります。

 

mladen

ご指摘ありがとうございます。

私のコーディングは役に立たないに等しいです

私は>と<を=に変更しましたが、コンパイル時にいくつかのエラーが発生しました。

何か違うことをする必要があるのでしょうか?

//------------------------------------------------------------------

#property copyright "www.forex-tsd.com"

#property link "www.forex-tsd.com"

//------------------------------------------------------------------

#property indicator_separate_window (インジケータ分離ウィンドウ)

#property indicator_buffers 2 (インジケーターバッファー2)

#property indicator_color1 LimeGreen (インジケーターカラー1)

#property indicator_color2 ダークオレンジ

#property indicator_width1 2 (プロパティインジケータ幅1)

#property indicator_width2 2 (インジケータ幅2

#property indicator_minimum 0

#プロパティ indicator_maximum 1

extern int Ma1Period = 5;

extern int Ma1Price = PRICE_CLOSE;

extern int Ma1Method = MODE_EMA;

extern int Ma1Shift = 0;

extern int Ma2Period = 15;

extern int Ma2Price = PRICE_CLOSE;

extern int Ma2Method = MODE_EMA; extern int Ma2Price = PRICE_CLOSE; extern int Ma2Method = MODE_EMA;

extern int Ma2Shift = 0;

extern int Ma3Period = 28;

extern int Ma3Price = PRICE_CLOSE;

extern int Ma3Method = MODE_EMA; extern int Ma3Price = PRICE_CLOSE; extern int Ma3Method = MODE_EMA;

extern int Ma3Shift = 0;

extern int Ma4Period = 45;

extern int Ma4Price = PRICE_CLOSE;

extern int Ma4Method = MODE_EMA; extern int Ma4Price = PRICE_CLOSE; extern int Ma4Method = MODE_EMA;

extern int Ma4Shift = 0;

//

//

//

//

//

double histu[];

double histd[];

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

int init()

{

SetIndexBuffer(0,histu); SetIndexStyle(0,DRAW_HISTOGRAM);

SetIndexBuffer(1,histd); SetIndexStyle(1,DRAW_HISTOGRAM)を設定します.

return(0);

}

int deinit() { return(0); }.

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

int start()

{

int counted_bars = IndicatorCounted();

if (counted_bars < 0) return(-1);

if (counted_bars > 0) counted_bars--;

int limit = MathMin(Bars-counted_bars,Bars-1);

//

//

//

//

//

for(int i = limit; i >=0; i--)

{

double ma1 = iMA(NULL,0,Ma1Period,Ma1Shift,Ma1Method,Ma1Price,i)。

double ma2 = iMA(NULL,0,Ma2Period,Ma2Shift,Ma2Method,Ma2Price,i).とする。

double ma3 = iMA(NULL,0,Ma3Period,Ma3Shift,Ma3Method,Ma3Price,i); double ma3 = iMA(NULL,0,Ma3Shift,Ma3Method,Ma3Pricase,i);

double ma4 = iMA(NULL,0,Ma4Period,Ma4Shift,Ma4Method,Ma4Price,i); double ma4 = iMA(NULL,0,Ma4Shift,Ma4Method,Ma4Pricase,i);

histu =EMPTY_VALUE;

histd = EMPTY_VALUE; histd = EMPTY_VALUE;

if(ma1=ma2 && ma2=ma3&& ma3>ma4) histu = 1;

if(ma1=ma2 && ma2=ma3&& ma3<ma4) histd = 1;

}

return(0);

}

 

こんにちは

MAを使った2分足のrenkoチャートはどうでしょうか?

よろしくお願いします。

 
person77:
mladen

ご指摘ありがとうございます。

私のコーディングは役に立たないに等しいです

私は>と<を=に変更しましたが、コンパイル時にいくつかのエラーが発生しました。

何か違うことをする必要があるのでしょうか?

//------------------------------------------------------------------

#property copyright "www.forex-tsd.com"

#property link "www.forex-tsd.com"

//------------------------------------------------------------------

#property indicator_separate_window (インジケータ分離ウィンドウ)

#property indicator_buffers 2 (インジケーターバッファー2)

#property indicator_color1 LimeGreen (インジケーターカラー1)

#property indicator_color2 ダークオレンジ

#property indicator_width1 2 (プロパティインジケータ幅1)

#property indicator_width2 2 (インジケータ幅2

#property indicator_minimum 0

#プロパティ indicator_maximum 1

extern int Ma1Period = 5;

extern int Ma1Price = PRICE_CLOSE;

extern int Ma1Method = MODE_EMA;

extern int Ma1Shift = 0;

extern int Ma2Period = 15;

extern int Ma2Price = PRICE_CLOSE;

extern int Ma2Method = MODE_EMA; extern int Ma2Price = PRICE_CLOSE; extern int Ma2Method = MODE_EMA;

extern int Ma2Shift = 0;

extern int Ma3Period = 28;

extern int Ma3Price = PRICE_CLOSE;

extern int Ma3Method = MODE_EMA; extern int Ma3Price = PRICE_CLOSE; extern int Ma3Method = MODE_EMA;

extern int Ma3Shift = 0;

extern int Ma4Period = 45;

extern int Ma4Price = PRICE_CLOSE;

extern int Ma4Method = MODE_EMA; extern int Ma4Price = PRICE_CLOSE; extern int Ma4Method = MODE_EMA;

extern int Ma4Shift = 0;

//

//

//

//

//

double histu[];

double histd[];

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

int init()

{

SetIndexBuffer(0,histu); SetIndexStyle(0,DRAW_HISTOGRAM);

SetIndexBuffer(1,histd); SetIndexStyle(1,DRAW_HISTOGRAM)を設定します.

return(0);

}

int deinit() { return(0); }.

//------------------------------------------------------------------

//

//------------------------------------------------------------------

//

//

//

//

//

int start()

{

int counted_bars = IndicatorCounted();

if (counted_bars < 0) return(-1);

if (counted_bars > 0) counted_bars--;

int limit = MathMin(Bars-counted_bars,Bars-1);

//

//

//

//

//

for(int i = limit; i >=0; i--)

{

double ma1 = iMA(NULL,0,Ma1Period,Ma1Shift,Ma1Method,Ma1Price,i)。

double ma2 = iMA(NULL,0,Ma2Period,Ma2Shift,Ma2Method,Ma2Price,i).とする。

double ma3 = iMA(NULL,0,Ma3Period,Ma3Shift,Ma3Method,Ma3Price,i); double ma3 = iMA(NULL,0,Ma3Shift,Ma3Method,Ma3Pricase,i);

double ma4 = iMA(NULL,0,Ma4Period,Ma4Shift,Ma4Method,Ma4Price,i); double ma4 = iMA(NULL,0,Ma4Shift,Ma4Method,Ma4Pricase,i);

histu = EMPTY_VALUE;

histd = EMPTY_VALUE; histd = EMPTY_VALUE;

if(ma1=ma2 && ma2=ma3&& ma3>ma4) histu = 1;

if(ma1=ma2 && ma2=ma3&& ma3<ma4) histd = 1;

}

return(0);

}

人77

<」を「>=」に置き換えるべきでした(「=」だけではありません)

_____________________

追記:2つのMAは常に同期していることを伝えるのを忘れていました

 

これで完璧です

mladenさんありがとうございます。

 

カウフマン適応移動平均

カウフマン適応移動平均 (by Alexander Gettinger)

Kaufman Adaptive Moving Average (KAMA)はPerry Kaufmanによって作成され、彼の著書Smarter Trading (1995)で初めて紹介されました。

Formulas:

KAMA = KAMA+sc*(Price-KAMA), ここで

sc = (er*0.6015+0.0645)*(er*0.6015+0.0645),

er = Abs(Price-Price)/Sum1。

Sum1 = (i-Length+1)からiまでのSum(Abs(Price-Price)).

ファイル:
kama.mq4  2 kb
 

線形回帰の 2つのバージョン(同著者より)

 

カウフマンAMAのフィルタリング済みバージョン

Kaufman AMA (adaptive moving average)をいろいろと準備中ですが、その使い方を非常に簡略化したバージョンがこちらです(amaの計算が関数 化されました)。フィルタリングごとに価格を設定することもできます(生の価格を使う代わりに、フィルタリングされた価格を使うことができます(フィルタリングをオフにするには、PriceFilterを1に設定します)。

ファイル:
 

MA28(アレクサンダー・ゲッティンガー氏)

ファイル:
ma28.mq4  4 kb
ma28.png  83 kb
 

マルチタイムフレームのインジケータを作ることは可能でしょうか? ありがとうございます。

mladen:
Kaufman AMA (adaptive moving average)を他にもいくつか用意していますが、こちらは使い方が非常に簡略化されたバージョンです(amaの計算は関数化されました)。これは、フィルタリングごとの価格も持つことができます(生の価格を使用する代わりに、フィルタリングされた価格を使用することができます(フィルタリングをオフにするには、PriceFilterを1に設定します)。
理由: