マルチタイムフレーム・インディケーター - ページ 405

 

タイムフレーム TDI マージ

やあ、みんな、こんにちは、Mladenです。

TDIをシグナル・プロバイダーとして使って いる人がいるので、TDIアラート・システムに出くわした。おそらく、これは新しいものではない。少なくとも2つのタイムフレーム(ベースとして60分、スキャルピングのための5分)でTDIを取引することがより安全であるように、私は次のことが可能であるかどうかを尋ねています:私がしたいことは、私に全体的により信頼できる信号を与えるために少なくとも二つの異なる時間枠の信号をマージしている。大きい方の時間枠が基準として使われ、上か下かで小さい方の時間枠の方向が決まります。同じシグナルが小さい方の時間枠に現れたら、それは取引です。取引は、小さい方の時間枠に依存する終了シグナルのみで終了します。

これが私が話しているシグナルを作成するためのインジケータです。

 
Jonny473:
やあみんな、Mladenだ。

TDIをシグナルとして使っている人がいるので、TDIアラートシステムを紹介します(TDIがクロスしたときにシグナルやメールでのアラートを出すだけ)。おそらく、これは新しいものではない。少なくとも2つのタイムフレーム(ベースとして60分、スキャルピングのための5分)でTDIを取引することがより安全であるように、私は次のことが可能であるかどうかを尋ねています:私がしたいことは、私に全体的により信頼できる信号を与えるために少なくとも二つの異なる時間枠の信号をマージしている。大きい方の時間枠が基準として使われ、上か下かで小さい方の時間枠の方向が決まります。同じ信号が小さい時間枠に表示された場合、それは貿易であり、貿易は小さい時間枠に応じてのみ終了信号で終了されます。

シグナル作成について話しているインジケーターですが、皆さんはどう思われますか、それとも似たようなものが既に投稿されていましたか?

インジケータは後ほど掲載します。

 
mladen:
FxTrendsTrader お待たせしました

ムラデン様

このインジケーターに「Coloring on Slope」を追加していただくことは可能でしょうか?

よろしくお願いします。

シークレットコード

 
Jonny473:
すぐにインジケーターを掲載します・・・。

心臓発作......ですか......。

 
fxnewbie:
心臓発作か......

いいえ、心臓発作はありません。Heres the code, just copy it and create the indicator, cant find the file

/*------------------------------------------------------------------------------------

名前:xTDI-Arrow.mq4

著作権:2010、Xaphod、Forex Whiz

説明: - TDI のクロスに対して矢印を描画します。

- 上記3つのラインのクロスオーバーに対してアラートを提供します。

変更履歴。

2010-10-19.Xaphod, v1.00

- 初期リリース

-------------------------------------------------------------------------------------*/

// インジケータプロパティ

#property copyright "著作権 ?2010, Xaphod"

#property link "http://forexwhiz.appspot.com"

#property indicator_chart_window (インジケーターチャートウィンドウ)

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

#property インジケータ_カラー1 LimeGreen

#property indicator_color2 レッド

#property indicator_color3 グリーン

#property indicator_color4 ファイヤーブリック

#プロパティ indicator_width1 1

#プロパティ indicator_width2 1

#プロパティ indicator_width3 1

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

#property indicator_maximum 1 #property indicator_minimum 1

#property indicator_minimum 0

// 定数定義

#define INDICATOR_NAME "xTDI-矢印"

#define INDICATOR_VERSION "v1.00"

#define BAR_HEIGHT 1.00

#define TDI_INDI "Traders_Dynamic_Index" (トレーダーズダイナミックインデックス)

#define ARROW_THIN_UP 225

#define ARROW_THIN_DN 226

#define ARROW_THICK_UP 233

#define ARROW_THICK_DN 234

#define ARROW_HOLLOW_UP 241

#define ARROW_HOLLOW_DN 242

#define ARROW_ROUND_UP 221

#define ARROW_ROUND_DN 222

// インジケータパラメータ

extern string Indi.Copyright= "?2010, forexwhiz.appspot.com";

extern string Indi.Version= INDICATOR_VERSION;

extern string Show.Settings="?????????????????????????????????????????????????????????????????????????????!

extern int Show.TimeFrame=0; // 使用するタイムフレーム。現在のTimeframe=0。

extern bool Show.MarketBaseLine=true; // 市場基準線より上/下のクロスを別の色で表示する。

extern int Show.ArrowType=0; // 0=細い, 1=太い, 2=中空, 3=丸い

extern int Show.ArrowSize=1; // 矢印の大きさ(1~5)。

extern int Show.ArrowOffset=10; // ローソク足の端から矢印を表示する位置のオフセット

extern string TDI.Settings="?"????????????????????????????????????????????????????????????????????????????????!

extern int TDI.RSIPeriod = 13; // ピリオド。推奨値。8-25

extern int TDI.RSIPrice = 0; // 0=CLOSE、1=OPEN、2=HIGH、3=LOW、4=MEDIAN、5=TYPICAL、6=WEIGHTED。

extern int TDI.VolatilityBand = 34; // 推奨値:20-40

extern int TDI.RSIPriceLine = 2; // ピリオド

extern int TDI.RSIPriceType = 0; // 0=SMA、1=EMA、2=SSMA、3=LWMA

extern int TDI.TradeSignalLine = 7; // 期間

extern int TDI.TradeSignalType = 0; // 0=SMA、1=EMA、2=SSMA、3=LWMA

extern string Alert.Settings="?"????????????????????????????????????????????????????????????????????????????????!

extern bool Alert.RSIPriceLine=true; // RSI価格がシグナルラインとクロスしたらアラート。緑が赤を横切る。

extern bool Alert.MarketBaseLine=true; // RSI価格がシグナルラインとマーケットベースラインをクロスした場合にアラート。緑が赤と黄色を横切る

extern bool Alert.NewBarOnly=true; // True=新しいバーが開かれた時にアラートを出す。False=線が交差するたびにアラート

extern int Alert.Timeout=60; // アラート発生後N秒間アラートを無効化。Alert.NewBarOnly=falseの時のみ。

extern bool Alert.Popup=true; // アラート時にウィンドウとサウンドをポップアップする。

extern bool Alert.Email=false; // アラート時にメールを送信する。

// グローバルモジュール変数

double dBuffer0[];

double dBuffer1[];

double dBuffer2[]; double dBuffer2[];

double dBuffer3[]。

bool bStartup;

void SetArrowType(int& iArrowUp, int& iArrowDn) { { {Show.ArrowTypeを設定する。

switch (Show.ArrowType){。

ケース1: // 薄い

iArrowDn=ARROW_THIN_DN;

iArrowUp=ARROW_THIN_UP。

ブレーク

ケース2: // 中空

iArrowDn=ARROW_HOLLOW_DN;

iArrowUp=ARROW_HOLLOW_UP。

break

ケース3: // 丸型

iArrowDn=ARROW_ROUND_DN;

iArrowUp=ARROW_ROUND_UP。

break

デフォルト// 太い

iArrowDn=ARROW_THICK_DN;

iArrowUp=ARROW_THICK_UP。

break;

}

}

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

// 関数:init()

// 説明カスタムインジケータの初期化関数です。

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

int init() {

int iArrowUp;

int iArrowDn;

文字列 sType;

文字列 sTF;

SetArrowType(iArrowUp, iArrowDn );

SetIndexStyle(0,DRAW_ARROW,EMPTY,Show.ArrowSize); SetIndexBuffer(0,DRAW_ARROW,EMPTY,Show.ArrowSize);

SetIndexBuffer(0,dBuffer0)を設定します。

SetIndexLabel(0, "TDI:Mkt-Up"); SetIndexArrow(0, "TDI:Mkt-Up");

SetIndexArrow(0, iArrowUp);

SetIndexStyle(1,DRAW_ARROW,EMPTY,Show.ArrowSize); SetIndexBuffer(1,DRAW_ARROW,EMPTY,Show.ArrowSize);

SetIndexBuffer(1,dBuffer1).SetIndexLabel(1,dBuffer1)。

SetIndexLabel(1, "TDI:Mkt-Dn"); SetIndexArrow(1, "TDI:Mkt-Dn");

SetIndexArrow(1, iArrowDn);

SetIndexStyle(2,DRAW_ARROW,EMPTY,Show.ArrowSize); SetIndexBuffer(2,DRAW_ARROW,EMPTY,Show.ArrowSize);

SetIndexBuffer(2,dBuffer2)を設定します。

SetIndexLabel(2, "TDI:Sig-Up"); SetIndexArrow(2, "TDI:Sig-Up");

SetIndexArrow(2, iArrowUp);

SetIndexStyle(3,DRAW_ARROW,EMPTY,Show.ArrowSize); SetIndexBuffer(3,DRAW_ARROW,EMPTY,Show.ArrowSize);

SetIndexBuffer(3,dBuffer3)を設定します。

SetIndexLabel(3, "TDI:Sig-Dn")。

SetIndexArrow(3, iArrowDn);

if (Show.TimeFrame=0)の場合

sTF="";

さもなくば

sTF=TF2Str(Show.TimeFrame);

IndicatorShortName(INDICATOR_NAME+" "+sTF).INDICATOR_NAME(INDICATOR_NAME+""+sTF)。

bStartup=true;

return(0);

}

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

// 関数: deinit()

// 説明カスタムインジケータの非初期化関数です。

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

int deinit() {

return (0);

}

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

// 関数:start()

// 説明カスタムインジケーターイテレーション関数です。

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

int start() {

int iNewBars;

int iCountedBars;

int i

double dVBHighLine; // アッパーボラティリティバンド - アッパーブルーライン

double dVBLowLine; // 下限ボラティリティバンド - 青の下限ライン

double dMarketBaseLine0; // マーケットベースライン - 黄色いライン

double dRSIPriceLine0; // RSI PriceLine - 緑のライン

double dTradeSignalLine0; // トレードシグナルライン - 赤線

static double dMarketBaseLine1; // マーケットベースライン - 黄色のライン

static double dRSIPriceLine1; // RSI 価格線 - 緑の線

static double dTradeSignalLine1; // トレードシグナルライン - 赤のライン

double dOffset;

// 未処理のティックを取得

iCountedBars=IndicatorCounted();

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

if(iCountedBars>0) iCountedBars--;

iNewBars=Bars-iCountedBars;

for(i=iNewBars; i>=0;i--){。

// 前のTDIデータを取得

//if (Time!=tCurTime) { //tCurTime=Time。

//tCurTime=Time;

 

dMarketBaseLine1=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine.TDI_INDI,TDI.RSIPeriod,TDI.VolatilityBand,TDI.RSIPriceLine.TDI.RSIPriceLine.TDI.RSIPriceLine,

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,2,i+1); // 黄色のライン

dRSIPriceLine1=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine.TRSIPriceType); // 黄色い線。

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,4,i+1); // 緑のライン

dTradeSignalLine1=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine.TDI_INDI,TDI.RSIPriceType); // 緑のライン

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,5,i+1); // 赤線

//}

// 現在のTDIデータを取得

dMarketBaseLine0=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine.TDI_INDI,TDI.RSIPeriod,TDI.VolatilityBand,TDI.RSIPriceLine.NULL),

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,2,i); // 黄色いライン

dRSIPriceLine0=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine.TRSIPriceType); // 黄色い線。

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,4,i); // 緑のライン

dTradeSignalLine0=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine.TDI_INDI,TDI.RSIPriceType,TDI.RSIPriceBand,TDI.TradeSignalLine.i); // 緑のライン

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,5,i); // 赤線

// 現在の表示バッファをクリア

dBuffer0 =EMPTY_VALUE;

dBuffer1 = EMPTY_VALUE;

dBuffer2 = EMPTY_VALUE; dBuffer3 = EMPTY_VALUE;

dBuffer3 = EMPTY_VALUE; dBuffer3 = EMPTY_VALUE;

dOffset=Point*(10*Show.ArrowOffset/MarketInfo(Symbol(),MODE_TICKVALUE)) を指定します。

if (dRSIPriceLine0>dMarketBaseLine0 && dRSIPriceLine1dTradeSignalLine0 && Show.MarketBaseLine)とする。

dBuffer0 = Low-dOffset;

else if (dRSIPriceLine0>dTradeSignalLine0 && dRSIPriceLine1<dTradeSignalLine1)

dBuffer2 = Low-dOffset。

if (dRSIPriceLine0dMarketBaseLine1 && dRSIPriceLine0<dTradeSignalLine0 && Show.MarketBaseLine)

dBuffer1 = High+dOffset;

else if (dRSIPriceLine0dTradeSignalLine1)

dBuffer3 = High+dOffset;

// アラートチェック

if (i==0) AlertCheck()。

}

// 起動フラグをリセット

if (bStartup) bStartup=false;

// バイバイ

return(0);

}

//+------------------------------------------------------------------+

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

// 関数TF2Str()関数

// 説明タイムフレームを文字列に変換する

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

文字列 TF2Str(int iPeriod) {

switch(iPeriod) {

case PERIOD_M1: return("M1");

case PERIOD_M5: return("M5")。

case PERIOD_M15: return("M15"); case PERIOD_M30: return("M30");

case PERIOD_M30: return("M30"); case PERIOD_H1: return("M1");

case PERIOD_H1: return("H1")。

ケースPERIOD_H4:return("H4");

ケースPERIOD_D1: return("D1");

ケースPERIOD_W1: return("W1");

ケース PERIOD_MN1: return("MN1");

デフォルト:return("M "+iPeriod);

}

}

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

// 関数アラートチェック(AlertCheck)

// 説明アラート条件のチェックとアラートの実行

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

void AlertCheck() {

文字列 sAlertMsg;

静的 datetime tCurTime=0;

静的 int iAlertTimer[2];

静的 int iAlertStatus[2]; 静的 int iAlertStatus[2];

double dMarketBaseLine[2]; // マーケットベースライン - 黄色い線

double dRSIPriceLine[2]; // RSI 価格ライン - 緑のライン

double dTradeSignalLine[2]; // トレードシグナルライン - 赤のライン

int i,j;

bool bNewBar=false;

// インジケータが起動したばかりの場合は中止

if (bStartup) {

tCurTime=Time[0];

return(0);

// アラートチェック

if (Alert.RSIPriceLine || Alert.MarketBaseLine) { // アラートのチェック

// ニューバーのみでアラート

if (Alert.NewBarOnly){。

// 時間をリセットする

if(tCurTime!=Time[0]) { // 時刻のリセット

tCurTime=Time[0];

bNewBar=true;

// 新しいバー(バー1、バー2)のTDIデータ取得

for (i=0; i<2; i++) { { (i=0; i<2; i++)

j=i+1;

dMarketBaseLine=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine.TDI_INDI,TDI.RSIPeriod,TDI.RSIPriceBand,TDI.RSIPriceType)

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,2,j); // 黄色いライン

dRSIPriceLine=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine.TRSIPriceType); // 黄色ライン

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,4,j); // 緑のライン

dTradeSignalLine=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine.TDI_INDI,TDI.RSIPriceType,TDI.RSIPriceLine.NULL); // グリーンライン

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,5,j); // 赤線

}//エンドフォー

}//endif

}

else {

// 現在のバー、つまりバー0とバー1のTDIデータを取得する

for (i=0; i<2; i++) { { { {dマーケットベースライン

dMarketBaseLine=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine.TDI_INDI,TDI.RSIPeriod,TDI.VolatilityBand,TDI.RSIPriceLine.TDI.RSIPriceType),

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,2,i); // 黄色い線

dRSIPriceLine=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine.TRSIPriceType); // 黄色ライン

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,4,i); // 緑のライン

dTradeSignalLine=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine.TDI_INDI,TDI.RSIPriceType,TDI.RSIPriceLine.NULL); // グリーンライン

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,5,i); // 赤いライン

}//エンドフォー

}//end if(Alert.NewBarOnly)(アラート.ニューバー)

if (bNewBar || (!Alert.NewBarOnly && iAlertTimer[0]<GetTickCount())){

//Alert RSIPriceLine > TradeSignalLine

if (dRSIPriceLine[0]>dTradeSignalLine[0] && dRSIPriceLine[1]<dTradeSignalLine[1] && Alert.RSIPriceLine) { (dRSIPriceLine[1]>dTradeSignalLine[1] && Alert.RSIPriceLine) { if (!

if (!Alert.NewBarOnly) iAlertTimer[0]=GetTickCount()+Alert.Timeout*1000.If (!Alert.NewBarOnly) iAlertTimer[0]=GetTickCount()+Alert.Timeout*1000;

sAlertMsg="TDIアラート - "+Symbol()+" "+TF2Str(Period())+":RSIPriceLine Above TradeSignalLine.";

if (Alert.Popup) Alert(sAlertMsg);

if (Alert.Email) SendMail( sAlertMsg, "MT4 Alert!\n" + TimeToStr(TIME_DATE|TIME_SECONDS )+"\n "+SAlertMsg);

}//end if

//アラート RSIPriceLine < TradeSignalLine

if (dRSIPriceLine[0]dTradeSignalLine[1] && Alert.RSIPriceLine) { //PrintD("RSIPriceLine")

//PrintD("RSIPriceLine<TradeSignalLine")。

if (!Alert.NewBarOnly) iAlertTimer[0]=GetTickCount()+Alert.Timeout*1000.If (!Alert.NewBarOnly) iAlertTimer[0]=GetTickCount()+Alert.Timeout*1000;

sAlertMsg="TDIアラート - "+Symbol()+" "+TF2Str(期間())+":RSIPriceLine Below TradeSignalLine.";

if (Alert.Popup) Alert(sAlertMsg);

if (Alert.Email) SendMail( sAlertMsg, "MT4 Alert!\n" + TimeToStr(TIME_DATE|TIME_SECONDS )+"\n "+SAlertMsg);

}//end if

}//end if

if (bNewBar || (!Alert.NewBarOnly && iAlertTimer[1]<GetTickCount())){

//RSIPriceLine > TradeSignalLine && dMarketBaseLineならアラート

if (dRSIPriceLine[0]>dMarketBaseLine[0] && dRSIPriceLine[1]<dMarketBaseLine[1] && Alert.MarketBaseLine) { { { if (dRSIPriceLine[1]>dMarketBaseLine[1]&& dMarketBaseLine[1]&& Alert.MarketBaseLine)

if (dRSIPriceLine[0]>dTradeSignalLine[0]&&dRSIPriceLine[1]<dTradeSignalLine[1]){。

if (!Alert.NewBarOnly) iAlertTimer[1]=GetTickCount()+Alert.Timeout*1000.If (!Alert.NewBarOnly) iAlertTimer[1]=GetTickCount()+Alert.Timeout*1000;

sAlertMsg="TDIアラート - "+Symbol()+" "+TF2Str(期間())+":RSIPriceLineがTradeSignalLineとMarketBaseLineを上回りました";

if (Alert.Popup) Alert(sAlertMsg);

if (Alert.Email) SendMail( sAlertMsg, "MT4 Alert!\n" + TimeToStr(TIME_DATE|TIME_SECONDS )+"\n "+sAlertMsg);

}//end if

}//end if

//RSIPriceLine < TradeSignalLine && dMarketBaseLineの場合、アラート通知

if (dRSIPriceLine[0]dMarketBaseLine[1] && Alert.MarketBaseLine){(dRSIPriceLine[0]dMarketBaseLine[1])となります。

if (dRSIPriceLine[0]dTradeSignalLine[1]){。

if (!Alert.NewBarOnly) iAlertTimer[1]=GetTickCount()+Alert.Timeout*1000.If (!Alert.NewBarOnly) iAlertTimer[1]=GetTickCount()+Alert.Timeout*1000;

sAlertMsg="TDIアラート - "+Symbol()+" "+TF2Str(Period())+":RSIPriceLine Below TradeSignalLine and MarketBaseLine.";

if (Alert.Popup) Alert(sAlertMsg);

if (Alert.Email) SendMail( sAlertMsg, "MT4 Alert!\n" + TimeToStr(TIME_DATE|TIME_SECONDS )+"\n "+sAlertMsg);

}//end if

}//end if

}//end if

}//end if(Alert.RSIPriceLine || Alert.MarketBaseLine)

return(0);

}

ALERT: 10kポリシーのため、コードを2つに分けました。したがって、両方の部分を1つにコピーして、インジケータを作成しましょう

 

さて、皆さんお待たせしました!数式ばかりですみません。

ファイル:
tdi-2.mq4  4 kb
 

Wrong one 正しいコードを別のコードにコピーし、古いコードを上書きしてコンパイルしたところ、ファイルがまだ古いコードを使用しているのですか!とにかく、コードは正しいです。

 
Jonny473:
Wrong one 正しいコードを別のコードにコピーして、古いコードを上書きしてコンパイルしただけなのに、ファイルはまだ古いコードを使っているのか!?とにかく、このコードは正しいのです。

以前投稿したコードが...。

 

私の古いノートパソコンにはVista版があり、そのためmq4ファイルが消え続けているのですが、これでうまくいくはずです。

ファイル:
tdi-2.mq4  4 kb