Multi-Trading Systemタイプ別特徴

Type1
オープンポジションのカウントには、カウントする条件があり、
条件以外のオープンポジションはカウントされません。
よって、時には最大ポジション数を超えて、注文します。

Type2
①売り・買いに関係なく、1時間以内にオープンしたポジションがない。
②売り・買い、それぞれ当日にオープンしたポジションがない。
↑最大ポジション数が1の場合、売り・買いで2ポジションまで注文可能。
当日でなければ、売り・買い、複数ポジション注文可能。

Type3
①売り・買いに関係なく、オープンポジションがない。
②売り・買い、それぞれのオープンポジションがない。
↑最大ポジション数が1の場合、売り・買い、どちらかの1ポジションまで注文可能。
※取引が極端に少なくなるのでこのバージョンの開発は中止

Type4
①条件削除
②売り・買い、それぞれのオープンポジションがない。
↑最大ポジション数が1の場合、売り・買いで2ポジションまで注文可能。


インジケータからEAへの情報受け渡し
売り買いのサイン元(インジケータ側)の値をEAが読み込んでいます
SetIndexLabel(0,”Resistance”);
SetIndexLabel(1,”Support”);

MT4EAの受け側での記述
//+————————————————————————-+
double dOrderSet[256][14];
int iOrderSetCnt;
string sOrderSetCom[256];
double dPoint;
int iCandlCheck[2][2] = {0,1,0,1};
※一応大域的な変数の宣言です
//+————————————————————————-+
下記はインジケータを参照している部分

Resistance = iCustom(Symbol(),PERIOD_H1,”custom indicator”,0,3);
->3本前のcustom indicatorのResistanceの値
Support = iCustom(Symbol(),PERIOD_H1,”custom indicator”,1,3);
->3本前のcustom indicatorのSupportの値
Resistance1 = iCustom(Symbol(),PERIOD_H1,”custom indicator”,0,3);
->Resistanceと同じ
Support1 = iCustom(Symbol(),PERIOD_H1,”custom indicator”,1,3);
->Supportと同じ
double Close1 = iClose(Symbol(), PERIOD_H1, 1);
->1本前時間足の終値
double Close2 = iClose(Symbol(), PERIOD_H1, 2);
->2本前時間足の終値
===============
以下に売り買いの記述が繋がる

これをMT5で下記に変更
int chandle = 0;
int OnInit()
{
chandle = iCustom(Symbol(),PERIOD_H1,”custom indicator”);

custom indicatorをchandleに置き換えています
Resistance = indi(chandle,0,3);
  Support = indi(chandle, 1,3);
Resistance1 = indi(chandle, 0,3);
Support1 = indi(chandle,1,3);
//////////////////////////////////////////
Resistanceと Resistance1 SupportとSupport1に変数も同じなので
インジケータからの情報受け渡しには問題ないと思いますが
MT5でもiCustomは使用で着るがmt4と同様に呼び出せば,
その都度インディケータ内部の計算が行われます。
(場合によっては省略されることもあります)
これに対して,mt5で新たに導入された方法では,
ハンドルを用いてインディケータの値に直接アクセスするので,
EAからの呼び出しを行ってもインディケータ内部の
計算が生じないというメリットがあります

本来、インジケータからEAの作成を行ものですがこの内容を理解した上で
違うインジケータの組み合わせを作成したのがBase2及びBase3となります

Base1とBase3は近いインジケータを使用しており
インジケータVal値を0と1で売り買いのタイミングを決めている
SetIndexLabel(0,”Resistance”);
SetIndexLabel(1,”Support”);

インジケータのサイン受け取りの仕組み

Base1及び3はustom indivator(Support & Registance系)だと
確定した高値/安値から次の高値/安値の直前まで同じ値で
インディケータの値が設定されています。
このため
Resistance = iCustom(Symbol(),PERIOD_H1,”custom indicator”,0,3);
Support = iCustom(Symbol(),PERIOD_H1,”custom indicator”,1,3);
Resistance1 = iCustom(Symbol(),PERIOD_H1,”custom indicator”,0,3);
Support1 = iCustom(Symbol(),PERIOD_H1,”custom indicator”,1,3);
で直近の確定した高値/安値を得ることができます。

ところがBase2のオリジナルではcustom indivatorが確定高値/安値だけに
表示がされているので確定高値/安値を取ることができません。
確定した高値/安値から次の高値/安値の直前まで同じ値で
インディケータの値が設定されていないため
直近の確定した高値/安値を得ることができませんでした

この為Base2で使用したインジケータには、シグナル発生時の値が
次のシグナル発生時まで続くように修正

Base1使用するインジケータ名:Super_Support_Resistance

//Super_Support_Resistance一部書き出し

#property indicator_chart_window
#property indicator_buffers 5
#property indicator_plots 5

#property indicator_label1 “Resistance”
#property indicator_type1 DRAW_ARROW
#property indicator_color1 Red
#property indicator_width1 1

#property indicator_label2 “Support”
#property indicator_type2 DRAW_ARROW
#property indicator_color2 Blue
#property indicator_width2 1

Base2使用するインジケータ名:Base2colorparabolic_alert

//Base2colorparabolic_alert一部書き出し

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_plots 4

#property indicator_type1 DRAW_ARROW
#property indicator_color1 clrDeepPink
#property indicator_width1 1
#property indicator_label1 “Resistance”

#property indicator_type2 DRAW_ARROW
#property indicator_color2 clrBlueViolet
#property indicator_width2 1
#property indicator_label2 “Support”

#property indicator_type3 DRAW_ARROW
#property indicator_color3 clrRed
#property indicator_width3 1
#property indicator_label3 “Lower Parabolic”

#property indicator_type4 DRAW_ARROW
#property indicator_color4 clrSkyBlue
#property indicator_width4 1
#property indicator_label4 “Upper Parabolic”

Base3使用するインジケータ名:Fractals_barry

//Fractals_barry一部書き出し

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_plots 3

#property indicator_type1 DRAW_LINE
#property indicator_color1 Red
#property indicator_width1 2
#property indicator_label1 “Lower Parabolic”

#property indicator_type2 DRAW_LINE
#property indicator_color2 Blue
#property indicator_width2 2
#property indicator_label2 “Upper Parabolic”

#property indicator_type3 DRAW_FILLING
#property indicator_color3 Black

※どのインジケータも1時間足をプリロードしています

コメントする

メールアドレスが公開されることはありません。 が付いている欄は必須項目です