コーディングのヘルプ - ページ 626 1...619620621622623624625626627628629630631632633...786 新しいコメント Mladen Rakic 2016.04.19 16:43 #6251 stas0202:mladenは、あなたが指標で私を助けることができるという希望がありますか? 追加投稿は不要です アラート付きバージョンはこちら(6種類のアラートが追加されています) :MASO 2_1 + alerts.mq4 ファイル: maso_2_1__alerts.mq4 6 kb stas0202 2016.04.19 16:54 #6252 mladen: 追加投稿は不要です アラート付きバージョンはこちら(6種類のアラートが追加されています) :MASO 2_1 + alerts.mq4 非常に良い、素晴らしい仕事、ありがとうございます stas0202 2016.04.19 17:02 #6253 mladen と矢印を作るためにもう一つの要求であることができ、唯一のバーを閉じた? と中立バーがあるとき、トレンドの変化としてそれを扱う Joakin 2016.04.19 18:33 #6254 MASOインジケータでアラートが多いように見えるのですが。 多すぎませんか?普通の取引に使うにはどうしたらいいのでしょうか? stas0202 2016.04.19 18:44 #6255 バイナリーオプションの場合、ある戦略で、マーチンゲイルで 削除済み 2016.04.20 06:43 #6256 pgtips: こんにちは、Mladen。前日のロウソクの色を表示するインジケータはありますか? 私は5分足チャートで作業しており、視覚的にバックテストは、前日のろうそくの色を確認するためにスワップ混乱になります。私は前日のろうそくの色を表示するために、赤または緑のいずれかの新しいウィンドウで下部に沿って実行されているバーを持っていた場合、それは素晴らしいことだ - 私は、同じ方向の取引を検討したいです。 このようなバーを添付します。これは可能ですか? だから、もしクローズ>オープンその後緑、そうでない場合は赤私が推測する? あなたの助けのためにいつものようにありがとうございます:-) ペナルティー 丁寧なバンプ:-) ファイル: image_198926.jpg 2 kb mntiwana 2016.04.20 08:35 #6257 pgtips: 丁寧なバンプ :-) これがお役に立てれば幸いです。 ファイル: eurusdm5_1.png 32 kb cebretz 2016.04.20 09:28 #6258 #property copyright "" #property link "" #property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 Crimson #property indicator_color2 DodgerBlue #property indicator_color3 clrBlue int price = PRICE_OPEN; extern int zBar = 1000; extern int LengthB=12; extern int LengthK=12; extern int sCCI=2; extern int sRSI=2; int SoundAlertMode = 0; int Soundonly = 0; int Barcount; double RSI; double CCI; datetime TimeBar; double previ; double ExtMapBuffer2[]; double alertBar1; int sim=0; double alertBar; extern bool DoAlert=true; extern bool alertMail=false; datetime lastAlertTime; //---- buffers double b1[],b2[];double Gd_188; double f0_3() { double Ld_ret_0; if (Digits < 4) Ld_ret_0 = 0.01; else Ld_ret_0 = 0.0001; return (Ld_ret_0); } //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators IndicatorBuffers(2); IndicatorShortName("Investor"); SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,0); SetIndexArrow(0,234); SetIndexBuffer(0,b1); SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,0); SetIndexArrow(1,233); SetIndexBuffer(1,b2); SetIndexEmptyValue(2,0.0); SetIndexDrawBegin(2, zBar); SetIndexStyle(2,DRAW_ARROW,STYLE_SOLID,2); SetIndexArrow(2,158); SetIndexBuffer(2,ExtMapBuffer2); Gd_188 = f0_3(); Barcount = 0; //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int i, counted_bars=IndicatorCounted(); int limit=Bars-counted_bars; if(counted_bars>0) limit++; string sAlertMsg; /*// TImes int Li_unused_8; string Ls_28; int Li_unused_36; double Ld_0 = (Ask - Bid) / Gd_188; if (Ld_0 > 1.0 && Ld_0 <= 10.0) Li_unused_8 = 4; int Li_12 = Time[0] + 60 * Period() - TimeCurrent(); double Ld_16 = Li_12 / 60.0; int Li_24 = Li_12 % 60; Li_12 = (Li_12 - Li_12 % 60) / 60; if (Li_24 <= 9) Ls_28 = "0"; if (Li_12 >= 1 && Li_12 <= 9) Li_unused_36 = -10; else { if (Li_12 >= 10 && Li_12 <= 99) Li_unused_36 = -13; else { if (Li_12 >= 100 && Li_12 <= 999) Li_unused_36 = -16; else { if (Li_12 >= 1000 && Li_12 <= 9999) Li_unused_36 = -24; else if (Li_12 >= 10000 && Li_12 <= 99999) Li_unused_36 = -29; } } } Comment("", "" + Li_12 + ":" + Ls_28 + "" + Li_24 + "", "\n", "=======", "\n", "" + Symbol() + "", " " + Period() + "", "\n", "Spread : " + DoubleToStr(Ld_0, 1) + "", "\n", "\n", "", "\n", ""); */ // Arrows for(i=0; i<limit; i++) { RSI=iRSI(NULL,0,sRSI,price,i); CCI=iCCI(NULL,0,sCCI,price,i+1); //double zz1 = iCustom(NULL,0,"Zigzag_v.2",zBar,LengthB,LengthK,1,i); //double zz2 = iCustom(NULL,0,"Zigzag_v.2",zBar,LengthB,LengthK,0,i); //if (zz1 != 0) { if ( RSI > 80.0 && CCI < 50.0 && Open > Close && //bear Open < Close && //bull High - Close > High - Close ) { b1 = High+Point*5; } //if (zz2 != 0) { if ( RSI 50.0 && Open < Close && //bull Open > Close && //bear High - Close < High - Close ) { b2 = Low-Point*5; } if (DoAlert && b2[1]!=0 && lastAlertTime!=Time[0]) { sAlertMsg=" Alert - "+Symbol()+" "+TF2Str(Period())+""; if (DoAlert) Alert(sAlertMsg); lastAlertTime = Time[0]; if (alertMail) SendMail(sAlertMsg, "Alert!\n" + TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS )+"\n"+sAlertMsg); } else if (b1[1]!=0 && lastAlertTime!=Time[0]) { sAlertMsg=" Alert - "+Symbol()+" "+TF2Str(Period())+""; if (DoAlert) Alert(sAlertMsg); lastAlertTime = Time[0]; if (alertMail) SendMail(sAlertMsg, "Alert!\n" + TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS )+"\n"+sAlertMsg); } //} //} } sinyal(); //-------------------------------------------------------------------+ return(0); } //+------------------------------------------------------------------+ string 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_H1: return("H1"); case PERIOD_H4: return("H4"); case PERIOD_D1: return("D1"); case PERIOD_W1: return("W1"); case PERIOD_MN1: return("MN1"); default: return("M"+iPeriod); } } void sinyal(){ int shifti,Swingi,Swing_ni,uzli,ii,zui,zdi,mvi; double LLi,HHi,BHi,BLi; double Uzeli[10000][3]; // loop from first bar to current bar (with shift=0) Swing_ni=0;Swingi=0;uzli=0; BHi =High[zBar];BLi=Low[zBar];zui=zBar;zdi=zBar; for (shifti=zBar;shifti>=0;shifti--) { LLi=10000000;HHi=-100000000; for (ii=shifti+LengthB;ii>=shifti+1;ii--) { if (Low< LLi) {LLi=Low;} if (High>HHi) {HHi=High;} } if (Low[shifti]HHi){ Swingi=2; if (Swing_ni==1) {zui=shifti+1;} if (Swing_ni==-1) {zdi=shifti+1;} } else { if (Low[shifti]<LLi) {Swingi=-1;} if (High[shifti]>HHi) {Swingi=1;} } if (Swingi!=Swing_ni && Swing_ni!=0) { if (Swingi==2) { Swingi=-Swing_ni;BHi = High[shifti];BLi = Low[shifti]; } uzli=uzli+1; if (Swingi==1) { Uzeli[1]=zdi; Uzeli[2]=BLi; } if (Swingi==-1) { Uzeli[1]=zui; Uzeli[2]=BHi; } BHi = High[shifti]; BLi = Low[shifti]; } if (Swingi==1) { if (High[shifti]>=BHi) {BHi=High[shifti];zui=shifti;}} if (Swingi==-1) { if (Low[shifti]<=BLi) {BLi=Low[shifti]; zdi=shifti;}} Swing_ni=Swingi; } for (ii=1;ii<=uzli;ii++) { mvi=StrToInteger(DoubleToStr(Uzeli[1],0)); ExtMapBuffer2[mvi]=Uzeli[2]; previ=Uzeli[2]; } } 助けてください.... このインジケータはシグナルが正しい時間に表示されません。 毎回チャートをリフレッシュしなければ なりません。 そして、アラートも修正してください。 ありがとうございます Coding help コーディングの方法は? アスク! Mladen Rakic 2016.04.20 13:45 #6259 cebrez: #property copyright "" #property link "" #property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 Crimson #property indicator_color2 DodgerBlue #property indicator_color3 clrBlue int price = PRICE_OPEN; extern int zBar = 1000; extern int LengthB=12; extern int LengthK=12; extern int sCCI=2; extern int sRSI=2; int SoundAlertMode = 0; int Soundonly = 0; int Barcount; double RSI; double CCI; datetime TimeBar; double previ; double ExtMapBuffer2[]; double alertBar1; int sim=0; double alertBar; extern bool DoAlert=true; extern bool alertMail=false; datetime lastAlertTime; //---- buffers double b1[],b2[];double Gd_188; double f0_3() { double Ld_ret_0; if (Digits < 4) Ld_ret_0 = 0.01; else Ld_ret_0 = 0.0001; return (Ld_ret_0); } //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators IndicatorBuffers(2); IndicatorShortName("Investor"); SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,0); SetIndexArrow(0,234); SetIndexBuffer(0,b1); SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,0); SetIndexArrow(1,233); SetIndexBuffer(1,b2); SetIndexEmptyValue(2,0.0); SetIndexDrawBegin(2, zBar); SetIndexStyle(2,DRAW_ARROW,STYLE_SOLID,2); SetIndexArrow(2,158); SetIndexBuffer(2,ExtMapBuffer2); Gd_188 = f0_3(); Barcount = 0; //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int i, counted_bars=IndicatorCounted(); int limit=Bars-counted_bars; if(counted_bars>0) limit++; string sAlertMsg; /*// TImes int Li_unused_8; string Ls_28; int Li_unused_36; double Ld_0 = (Ask - Bid) / Gd_188; if (Ld_0 > 1.0 && Ld_0 <= 10.0) Li_unused_8 = 4; int Li_12 = Time[0] + 60 * Period() - TimeCurrent(); double Ld_16 = Li_12 / 60.0; int Li_24 = Li_12 % 60; Li_12 = (Li_12 - Li_12 % 60) / 60; if (Li_24 <= 9) Ls_28 = "0"; if (Li_12 >= 1 && Li_12 <= 9) Li_unused_36 = -10; else { if (Li_12 >= 10 && Li_12 <= 99) Li_unused_36 = -13; else { if (Li_12 >= 100 && Li_12 <= 999) Li_unused_36 = -16; else { if (Li_12 >= 1000 && Li_12 <= 9999) Li_unused_36 = -24; else if (Li_12 >= 10000 && Li_12 <= 99999) Li_unused_36 = -29; } } } Comment("", "" + Li_12 + ":" + Ls_28 + "" + Li_24 + "", "\n", "=======", "\n", "" + Symbol() + "", " " + Period() + "", "\n", "Spread : " + DoubleToStr(Ld_0, 1) + "", "\n", "\n", "", "\n", ""); */ // Arrows for(i=0; i<limit; i++) { RSI=iRSI(NULL,0,sRSI,price,i); CCI=iCCI(NULL,0,sCCI,price,i+1); //double zz1 = iCustom(NULL,0,"Zigzag_v.2",zBar,LengthB,LengthK,1,i); //double zz2 = iCustom(NULL,0,"Zigzag_v.2",zBar,LengthB,LengthK,0,i); //if (zz1 != 0) { if ( RSI > 80.0 && CCI < 50.0 && Open > Close && //bear Open < Close && //bull High - Close > High - Close ) { b1 = High+Point*5; } //if (zz2 != 0) { if ( RSI 50.0 && Open < Close && //bull Open > Close && //bear High - Close < High - Close ) { b2 = Low-Point*5; } if (DoAlert && b2[1]!=0 && lastAlertTime!=Time[0]) { sAlertMsg=" Alert - "+Symbol()+" "+TF2Str(Period())+""; if (DoAlert) Alert(sAlertMsg); lastAlertTime = Time[0]; if (alertMail) SendMail(sAlertMsg, "Alert!\n" + TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS )+"\n"+sAlertMsg); } else if (b1[1]!=0 && lastAlertTime!=Time[0]) { sAlertMsg=" Alert - "+Symbol()+" "+TF2Str(Period())+""; if (DoAlert) Alert(sAlertMsg); lastAlertTime = Time[0]; if (alertMail) SendMail(sAlertMsg, "Alert!\n" + TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS )+"\n"+sAlertMsg); } //} //} } sinyal(); //-------------------------------------------------------------------+ return(0); } //+------------------------------------------------------------------+ string 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_H1: return("H1"); case PERIOD_H4: return("H4"); case PERIOD_D1: return("D1"); case PERIOD_W1: return("W1"); case PERIOD_MN1: return("MN1"); default: return("M"+iPeriod); } } void sinyal(){ int shifti,Swingi,Swing_ni,uzli,ii,zui,zdi,mvi; double LLi,HHi,BHi,BLi; double Uzeli[10000][3]; // loop from first bar to current bar (with shift=0) Swing_ni=0;Swingi=0;uzli=0; BHi =High[zBar];BLi=Low[zBar];zui=zBar;zdi=zBar; for (shifti=zBar;shifti>=0;shifti--) { LLi=10000000;HHi=-100000000; for (ii=shifti+LengthB;ii>=shifti+1;ii--) { if (Low< LLi) {LLi=Low;} if (High>HHi) {HHi=High;} } if (Low[shifti]HHi){ Swingi=2; if (Swing_ni==1) {zui=shifti+1;} if (Swing_ni==-1) {zdi=shifti+1;} } else { if (Low[shifti]<LLi) {Swingi=-1;} if (High[shifti]>HHi) {Swingi=1;} } if (Swingi!=Swing_ni && Swing_ni!=0) { if (Swingi==2) { Swingi=-Swing_ni;BHi = High[shifti];BLi = Low[shifti]; } uzli=uzli+1; if (Swingi==1) { Uzeli[1]=zdi; Uzeli[2]=BLi; } if (Swingi==-1) { Uzeli[1]=zui; Uzeli[2]=BHi; } BHi = High[shifti]; BLi = Low[shifti]; } if (Swingi==1) { if (High[shifti]>=BHi) {BHi=High[shifti];zui=shifti;}} if (Swingi==-1) { if (Low[shifti]<=BLi) {BLi=Low[shifti]; zdi=shifti;}} Swing_ni=Swingi; } for (ii=1;ii<=uzli;ii++) { mvi=StrToInteger(DoubleToStr(Uzeli[1],0)); ExtMapBuffer2[mvi]=Uzeli[2]; previ=Uzeli[2]; } } 助けてください.... このインジケータはシグナルが正しい時間に表示されません。 毎回チャートをリフレッシュしなければ なりません。 そしてアラートも修正してください しゃい cebrez それはインジケータが分解され、いくつかの他の部分から一緒にパッチされ、その結果、あなたは再塗装のインジケータ101である混乱を得たです。 忘れてください cebretz 2016.04.20 14:01 #6260 mladen: セブレス それは、デコンパイルや他のパーツからパッチを当てたインジケータで、その結果、リペイントインジケータ101のような混乱が発生しました。 それを忘れることが最善です。 しかし、私はこのインジケータで良い結果を持っている、はい、そのリペイントは、私にとって何の問題もない...先生をお願いします。 私はここでZigZag_v.2と呼ばれるいくつかの他の部品を添付>>https://www.mql5.com/en/forum/174385/page417。 感謝 1...619620621622623624625626627628629630631632633...786 新しいコメント 取引の機会を逃しています。 無料取引アプリ 8千を超えるシグナルをコピー 金融ニュースで金融マーケットを探索 新規登録 ログイン スペースを含まないラテン文字 このメールにパスワードが送信されます エラーが発生しました Googleでログイン WebサイトポリシーおよびMQL5.COM利用規約に同意します。 新規登録 MQL5.com WebサイトへのログインにCookieの使用を許可します。 ログインするには、ブラウザで必要な設定を有効にしてください。 ログイン/パスワードをお忘れですか? Googleでログイン
mladenは、あなたが指標で私を助けることができるという希望がありますか?
追加投稿は不要です アラート付きバージョンはこちら(6種類のアラートが追加されています) :MASO 2_1 + alerts.mq4
追加投稿は不要です アラート付きバージョンはこちら(6種類のアラートが追加されています) :MASO 2_1 + alerts.mq4
非常に良い、素晴らしい仕事、ありがとうございます
mladen
と矢印を作るためにもう一つの要求であることができ、唯一のバーを閉じた? と中立バーがあるとき、トレンドの変化としてそれを扱う
MASOインジケータでアラートが多いように見えるのですが。
多すぎませんか?普通の取引に使うにはどうしたらいいのでしょうか?
バイナリーオプションの場合、ある戦略で、マーチンゲイルで
こんにちは、Mladen。
前日のロウソクの色を表示するインジケータはありますか?
私は5分足チャートで作業しており、視覚的にバックテストは、前日のろうそくの色を確認するためにスワップ混乱になります。私は前日のろうそくの色を表示するために、赤または緑のいずれかの新しいウィンドウで下部に沿って実行されているバーを持っていた場合、それは素晴らしいことだ - 私は、同じ方向の取引を検討したいです。
このようなバーを添付します。これは可能ですか?
だから、もしクローズ>オープンその後緑、そうでない場合は赤私が推測する?
あなたの助けのためにいつものようにありがとうございます:-)
ペナルティー丁寧なバンプ:-)
丁寧なバンプ :-)
これがお役に立てれば幸いです。
#property copyright ""
#property link ""
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Crimson
#property indicator_color2 DodgerBlue
#property indicator_color3 clrBlue
int price = PRICE_OPEN;
extern int zBar = 1000;
extern int LengthB=12;
extern int LengthK=12;
extern int sCCI=2;
extern int sRSI=2;
int SoundAlertMode = 0;
int Soundonly = 0;
int Barcount;
double RSI;
double CCI;
datetime TimeBar;
double previ;
double ExtMapBuffer2[];
double alertBar1;
int sim=0;
double alertBar;
extern bool DoAlert=true;
extern bool alertMail=false;
datetime lastAlertTime;
//---- buffers
double b1[],b2[];double Gd_188;
double f0_3() {
double Ld_ret_0;
if (Digits < 4) Ld_ret_0 = 0.01;
else Ld_ret_0 = 0.0001;
return (Ld_ret_0);
}
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(2);
IndicatorShortName("Investor");
SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,0);
SetIndexArrow(0,234);
SetIndexBuffer(0,b1);
SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,0);
SetIndexArrow(1,233);
SetIndexBuffer(1,b2);
SetIndexEmptyValue(2,0.0);
SetIndexDrawBegin(2, zBar);
SetIndexStyle(2,DRAW_ARROW,STYLE_SOLID,2);
SetIndexArrow(2,158);
SetIndexBuffer(2,ExtMapBuffer2);
Gd_188 = f0_3();
Barcount = 0;
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i, counted_bars=IndicatorCounted();
int limit=Bars-counted_bars;
if(counted_bars>0) limit++;
string sAlertMsg;
/*// TImes
int Li_unused_8;
string Ls_28;
int Li_unused_36;
double Ld_0 = (Ask - Bid) / Gd_188;
if (Ld_0 > 1.0 && Ld_0 <= 10.0) Li_unused_8 = 4;
int Li_12 = Time[0] + 60 * Period() - TimeCurrent();
double Ld_16 = Li_12 / 60.0;
int Li_24 = Li_12 % 60;
Li_12 = (Li_12 - Li_12 % 60) / 60;
if (Li_24 <= 9) Ls_28 = "0";
if (Li_12 >= 1 && Li_12 <= 9) Li_unused_36 = -10;
else {
if (Li_12 >= 10 && Li_12 <= 99) Li_unused_36 = -13;
else {
if (Li_12 >= 100 && Li_12 <= 999) Li_unused_36 = -16;
else {
if (Li_12 >= 1000 && Li_12 <= 9999) Li_unused_36 = -24;
else
if (Li_12 >= 10000 && Li_12 <= 99999) Li_unused_36 = -29;
}
}
}
Comment("", "" + Li_12 + ":" + Ls_28 + "" + Li_24 + "",
"\n", "=======",
"\n", "" + Symbol() + "", " " + Period() + "",
"\n", "Spread : " + DoubleToStr(Ld_0, 1) + "",
"\n",
"\n", "",
"\n", "");
*/
// Arrows
for(i=0; i<limit; i++)
{
RSI=iRSI(NULL,0,sRSI,price,i);
CCI=iCCI(NULL,0,sCCI,price,i+1);
//double zz1 = iCustom(NULL,0,"Zigzag_v.2",zBar,LengthB,LengthK,1,i);
//double zz2 = iCustom(NULL,0,"Zigzag_v.2",zBar,LengthB,LengthK,0,i);
//if (zz1 != 0) {
if ( RSI > 80.0 && CCI < 50.0 &&
Open > Close && //bear
Open < Close && //bull
High - Close > High - Close )
{
b1 = High+Point*5;
}
//if (zz2 != 0) {
if ( RSI 50.0 &&
Open < Close && //bull
Open > Close && //bear
High - Close < High - Close )
{
b2 = Low-Point*5;
}
if (DoAlert && b2[1]!=0 && lastAlertTime!=Time[0])
{
sAlertMsg=" Alert - "+Symbol()+" "+TF2Str(Period())+"";
if (DoAlert) Alert(sAlertMsg);
lastAlertTime = Time[0];
if (alertMail) SendMail(sAlertMsg, "Alert!\n" + TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS )+"\n"+sAlertMsg);
}
else
if (b1[1]!=0 && lastAlertTime!=Time[0])
{
sAlertMsg=" Alert - "+Symbol()+" "+TF2Str(Period())+"";
if (DoAlert) Alert(sAlertMsg);
lastAlertTime = Time[0];
if (alertMail) SendMail(sAlertMsg, "Alert!\n" + TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS )+"\n"+sAlertMsg);
}
//}
//}
}
sinyal();
//-------------------------------------------------------------------+
return(0);
}
//+------------------------------------------------------------------+
string 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_H1: return("H1");
case PERIOD_H4: return("H4");
case PERIOD_D1: return("D1");
case PERIOD_W1: return("W1");
case PERIOD_MN1: return("MN1");
default: return("M"+iPeriod);
}
}
void sinyal(){
int shifti,Swingi,Swing_ni,uzli,ii,zui,zdi,mvi;
double LLi,HHi,BHi,BLi;
double Uzeli[10000][3];
// loop from first bar to current bar (with shift=0)
Swing_ni=0;Swingi=0;uzli=0;
BHi =High[zBar];BLi=Low[zBar];zui=zBar;zdi=zBar;
for (shifti=zBar;shifti>=0;shifti--) {
LLi=10000000;HHi=-100000000;
for (ii=shifti+LengthB;ii>=shifti+1;ii--) {
if (Low< LLi) {LLi=Low;}
if (High>HHi) {HHi=High;}
}
if (Low[shifti]HHi){
Swingi=2;
if (Swing_ni==1) {zui=shifti+1;}
if (Swing_ni==-1) {zdi=shifti+1;}
} else {
if (Low[shifti]<LLi) {Swingi=-1;}
if (High[shifti]>HHi) {Swingi=1;}
}
if (Swingi!=Swing_ni && Swing_ni!=0) {
if (Swingi==2) {
Swingi=-Swing_ni;BHi = High[shifti];BLi = Low[shifti];
}
uzli=uzli+1;
if (Swingi==1) {
Uzeli[1]=zdi;
Uzeli[2]=BLi;
}
if (Swingi==-1) {
Uzeli[1]=zui;
Uzeli[2]=BHi;
}
BHi = High[shifti];
BLi = Low[shifti];
}
if (Swingi==1) {
if (High[shifti]>=BHi) {BHi=High[shifti];zui=shifti;}}
if (Swingi==-1) {
if (Low[shifti]<=BLi) {BLi=Low[shifti]; zdi=shifti;}}
Swing_ni=Swingi;
}
for (ii=1;ii<=uzli;ii++) {
mvi=StrToInteger(DoubleToStr(Uzeli[1],0));
ExtMapBuffer2[mvi]=Uzeli[2];
previ=Uzeli[2];
}
}
助けてください....
このインジケータはシグナルが正しい時間に表示されません。
毎回チャートをリフレッシュしなければ なりません。
そして、アラートも修正してください。
ありがとうございます
#property copyright ""
#property link ""
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Crimson
#property indicator_color2 DodgerBlue
#property indicator_color3 clrBlue
int price = PRICE_OPEN;
extern int zBar = 1000;
extern int LengthB=12;
extern int LengthK=12;
extern int sCCI=2;
extern int sRSI=2;
int SoundAlertMode = 0;
int Soundonly = 0;
int Barcount;
double RSI;
double CCI;
datetime TimeBar;
double previ;
double ExtMapBuffer2[];
double alertBar1;
int sim=0;
double alertBar;
extern bool DoAlert=true;
extern bool alertMail=false;
datetime lastAlertTime;
//---- buffers
double b1[],b2[];double Gd_188;
double f0_3() {
double Ld_ret_0;
if (Digits < 4) Ld_ret_0 = 0.01;
else Ld_ret_0 = 0.0001;
return (Ld_ret_0);
}
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(2);
IndicatorShortName("Investor");
SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,0);
SetIndexArrow(0,234);
SetIndexBuffer(0,b1);
SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,0);
SetIndexArrow(1,233);
SetIndexBuffer(1,b2);
SetIndexEmptyValue(2,0.0);
SetIndexDrawBegin(2, zBar);
SetIndexStyle(2,DRAW_ARROW,STYLE_SOLID,2);
SetIndexArrow(2,158);
SetIndexBuffer(2,ExtMapBuffer2);
Gd_188 = f0_3();
Barcount = 0;
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i, counted_bars=IndicatorCounted();
int limit=Bars-counted_bars;
if(counted_bars>0) limit++;
string sAlertMsg;
/*// TImes
int Li_unused_8;
string Ls_28;
int Li_unused_36;
double Ld_0 = (Ask - Bid) / Gd_188;
if (Ld_0 > 1.0 && Ld_0 <= 10.0) Li_unused_8 = 4;
int Li_12 = Time[0] + 60 * Period() - TimeCurrent();
double Ld_16 = Li_12 / 60.0;
int Li_24 = Li_12 % 60;
Li_12 = (Li_12 - Li_12 % 60) / 60;
if (Li_24 <= 9) Ls_28 = "0";
if (Li_12 >= 1 && Li_12 <= 9) Li_unused_36 = -10;
else {
if (Li_12 >= 10 && Li_12 <= 99) Li_unused_36 = -13;
else {
if (Li_12 >= 100 && Li_12 <= 999) Li_unused_36 = -16;
else {
if (Li_12 >= 1000 && Li_12 <= 9999) Li_unused_36 = -24;
else
if (Li_12 >= 10000 && Li_12 <= 99999) Li_unused_36 = -29;
}
}
}
Comment("", "" + Li_12 + ":" + Ls_28 + "" + Li_24 + "",
"\n", "=======",
"\n", "" + Symbol() + "", " " + Period() + "",
"\n", "Spread : " + DoubleToStr(Ld_0, 1) + "",
"\n",
"\n", "",
"\n", "");
*/
// Arrows
for(i=0; i<limit; i++)
{
RSI=iRSI(NULL,0,sRSI,price,i);
CCI=iCCI(NULL,0,sCCI,price,i+1);
//double zz1 = iCustom(NULL,0,"Zigzag_v.2",zBar,LengthB,LengthK,1,i);
//double zz2 = iCustom(NULL,0,"Zigzag_v.2",zBar,LengthB,LengthK,0,i);
//if (zz1 != 0) {
if ( RSI > 80.0 && CCI < 50.0 &&
Open > Close && //bear
Open < Close && //bull
High - Close > High - Close )
{
b1 = High+Point*5;
}
//if (zz2 != 0) {
if ( RSI 50.0 &&
Open < Close && //bull
Open > Close && //bear
High - Close < High - Close )
{
b2 = Low-Point*5;
}
if (DoAlert && b2[1]!=0 && lastAlertTime!=Time[0])
{
sAlertMsg=" Alert - "+Symbol()+" "+TF2Str(Period())+"";
if (DoAlert) Alert(sAlertMsg);
lastAlertTime = Time[0];
if (alertMail) SendMail(sAlertMsg, "Alert!\n" + TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS )+"\n"+sAlertMsg);
}
else
if (b1[1]!=0 && lastAlertTime!=Time[0])
{
sAlertMsg=" Alert - "+Symbol()+" "+TF2Str(Period())+"";
if (DoAlert) Alert(sAlertMsg);
lastAlertTime = Time[0];
if (alertMail) SendMail(sAlertMsg, "Alert!\n" + TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS )+"\n"+sAlertMsg);
}
//}
//}
}
sinyal();
//-------------------------------------------------------------------+
return(0);
}
//+------------------------------------------------------------------+
string 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_H1: return("H1");
case PERIOD_H4: return("H4");
case PERIOD_D1: return("D1");
case PERIOD_W1: return("W1");
case PERIOD_MN1: return("MN1");
default: return("M"+iPeriod);
}
}
void sinyal(){
int shifti,Swingi,Swing_ni,uzli,ii,zui,zdi,mvi;
double LLi,HHi,BHi,BLi;
double Uzeli[10000][3];
// loop from first bar to current bar (with shift=0)
Swing_ni=0;Swingi=0;uzli=0;
BHi =High[zBar];BLi=Low[zBar];zui=zBar;zdi=zBar;
for (shifti=zBar;shifti>=0;shifti--) {
LLi=10000000;HHi=-100000000;
for (ii=shifti+LengthB;ii>=shifti+1;ii--) {
if (Low< LLi) {LLi=Low;}
if (High>HHi) {HHi=High;}
}
if (Low[shifti]HHi){
Swingi=2;
if (Swing_ni==1) {zui=shifti+1;}
if (Swing_ni==-1) {zdi=shifti+1;}
} else {
if (Low[shifti]<LLi) {Swingi=-1;}
if (High[shifti]>HHi) {Swingi=1;}
}
if (Swingi!=Swing_ni && Swing_ni!=0) {
if (Swingi==2) {
Swingi=-Swing_ni;BHi = High[shifti];BLi = Low[shifti];
}
uzli=uzli+1;
if (Swingi==1) {
Uzeli[1]=zdi;
Uzeli[2]=BLi;
}
if (Swingi==-1) {
Uzeli[1]=zui;
Uzeli[2]=BHi;
}
BHi = High[shifti];
BLi = Low[shifti];
}
if (Swingi==1) {
if (High[shifti]>=BHi) {BHi=High[shifti];zui=shifti;}}
if (Swingi==-1) {
if (Low[shifti]<=BLi) {BLi=Low[shifti]; zdi=shifti;}}
Swing_ni=Swingi;
}
for (ii=1;ii<=uzli;ii++) {
mvi=StrToInteger(DoubleToStr(Uzeli[1],0));
ExtMapBuffer2[mvi]=Uzeli[2];
previ=Uzeli[2];
}
}
助けてください....
このインジケータはシグナルが正しい時間に表示されません。
毎回チャートをリフレッシュしなければ なりません。
そしてアラートも修正してください
しゃいcebrez
それはインジケータが分解され、いくつかの他の部分から一緒にパッチされ、その結果、あなたは再塗装のインジケータ101である混乱を得たです。
忘れてください
セブレス
それは、デコンパイルや他のパーツからパッチを当てたインジケータで、その結果、リペイントインジケータ101のような混乱が発生しました。
それを忘れることが最善です。しかし、私はこのインジケータで良い結果を持っている、はい、そのリペイントは、私にとって何の問題もない...先生をお願いします。
私はここでZigZag_v.2と呼ばれるいくつかの他の部品を添付>>https://www.mql5.com/en/forum/174385/page417。
感謝