初心者の方からの質問 MQL4 MT4 MetaTrader 4 - ページ 12 1...5678910111213141516171819...260 新しいコメント Renat Akhtyamov 2016.11.29 13:17 #111 MT4端末でパソコンの システム時刻に 連動させる方法をご存知の方、アドバイスをお願いします。- チャート- オープンオーダー- 取引履歴- 過去ログ- 過去ログ時間が同期していないことです。何が問題なのでしょうか? Refresh052 2016.11.29 16:59 #112 こんにちは。ボリューム・インジケータの 一つをベースに、私のパラメータに合わせて作り直し、必要なものだけを残して、今では必要な矢印だけを表示するようにしました。緑や赤の矢印が点灯したときにメッセージがポップアップするように、ALERTを添付させることができないのです。助けてください!Z.U. いろいろなチュートリアルを見てみたが、うまくいかない。 Stanislav Aksenov 2016.11.29 17:16 #113 Refresh052:こんにちは。ボリューム・インジケータの 一つをベースに、私のパラメータに合わせて作り直し、必要なものだけを残して、今では必要な矢印だけを表示するようにしました。緑や赤の矢印が点灯したときにメッセージがポップアップするように、ALERTを添付させることができないのです。助けてください!Z.U. いろいろなチュートリアルを見てみたが、うまくいかない。 さあ、ここにインジケータのすべてのコードを入れてください。 Refresh052 2016.11.29 17:23 #114 Stanislav Aksenov: インジケーターのコードを全てここに書き込んでください。#プロパティの厳密さ#property indicator_chart_window#property indicator_minimum 0#property indicator_buffers 2#property indicator_color1 レッド#プロパティ indicator_color2 Lime#property indicator_width1 4#property indicator_width2 4extern ENUM_APPLIED_PRICE price = PRICE_CLOSE;extern double 買われ過ぎ = 80;extern double Oversold = 20;extern int NumberOfBars = 500;extern string Note = "0 は全てのバーを表示する";extern int MAPeriod = 100;extern int LookBack = 20;extern bool Alert=True;double red[],lime[];//+------------------------------------------------------------------+//| カスタムインジケータ初期化関数//+------------------------------------------------------------------+int init(){//---- インジケータSetIndexBuffer(0,red)を設定します。SetIndexStyle(0,DRAW_ARROW, STYLE_SOLID,3)を設定します。SetIndexArrow(0,234)。SetIndexLabel(0, "クライマックス・ハイ");SetIndexBuffer(1,lime)を設定します。SetIndexStyle(1,DRAW_ARROW, STYLE_SOLID,3)を設定します。SetIndexArrow(1,233)。SetIndexLabel(1, "クライマックス・ロー")を設定します。SetIndexEmptyValue(0,0.0);SetIndexEmptyValue(1,0.0);SetIndexDrawBegin(0,0)を設定します。SetIndexDrawBegin(1,0)を設定します。IndicatorShortName("MKSP_Volume" );//----return(0)です。}//+------------------------------------------------------------------+//| カスタムインジケータ初期化関数//+------------------------------------------------------------------+int deinit(){//----//----return(0)です。}//+------------------------------------------------------------------+//| カスタムインジケータ反復関数//+------------------------------------------------------------------+int start(){double VolLowest,Range,Value2,Value3,HiValue2,HiValue3,LoValue3, tempv2,tempv3int制限。int counted_bars=IndicatorCounted();//---- 最後にカウントされたバーが再カウントされます。if(counted_bars>0) counted_bars--;if ( NumberOfBars == 0 )NumberOfBars = Bars-counted_bars;limit=NumberOfBars; //Bars-counted_bars;for(int i=0; i<limit; i++){red[i] = 0; lime[i] = 0;Value2=0;Value3=0;HiValue2=0;HiValue3=0;LoValue3=99999999;tempv2=0;tempv3=0;tempv=0;VolLowest = Volume[iLowest(NULL,0,MODE_VOLUME,20,i)];if (音量[i] == VolLowest){}Range = (High[i]-Low[i]);Value2 = Volume[i]*Range;if ( レンジ != 0 )Value3 = Volume[i]/Range;for ( int n=i;n<i+MAPeriod;n++ ){tempv= Volume[n] + tempv;}for ( int n=i;n<i+LookBack;n++){tempv2 = Volume[n]*((High[n]-Low[n]));if ( tempv2 >= HiValue2 )HiValue2 = tempv2;if ( Volume[n]*((High[n]-Low[n])))!= 0 ){tempv3 = Volume[n] / ((High[n]-Low[n]));if ( tempv3 > HiValue3 )HiValue3 = tempv3;if ( tempv3 < LoValue3 )LoValue3 = tempv3;}}if ( Value2 == HiValue2 && Close[i] > (High[i] + Low[i]) / 2 ){red[i] = High[i]+10*Point;}if ( 値3 == HiValue3 ){NormalizeDouble(Volume[i],0)とする。red[i]=0;}if ( Value2 == HiValue2 && Value3 == HiValue3 ){NormalizeDouble(Volume[i],0)とする。red[i]=0;}if ( Value2 == HiValue2 && Close[i] <= (High[i] + Low[i]) / 2 ){lime[i] = Low[i]-10*Point;}}//----//----return(0)です。}//+------------------------------------------------------------------+そしてスクリーンショット ファイル: 1bbzpa47ca123456.png 199 kb Questions from Beginners MQL4 アスク! コーディングのヘルプ Refresh052 2016.11.29 17:24 #115 Stanislav Aksenov: さあ、ここにインジケーターのコードを全部入れてください。 Alertをどこに貼ればいいのかがわからない Alekseu Fedotov 2016.11.29 17:30 #116 Refresh052:そしてスクリーンショット if ( Value2 == HiValue2 && Close[i] > (High[i] + Low[i]) / 2 ) { red[i] = High[i]+10*Point; Alert("==================="); } if ( Value3 == HiValue3 ) { NormalizeDouble(Volume[i],0); red[i]=0; } if ( Value2 == HiValue2 && Value3 == HiValue3 ) { NormalizeDouble(Volume[i],0); red[i]=0; } if ( Value2 == HiValue2 && Close[i] <= (High[i] + Low[i]) / 2 ) { lime[i] = Low[i]-10*Point; Alert("==================="); } Refresh052 2016.11.29 17:36 #117 Alekseu Fedotov: if ( Value2 == HiValue2 && Close[i] > (High[i] + Low[i]) / 2 ) { red[i] = High[i]+10*Point; Alert("==================="); } if ( Value3 == HiValue3 ) { NormalizeDouble(Volume[i],0); red[i]=0; } if ( Value2 == HiValue2 && Value3 == HiValue3 ) { NormalizeDouble(Volume[i],0); red[i]=0; } if ( Value2 == HiValue2 && Close[i] <= (High[i] + Low[i]) / 2 ) { lime[i] = Low[i]-10*Point; Alert("==================="); } すべてのキャンドルは、より正確に毎秒を通知します。 Stanislav Aksenov 2016.11.29 17:38 #118 #property strict#property indicator_chart_window#property indicator_minimum 0#property indicator_buffers 2#property indicator_color1 Red#property indicator_color2 Lime#property indicator_width1 4#property indicator_width2 4extern ENUM_APPLIED_PRICE price = PRICE_CLOSE;extern double Overbought = 80;extern double Oversold = 20;extern int NumberOfBars = 500;extern string Note = "0 means Display all bars";extern int MAPeriod = 100;extern int LookBack = 20;extern bool Alert=True;double red[],lime[];//+------------------------------------------------------------------+int init() {//---- indicators SetIndexBuffer(0,red); SetIndexStyle(0,DRAW_ARROW, STYLE_SOLID,3); SetIndexArrow (0,234); SetIndexLabel(0,"Climax High "); SetIndexBuffer(1,lime); SetIndexStyle(1,DRAW_ARROW, STYLE_SOLID,3); SetIndexArrow (1,233); SetIndexLabel(1,"Climax Low "); SetIndexEmptyValue(0,0.0); SetIndexEmptyValue(1,0.0); SetIndexDrawBegin(0,0); SetIndexDrawBegin(1,0); IndicatorShortName("MKSP_Volume" ); return(0); }//+------------------------------------------------------------------+int deinit() { return(0); }int start(){ double VolLowest,Range,Value2,Value3,HiValue2,HiValue3,LoValue3,tempv2,tempv3,tempv; int limit; int counted_bars=IndicatorCounted();//---- last counted bar will be recounted if(counted_bars>0) counted_bars--; if ( NumberOfBars == 0 ) NumberOfBars = Bars-counted_bars; limit=NumberOfBars; //Bars-counted_bars; for(int i=0; i<limit; i++) { red[i] = 0; lime[i] = 0; Value2=0;Value3=0;HiValue2=0;HiValue3=0;LoValue3=99999999;tempv2=0;tempv3=0;tempv=0; VolLowest = Volume[iLowest(NULL,0,MODE_VOLUME,20,i)]; if (Volume[i] == VolLowest) { } Range = (High[i]-Low[i]); Value2 = Volume[i]*Range; if ( Range != 0 ) Value3 = Volume[i]/Range; for ( int n=i;n<i+MAPeriod;n++ ) { tempv= Volume[n] + tempv; } for( int n=i;n<i+LookBack;n++) { tempv2 = Volume[n]*((High[n]-Low[n])); if ( tempv2 >= HiValue2 ) HiValue2 = tempv2; if ( Volume[n]*((High[n]-Low[n])) != 0 ) { tempv3 = Volume[n] / ((High[n]-Low[n])); if ( tempv3 > HiValue3 ) HiValue3 = tempv3; if ( tempv3 < LoValue3 ) LoValue3 = tempv3; } } if ( Value2 == HiValue2 && Close[i] > (High[i] + Low[i]) / 2 ) { red[i] = High[i]+10*Point; if(i==0) Alert("Вроде бы красная стрелка"); } if ( Value3 == HiValue3 ) { NormalizeDouble(Volume[i],0); red[i]=0; } if ( Value2 == HiValue2 && Value3 == HiValue3 ) { NormalizeDouble(Volume[i],0); red[i]=0; } if ( Value2 == HiValue2 && Close[i] <= (High[i] + Low[i]) / 2 ) { lime[i] = Low[i]-10*Point; if(i==0) Alert("Вроде бы зеленая стрелка"); } } return(0); }コードをプレーンテキストで書かずに、専用のレイアウトで書いてください。よくわからなかったんです。原則として、最後のバー(ゼロ)にシグナルがある場合にアラートを発します。 Questions from Beginners MQL4 コーディングのヘルプ Ask! Refresh052 2016.11.29 17:44 #119 Stanislav Aksenov:#property strict#property indicator_chart_window#property indicator_minimum 0#property indicator_buffers 2#property indicator_color1 Red#property indicator_color2 Lime#property indicator_width1 4#property indicator_width2 4extern ENUM_APPLIED_PRICE price = PRICE_CLOSE;extern double Overbought = 80;extern double Oversold = 20;extern int NumberOfBars = 500;extern string Note = "0 means Display all bars";extern int MAPeriod = 100;extern int LookBack = 20;extern bool Alert=True;double red[],lime[];//+------------------------------------------------------------------+int init() {//---- indicators SetIndexBuffer(0,red); SetIndexStyle(0,DRAW_ARROW, STYLE_SOLID,3); SetIndexArrow (0,234); SetIndexLabel(0,"Climax High "); SetIndexBuffer(1,lime); SetIndexStyle(1,DRAW_ARROW, STYLE_SOLID,3); SetIndexArrow (1,233); SetIndexLabel(1,"Climax Low "); SetIndexEmptyValue(0,0.0); SetIndexEmptyValue(1,0.0); SetIndexDrawBegin(0,0); SetIndexDrawBegin(1,0); IndicatorShortName("MKSP_Volume" ); return(0); }//+------------------------------------------------------------------+int deinit() { return(0); }int start(){ double VolLowest,Range,Value2,Value3,HiValue2,HiValue3,LoValue3,tempv2,tempv3,tempv; int limit; int counted_bars=IndicatorCounted();//---- last counted bar will be recounted if(counted_bars>0) counted_bars--; if ( NumberOfBars == 0 ) NumberOfBars = Bars-counted_bars; limit=NumberOfBars; //Bars-counted_bars; for(int i=0; i<limit; i++) { red[i] = 0; lime[i] = 0; Value2=0;Value3=0;HiValue2=0;HiValue3=0;LoValue3=99999999;tempv2=0;tempv3=0;tempv=0; VolLowest = Volume[iLowest(NULL,0,MODE_VOLUME,20,i)]; if (Volume[i] == VolLowest) { } Range = (High[i]-Low[i]); Value2 = Volume[i]*Range; if ( Range != 0 ) Value3 = Volume[i]/Range; for ( int n=i;n<i+MAPeriod;n++ ) { tempv= Volume[n] + tempv; } for( int n=i;n<i+LookBack;n++) { tempv2 = Volume[n]*((High[n]-Low[n])); if ( tempv2 >= HiValue2 ) HiValue2 = tempv2; if ( Volume[n]*((High[n]-Low[n])) != 0 ) { tempv3 = Volume[n] / ((High[n]-Low[n])); if ( tempv3 > HiValue3 ) HiValue3 = tempv3; if ( tempv3 < LoValue3 ) LoValue3 = tempv3; } } if ( Value2 == HiValue2 && Close[i] > (High[i] + Low[i]) / 2 ) { red[i] = High[i]+10*Point; if(i==0) Alert("Вроде бы красная стрелка"); } if ( Value3 == HiValue3 ) { NormalizeDouble(Volume[i],0); red[i]=0; } if ( Value2 == HiValue2 && Value3 == HiValue3 ) { NormalizeDouble(Volume[i],0); red[i]=0; } if ( Value2 == HiValue2 && Close[i] <= (High[i] + Low[i]) / 2 ) { lime[i] = Low[i]-10*Point; if(i==0) Alert("Вроде бы зеленая стрелка"); } } return(0); }メッセージにコードを 平文で書かず、コードレイアウトを使用する。まだよく分かっていないんです。 最後のバーでシグナルが出たらアラートを出すのがルールなので、正しい場所に置いたつもりなのですが...。 OKありがとうございます、やってみます、また別レッスン)))) Refresh052 2016.11.29 18:04 #120 Stanislav Aksenov:#property strict#property indicator_chart_window#property indicator_minimum 0#property indicator_buffers 2#property indicator_color1 Red#property indicator_color2 Lime#property indicator_width1 4#property indicator_width2 4extern ENUM_APPLIED_PRICE price = PRICE_CLOSE;extern double Overbought = 80;extern double Oversold = 20;extern int NumberOfBars = 500;extern string Note = "0 means Display all bars";extern int MAPeriod = 100;extern int LookBack = 20;extern bool Alert=True;double red[],lime[];//+------------------------------------------------------------------+int init() {//---- indicators SetIndexBuffer(0,red); SetIndexStyle(0,DRAW_ARROW, STYLE_SOLID,3); SetIndexArrow (0,234); SetIndexLabel(0,"Climax High "); SetIndexBuffer(1,lime); SetIndexStyle(1,DRAW_ARROW, STYLE_SOLID,3); SetIndexArrow (1,233); SetIndexLabel(1,"Climax Low "); SetIndexEmptyValue(0,0.0); SetIndexEmptyValue(1,0.0); SetIndexDrawBegin(0,0); SetIndexDrawBegin(1,0); IndicatorShortName("MKSP_Volume" ); return(0); }//+------------------------------------------------------------------+int deinit() { return(0); }int start(){ double VolLowest,Range,Value2,Value3,HiValue2,HiValue3,LoValue3,tempv2,tempv3,tempv; int limit; int counted_bars=IndicatorCounted();//---- last counted bar will be recounted if(counted_bars>0) counted_bars--; if ( NumberOfBars == 0 ) NumberOfBars = Bars-counted_bars; limit=NumberOfBars; //Bars-counted_bars; for(int i=0; i<limit; i++) { red[i] = 0; lime[i] = 0; Value2=0;Value3=0;HiValue2=0;HiValue3=0;LoValue3=99999999;tempv2=0;tempv3=0;tempv=0; VolLowest = Volume[iLowest(NULL,0,MODE_VOLUME,20,i)]; if (Volume[i] == VolLowest) { } Range = (High[i]-Low[i]); Value2 = Volume[i]*Range; if ( Range != 0 ) Value3 = Volume[i]/Range; for ( int n=i;n<i+MAPeriod;n++ ) { tempv= Volume[n] + tempv; } for( int n=i;n<i+LookBack;n++) { tempv2 = Volume[n]*((High[n]-Low[n])); if ( tempv2 >= HiValue2 ) HiValue2 = tempv2; if ( Volume[n]*((High[n]-Low[n])) != 0 ) { tempv3 = Volume[n] / ((High[n]-Low[n])); if ( tempv3 > HiValue3 ) HiValue3 = tempv3; if ( tempv3 < LoValue3 ) LoValue3 = tempv3; } } if ( Value2 == HiValue2 && Close[i] > (High[i] + Low[i]) / 2 ) { red[i] = High[i]+10*Point; if(i==0) Alert("Вроде бы красная стрелка"); } if ( Value3 == HiValue3 ) { NormalizeDouble(Volume[i],0); red[i]=0; } if ( Value2 == HiValue2 && Value3 == HiValue3 ) { NormalizeDouble(Volume[i],0); red[i]=0; } if ( Value2 == HiValue2 && Close[i] <= (High[i] + Low[i]) / 2 ) { lime[i] = Low[i]-10*Point; if(i==0) Alert("Вроде бы зеленая стрелка"); } } return(0); }コードをプレーンテキストで書かずに、専用のレイアウトで書いてください。よくわからなかったんです。原則として、最後のバー(ゼロ)にシグナルがある場合にアラートを発します。 毎秒、アラートが鳴り響く 1...5678910111213141516171819...260 新しいコメント 取引の機会を逃しています。 無料取引アプリ 8千を超えるシグナルをコピー 金融ニュースで金融マーケットを探索 新規登録 ログイン スペースを含まないラテン文字 このメールにパスワードが送信されます エラーが発生しました Googleでログイン WebサイトポリシーおよびMQL5.COM利用規約に同意します。 新規登録 MQL5.com WebサイトへのログインにCookieの使用を許可します。 ログインするには、ブラウザで必要な設定を有効にしてください。 ログイン/パスワードをお忘れですか? Googleでログイン
MT4端末でパソコンの システム時刻に 連動させる方法をご存知の方、アドバイスをお願いします。
- チャート
- オープンオーダー
- 取引履歴
- 過去ログ
- 過去ログ
時間が同期していないことです。
何が問題なのでしょうか?
こんにちは。
ボリューム・インジケータの 一つをベースに、私のパラメータに合わせて作り直し、必要なものだけを残して、今では必要な矢印だけを表示するようにしました。
緑や赤の矢印が点灯したときにメッセージがポップアップするように、ALERTを添付させることができないのです。
助けてください!
Z.U. いろいろなチュートリアルを見てみたが、うまくいかない。
こんにちは。
ボリューム・インジケータの 一つをベースに、私のパラメータに合わせて作り直し、必要なものだけを残して、今では必要な矢印だけを表示するようにしました。
緑や赤の矢印が点灯したときにメッセージがポップアップするように、ALERTを添付させることができないのです。
助けてください!
Z.U. いろいろなチュートリアルを見てみたが、うまくいかない。
インジケーターのコードを全てここに書き込んでください。
#プロパティの厳密さ
#property indicator_chart_window
#property indicator_minimum 0
#property indicator_buffers 2
#property indicator_color1 レッド
#プロパティ indicator_color2 Lime
#property indicator_width1 4
#property indicator_width2 4
extern ENUM_APPLIED_PRICE price = PRICE_CLOSE;
extern double 買われ過ぎ = 80;
extern double Oversold = 20;
extern int NumberOfBars = 500;
extern string Note = "0 は全てのバーを表示する";
extern int MAPeriod = 100;
extern int LookBack = 20;
extern bool Alert=True;
double red[],lime[];
//+------------------------------------------------------------------+
//| カスタムインジケータ初期化関数
//+------------------------------------------------------------------+
int init()
{
//---- インジケータ
SetIndexBuffer(0,red)を設定します。
SetIndexStyle(0,DRAW_ARROW, STYLE_SOLID,3)を設定します。
SetIndexArrow(0,234)。
SetIndexLabel(0, "クライマックス・ハイ");
SetIndexBuffer(1,lime)を設定します。
SetIndexStyle(1,DRAW_ARROW, STYLE_SOLID,3)を設定します。
SetIndexArrow(1,233)。
SetIndexLabel(1, "クライマックス・ロー")を設定します。
SetIndexEmptyValue(0,0.0);
SetIndexEmptyValue(1,0.0);
SetIndexDrawBegin(0,0)を設定します。
SetIndexDrawBegin(1,0)を設定します。
IndicatorShortName("MKSP_Volume" );
//----
return(0)です。
}
//+------------------------------------------------------------------+
//| カスタムインジケータ初期化関数
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0)です。
}
//+------------------------------------------------------------------+
//| カスタムインジケータ反復関数
//+------------------------------------------------------------------+
int start()
{
double VolLowest,Range,Value2,Value3,HiValue2,HiValue3,LoValue3, tempv2,tempv3
int制限。
int counted_bars=IndicatorCounted();
//---- 最後にカウントされたバーが再カウントされます。
if(counted_bars>0) counted_bars--;
if ( NumberOfBars == 0 )
NumberOfBars = Bars-counted_bars;
limit=NumberOfBars; //Bars-counted_bars;
for(int i=0; i<limit; i++)
{
red[i] = 0; lime[i] = 0;
Value2=0;Value3=0;HiValue2=0;HiValue3=0;LoValue3=99999999;tempv2=0;tempv3=0;tempv=0;
VolLowest = Volume[iLowest(NULL,0,MODE_VOLUME,20,i)];
if (音量[i] == VolLowest)
{
}
Range = (High[i]-Low[i]);
Value2 = Volume[i]*Range;
if ( レンジ != 0 )
Value3 = Volume[i]/Range;
for ( int n=i;n<i+MAPeriod;n++ )
{
tempv= Volume[n] + tempv;
}
for ( int n=i;n<i+LookBack;n++)
{
tempv2 = Volume[n]*((High[n]-Low[n]));
if ( tempv2 >= HiValue2 )
HiValue2 = tempv2;
if ( Volume[n]*((High[n]-Low[n])))!= 0 )
{
tempv3 = Volume[n] / ((High[n]-Low[n]));
if ( tempv3 > HiValue3 )
HiValue3 = tempv3;
if ( tempv3 < LoValue3 )
LoValue3 = tempv3;
}
}
if ( Value2 == HiValue2 && Close[i] > (High[i] + Low[i]) / 2 )
{
red[i] = High[i]+10*Point;
}
if ( 値3 == HiValue3 )
{
NormalizeDouble(Volume[i],0)とする。
red[i]=0;
}
if ( Value2 == HiValue2 && Value3 == HiValue3 )
{
NormalizeDouble(Volume[i],0)とする。
red[i]=0;
}
if ( Value2 == HiValue2 && Close[i] <= (High[i] + Low[i]) / 2 )
{
lime[i] = Low[i]-10*Point;
}
}
//----
//----
return(0)です。
}
//+------------------------------------------------------------------+
そしてスクリーンショット
さあ、ここにインジケーターのコードを全部入れてください。
そしてスクリーンショット
{
red[i] = High[i]+10*Point;
Alert("===================");
}
if ( Value3 == HiValue3 )
{
NormalizeDouble(Volume[i],0);
red[i]=0;
}
if ( Value2 == HiValue2 && Value3 == HiValue3 )
{
NormalizeDouble(Volume[i],0);
red[i]=0;
}
if ( Value2 == HiValue2 && Close[i] <= (High[i] + Low[i]) / 2 )
{
lime[i] = Low[i]-10*Point;
Alert("===================");
}
{
red[i] = High[i]+10*Point;
Alert("===================");
}
if ( Value3 == HiValue3 )
{
NormalizeDouble(Volume[i],0);
red[i]=0;
}
if ( Value2 == HiValue2 && Value3 == HiValue3 )
{
NormalizeDouble(Volume[i],0);
red[i]=0;
}
if ( Value2 == HiValue2 && Close[i] <= (High[i] + Low[i]) / 2 )
{
lime[i] = Low[i]-10*Point;
Alert("===================");
}
#property strict
#property indicator_chart_window
#property indicator_minimum 0
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Lime
#property indicator_width1 4
#property indicator_width2 4
extern ENUM_APPLIED_PRICE price = PRICE_CLOSE;
extern double Overbought = 80;
extern double Oversold = 20;
extern int NumberOfBars = 500;
extern string Note = "0 means Display all bars";
extern int MAPeriod = 100;
extern int LookBack = 20;
extern bool Alert=True;
double red[],lime[];
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexBuffer(0,red);
SetIndexStyle(0,DRAW_ARROW, STYLE_SOLID,3);
SetIndexArrow (0,234);
SetIndexLabel(0,"Climax High ");
SetIndexBuffer(1,lime);
SetIndexStyle(1,DRAW_ARROW, STYLE_SOLID,3);
SetIndexArrow (1,233);
SetIndexLabel(1,"Climax Low ");
SetIndexEmptyValue(0,0.0);
SetIndexEmptyValue(1,0.0);
SetIndexDrawBegin(0,0);
SetIndexDrawBegin(1,0);
IndicatorShortName("MKSP_Volume" );
return(0);
}
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
int start()
{
double VolLowest,Range,Value2,Value3,HiValue2,HiValue3,LoValue3,tempv2,tempv3,tempv;
int limit;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
if ( NumberOfBars == 0 ) NumberOfBars = Bars-counted_bars;
limit=NumberOfBars; //Bars-counted_bars;
for(int i=0; i<limit; i++)
{
red[i] = 0; lime[i] = 0;
Value2=0;Value3=0;HiValue2=0;HiValue3=0;LoValue3=99999999;tempv2=0;tempv3=0;tempv=0;
VolLowest = Volume[iLowest(NULL,0,MODE_VOLUME,20,i)];
if (Volume[i] == VolLowest)
{
}
Range = (High[i]-Low[i]);
Value2 = Volume[i]*Range;
if ( Range != 0 ) Value3 = Volume[i]/Range;
for ( int n=i;n<i+MAPeriod;n++ )
{
tempv= Volume[n] + tempv;
}
for( int n=i;n<i+LookBack;n++)
{
tempv2 = Volume[n]*((High[n]-Low[n]));
if ( tempv2 >= HiValue2 )
HiValue2 = tempv2;
if ( Volume[n]*((High[n]-Low[n])) != 0 )
{
tempv3 = Volume[n] / ((High[n]-Low[n]));
if ( tempv3 > HiValue3 ) HiValue3 = tempv3;
if ( tempv3 < LoValue3 ) LoValue3 = tempv3;
}
}
if ( Value2 == HiValue2 && Close[i] > (High[i] + Low[i]) / 2 )
{
red[i] = High[i]+10*Point;
if(i==0) Alert("Вроде бы красная стрелка");
}
if ( Value3 == HiValue3 )
{
NormalizeDouble(Volume[i],0);
red[i]=0;
}
if ( Value2 == HiValue2 && Value3 == HiValue3 )
{
NormalizeDouble(Volume[i],0);
red[i]=0;
}
if ( Value2 == HiValue2 && Close[i] <= (High[i] + Low[i]) / 2 )
{
lime[i] = Low[i]-10*Point;
if(i==0) Alert("Вроде бы зеленая стрелка");
}}
return(0);
}
コードをプレーンテキストで書かずに、専用のレイアウトで書いてください。
よくわからなかったんです。
原則として、最後のバー(ゼロ)にシグナルがある場合にアラートを発します。
#property strict
#property indicator_chart_window
#property indicator_minimum 0
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Lime
#property indicator_width1 4
#property indicator_width2 4
extern ENUM_APPLIED_PRICE price = PRICE_CLOSE;
extern double Overbought = 80;
extern double Oversold = 20;
extern int NumberOfBars = 500;
extern string Note = "0 means Display all bars";
extern int MAPeriod = 100;
extern int LookBack = 20;
extern bool Alert=True;
double red[],lime[];
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexBuffer(0,red);
SetIndexStyle(0,DRAW_ARROW, STYLE_SOLID,3);
SetIndexArrow (0,234);
SetIndexLabel(0,"Climax High ");
SetIndexBuffer(1,lime);
SetIndexStyle(1,DRAW_ARROW, STYLE_SOLID,3);
SetIndexArrow (1,233);
SetIndexLabel(1,"Climax Low ");
SetIndexEmptyValue(0,0.0);
SetIndexEmptyValue(1,0.0);
SetIndexDrawBegin(0,0);
SetIndexDrawBegin(1,0);
IndicatorShortName("MKSP_Volume" );
return(0);
}
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
int start()
{
double VolLowest,Range,Value2,Value3,HiValue2,HiValue3,LoValue3,tempv2,tempv3,tempv;
int limit;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
if ( NumberOfBars == 0 ) NumberOfBars = Bars-counted_bars;
limit=NumberOfBars; //Bars-counted_bars;
for(int i=0; i<limit; i++)
{
red[i] = 0; lime[i] = 0;
Value2=0;Value3=0;HiValue2=0;HiValue3=0;LoValue3=99999999;tempv2=0;tempv3=0;tempv=0;
VolLowest = Volume[iLowest(NULL,0,MODE_VOLUME,20,i)];
if (Volume[i] == VolLowest)
{
}
Range = (High[i]-Low[i]);
Value2 = Volume[i]*Range;
if ( Range != 0 ) Value3 = Volume[i]/Range;
for ( int n=i;n<i+MAPeriod;n++ )
{
tempv= Volume[n] + tempv;
}
for( int n=i;n<i+LookBack;n++)
{
tempv2 = Volume[n]*((High[n]-Low[n]));
if ( tempv2 >= HiValue2 )
HiValue2 = tempv2;
if ( Volume[n]*((High[n]-Low[n])) != 0 )
{
tempv3 = Volume[n] / ((High[n]-Low[n]));
if ( tempv3 > HiValue3 ) HiValue3 = tempv3;
if ( tempv3 < LoValue3 ) LoValue3 = tempv3;
}
}
if ( Value2 == HiValue2 && Close[i] > (High[i] + Low[i]) / 2 )
{
red[i] = High[i]+10*Point;
if(i==0) Alert("Вроде бы красная стрелка");
}
if ( Value3 == HiValue3 )
{
NormalizeDouble(Volume[i],0);
red[i]=0;
}
if ( Value2 == HiValue2 && Value3 == HiValue3 )
{
NormalizeDouble(Volume[i],0);
red[i]=0;
}
if ( Value2 == HiValue2 && Close[i] <= (High[i] + Low[i]) / 2 )
{
lime[i] = Low[i]-10*Point;
if(i==0) Alert("Вроде бы зеленая стрелка");
}}
return(0);
}
メッセージにコードを 平文で書かず、コードレイアウトを使用する。
まだよく分かっていないんです。
最後のバーでシグナルが出たらアラートを出すのがルールなので、正しい場所に置いたつもりなのですが...。
#property strict
#property indicator_chart_window
#property indicator_minimum 0
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Lime
#property indicator_width1 4
#property indicator_width2 4
extern ENUM_APPLIED_PRICE price = PRICE_CLOSE;
extern double Overbought = 80;
extern double Oversold = 20;
extern int NumberOfBars = 500;
extern string Note = "0 means Display all bars";
extern int MAPeriod = 100;
extern int LookBack = 20;
extern bool Alert=True;
double red[],lime[];
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexBuffer(0,red);
SetIndexStyle(0,DRAW_ARROW, STYLE_SOLID,3);
SetIndexArrow (0,234);
SetIndexLabel(0,"Climax High ");
SetIndexBuffer(1,lime);
SetIndexStyle(1,DRAW_ARROW, STYLE_SOLID,3);
SetIndexArrow (1,233);
SetIndexLabel(1,"Climax Low ");
SetIndexEmptyValue(0,0.0);
SetIndexEmptyValue(1,0.0);
SetIndexDrawBegin(0,0);
SetIndexDrawBegin(1,0);
IndicatorShortName("MKSP_Volume" );
return(0);
}
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
int start()
{
double VolLowest,Range,Value2,Value3,HiValue2,HiValue3,LoValue3,tempv2,tempv3,tempv;
int limit;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
if ( NumberOfBars == 0 ) NumberOfBars = Bars-counted_bars;
limit=NumberOfBars; //Bars-counted_bars;
for(int i=0; i<limit; i++)
{
red[i] = 0; lime[i] = 0;
Value2=0;Value3=0;HiValue2=0;HiValue3=0;LoValue3=99999999;tempv2=0;tempv3=0;tempv=0;
VolLowest = Volume[iLowest(NULL,0,MODE_VOLUME,20,i)];
if (Volume[i] == VolLowest)
{
}
Range = (High[i]-Low[i]);
Value2 = Volume[i]*Range;
if ( Range != 0 ) Value3 = Volume[i]/Range;
for ( int n=i;n<i+MAPeriod;n++ )
{
tempv= Volume[n] + tempv;
}
for( int n=i;n<i+LookBack;n++)
{
tempv2 = Volume[n]*((High[n]-Low[n]));
if ( tempv2 >= HiValue2 )
HiValue2 = tempv2;
if ( Volume[n]*((High[n]-Low[n])) != 0 )
{
tempv3 = Volume[n] / ((High[n]-Low[n]));
if ( tempv3 > HiValue3 ) HiValue3 = tempv3;
if ( tempv3 < LoValue3 ) LoValue3 = tempv3;
}
}
if ( Value2 == HiValue2 && Close[i] > (High[i] + Low[i]) / 2 )
{
red[i] = High[i]+10*Point;
if(i==0) Alert("Вроде бы красная стрелка");
}
if ( Value3 == HiValue3 )
{
NormalizeDouble(Volume[i],0);
red[i]=0;
}
if ( Value2 == HiValue2 && Value3 == HiValue3 )
{
NormalizeDouble(Volume[i],0);
red[i]=0;
}
if ( Value2 == HiValue2 && Close[i] <= (High[i] + Low[i]) / 2 )
{
lime[i] = Low[i]-10*Point;
if(i==0) Alert("Вроде бы зеленая стрелка");
}}
return(0);
}
コードをプレーンテキストで書かずに、専用のレイアウトで書いてください。
よくわからなかったんです。
原則として、最後のバー(ゼロ)にシグナルがある場合にアラートを発します。