コーディングの方法は? - ページ 338 1...331332333334335336337338339340341342343344345...347 新しいコメント Mladen Rakic 2015.06.03 12:53 #3371 at120: こんにちは、Malden!応援ありがとうございました! ;-) 教えていただいたようにコードを書いても (そうだと思うのですが...) #property indicator_chart_window double buffer[]; double mom1[]; int init() { SetIndexBuffer(0,buffer); SetIndexBuffer(1,mom1);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--) { mom1 = iCustom(NULL,0,"custom name",0,i); buffer = ( Mom(mom1,10,Bars,i); //doesn't work - no value in indi // Mom(mom1,10,Bars,i); //error: parameter conversation not allowed // mom1 // this works ); } return(0); } double Mom(const double& series[], int period, int totcount, int index) { if (totcount<1 || period<1) return (EMPTY_VALUE); if (indextotcount-1) return (EMPTY_VALUE); return (series-series); } ); ということで、「第一版」を使うと値が出ず...。 2番目のバージョンを使用すると、私はエラーが発生します...うーん。 mom1を呼ぶのだけはうまくいくのですが...これは正しい値ではないのですね...。 ありがとうございました。 バイバイ、AT カスタム名 " をインジケータ(既存インジケータ)の名前に置き換え、iCustom()の呼び出しにパラメータを追加すれば、動作するようになります。この名前はあくまで例として置いてあります。 また、バッファの数を定義していません(#property indicator_buffersやIndicatorBuffers()関数を 使用していません)。使用するバッファの数を定義してください。 _______________________ at120 2015.06.03 13:56 #3372 Mladenさん、こんにちは。 情報ありがとうございます...もうやってしまいましたが...コードはこのような感じです。 #property indicator_separate_window #property indicator_color3 Red #property indicator_width1 3 #property indicator_buffers 3 #property indicator_color1 LawnGreen #property indicator_color2 Red #include // here the mom() function is incl. double buffer[]; double mom1[]; int init() { SetIndexBuffer(0,buffer); SetIndexBuffer(1,mom1);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--) { mom1 = iCustom(NULL,0,"myIndi",0,i); buffer = ( Mom(mom1,10,Bars,i); //doesn't work - no value in indi // Mom(mom1,10,Bars,i); //error: parameter conversation not allowed // mom1 // this works, but no subfunction incl. ); } return(0); } //normaly in mqh incl. double Mom(const double& series[], int period, int totcount, int index) { if (totcount<1 || period<1) return (EMPTY_VALUE); if (indextotcount-1) return (EMPTY_VALUE); return (series-series); } ); 会話のエラーはまだ残っています... 助けてくれてありがとうございます さようなら、AT How to code? トレンド指標 コーディングのヘルプ Mladen Rakic 2015.06.03 14:05 #3373 at120: こんにちは、Mladen!情報ありがとうございます...もうやってしまいましたが...コードはこんな感じです。 #property indicator_separate_window #property indicator_color3 Red #property indicator_width1 3 #property indicator_buffers 3 #property indicator_color1 LawnGreen #property indicator_color2 Red #include // here the mom() function is incl. double buffer[]; double mom1[]; int init() { SetIndexBuffer(0,buffer); SetIndexBuffer(1,mom1);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--) { mom1 = iCustom(NULL,0,"myIndi",0,i); buffer = ( Mom(mom1,10,Bars,i); //doesn't work - no value in indi // Mom(mom1,10,Bars,i); //error: parameter conversation not allowed // mom1 // this works, but no subfunction incl. ); } return(0); } //normaly in mqh incl. double Mom(const double& series[], int period, int totcount, int index) { if (totcount<1 || period<1) return (EMPTY_VALUE); if (indextotcount-1) return (EMPTY_VALUE); return (series-series); } ); 会話のエラーはまだ残っています... ありがとうございました。 さようなら、AT 以下は、コンパイラーエラーがないバージョンです。_test.mq4 myIndi "が何なのかわからないので、iCustom()が "myIndi "インジケータからの値を返すかどうかテストできません。 ファイル: copiler.gif 52 kb _test.mq4 2 kb at120 2015.06.03 14:32 #3374 Mladenさん、こんにちは。 私のインジは、JMA.mq4 / JMA Indiからの通常の出力です。 また、MA出力や他のものである可能性もあります。"myIndi "は特別なindiではありません。 そして、indiの呼び出しは、通常のindiウィンドウで動作します... 私のコードはこのような感じです。 #property indicator_separate_window #property indicator_color3 Red #property indicator_width1 3 #property indicator_buffers 3 #property indicator_color1 LawnGreen #property indicator_color2 Red #include // here the mom() function is incl. double buffer[]; double mom1[]; int init() { SetIndexBuffer(0,buffer); SetIndexBuffer(1,mom1);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--) { mom1 = iCustom(NULL,0,"JMA",0,i); //normal JMA / MA output // I get this out put, and it's ok, but the second output (buffer) is zero... buffer = ( Mom(mom1,10,Bars,i); //no compiler error, but doesn't work - no value in indi window // Mom(mom1,10,Bars,i); //error: parameter conversation not allowed // mom1 // this works, but it's the value i want ); } return(0); } //normaly in mqh incl. double Mom(const double& series[], int period, int totcount, int index) { if (totcount<1 || period<1) return (EMPTY_VALUE); if (indextotcount-1) return (EMPTY_VALUE); return (series-series); } ); 私の作った失敗を得ることができません... 助けてくれてありがとうございました。 さようなら、AT How to code? [警告は閉鎖されました!】フォーラムを乱雑にしないために、どんな初心者の質問でも。プロフェッショナルは、通り過ぎないでください。あなたなしでは、どこにも行けない。 number of bars since at120 2015.06.09 06:59 #3375 ムラデンさん、こんにちは。 このように書いたり変更したりすると 会話エラーも出てしまいます...何かいい方法はありませんか? ありがとうございました。 さようなら、AT #property indicator_separate_window #property indicator_color3 Red #property indicator_width1 3 #property indicator_buffers 3 #property indicator_color1 LawnGreen #property indicator_color2 Red //#include // here the mom() function is incl. double buffer[]; double mom1[]; int init() { SetIndexBuffer(0,buffer); SetIndexBuffer(1,mom1);return(0); } //normaly in mqh incl. double Mom(const double& series[], int period, int totcount, int index) { if (totcount<1 || period<1) return (EMPTY_VALUE); if (indextotcount-1) return (EMPTY_VALUE); return (series-series); } 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--) { mom1 = iMA(Symbol(),Period(),13,8,MODE_SMMA,PRICE_MEDIAN,i); //normal JMA / MA output // I get this out put, and it's ok, but the second output (buffer) is zero... buffer = ( // Mom(mom1,10,Bars,i) //no compiler error, but doesn't work - no value in indi window Mom(mom1,10,Bars,i) //error: parameter conversation not allowed // mom1 // this works, but it is NOT the value i want ); } return(0); } How to code? problem indicators: using past [警告は閉鎖されました!】フォーラムを乱雑にしないために、どんな初心者の質問でも。プロフェッショナルは、通り過ぎないでください。あなたなしでは、どこにも行けない。 Mladen Rakic 2015.06.09 07:31 #3376 at120: こんにちは、Mladen! このように書いたり変更したりすると...会話エラーも出てしまいます...何かいい方法はないでしょうか...?ありがとうございました。さようなら、AT #property indicator_separate_window #property indicator_color3 Red #property indicator_width1 3 #property indicator_buffers 3 #property indicator_color1 LawnGreen #property indicator_color2 Red //#include // here the mom() function is incl. double buffer[]; double mom1[]; int init() { SetIndexBuffer(0,buffer); SetIndexBuffer(1,mom1);return(0); } //normaly in mqh incl. double Mom(const double& series[], int period, int totcount, int index) { if (totcount<1 || period<1) return (EMPTY_VALUE); if (indextotcount-1) return (EMPTY_VALUE); return (series-series); } 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--) { mom1 = iMA(Symbol(),Period(),13,8,MODE_SMMA,PRICE_MEDIAN,i); //normal JMA / MA output // I get this out put, and it's ok, but the second output (buffer) is zero... buffer = ( // Mom(mom1,10,Bars,i) //no compiler error, but doesn't work - no value in indi window Mom(mom1,10,Bars,i) //error: parameter conversation not allowed // mom1 // this works, but it is NOT the value i want ); } return(0); } at120 パラメータが const double[] であるはずなのに、doubleに 進化する要素を使うことはできません。mom1 "の代わりに "mom1 "を使ってください。 at120 2015.06.09 10:55 #3377 こんにちは、Mladen! そこで質問なのですが、double 型をどのように const double series[] に "変換" するのでしょうか? というのも、mom1だけを使用すると、出力として「0」が得られるからです...。 というのも、mom1だけを使うと出力が「0」になってしまうからです。そのためのサンプルコードはありますか? ありがとうございました。 Mladen Rakic 2015.06.09 11:33 #3378 at120: こんにちは、Mladen!回答ありがとうございます、そこで質問ですが、私のdoubleを私のconst double series[]に「変換」する方法です。 というのも、mom1だけを使用すると、出力として「0」が得られるからです...。 というのも、mom1だけを使うと出力が「0」になってしまうからです。サンプルコードはありますか? どうもありがとうございます。 何も「変換」する必要はありません。""の部分を削除した瞬間に、ちゃんとしたパラメータになります。 チャート上での見え方はこんな感じです。 そして、これがコードです。_test_2.mq4 ファイル: _test_2.mq4 1 kb test.gif 64 kb at120 2015.06.09 12:52 #3379 こんにちは、Mladen! IndicatorBuffers(2)を忘れていたようで、これでうまくいきました。 今は正しい値が表示されているようです。 助けてくれてありがとうございます。 さようなら、AT learning 2015.06.10 21:18 #3380 関数の パラメータでconstとして宣言する必要があるのはどのような配列ですか? 1...331332333334335336337338339340341342343344345...347 新しいコメント 取引の機会を逃しています。 無料取引アプリ 8千を超えるシグナルをコピー 金融ニュースで金融マーケットを探索 新規登録 ログイン スペースを含まないラテン文字 このメールにパスワードが送信されます エラーが発生しました Googleでログイン WebサイトポリシーおよびMQL5.COM利用規約に同意します。 新規登録 MQL5.com WebサイトへのログインにCookieの使用を許可します。 ログインするには、ブラウザで必要な設定を有効にしてください。 ログイン/パスワードをお忘れですか? Googleでログイン
こんにちは、Malden!
応援ありがとうございました! ;-)
教えていただいたようにコードを書いても
(そうだと思うのですが...)
#property indicator_chart_window
double buffer[];
double mom1[];
int init() { SetIndexBuffer(0,buffer); SetIndexBuffer(1,mom1);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--)
{
mom1 = iCustom(NULL,0,"custom name",0,i);
buffer = (
Mom(mom1,10,Bars,i);
//doesn't work - no value in indi
// Mom(mom1,10,Bars,i); //error: parameter conversation not allowed
// mom1 // this works
);
}
return(0);
}
double Mom(const double& series[], int period, int totcount, int index)
{
if (totcount<1 || period<1) return (EMPTY_VALUE);
if (indextotcount-1) return (EMPTY_VALUE);
return (series-series);
}
);ということで、「第一版」を使うと値が出ず...。
2番目のバージョンを使用すると、私はエラーが発生します...うーん。
mom1を呼ぶのだけはうまくいくのですが...これは正しい値ではないのですね...。
ありがとうございました。
バイバイ、ATカスタム名 " をインジケータ(既存インジケータ)の名前に置き換え、iCustom()の呼び出しにパラメータを追加すれば、動作するようになります。この名前はあくまで例として置いてあります。
また、バッファの数を定義していません(#property indicator_buffersやIndicatorBuffers()関数を 使用していません)。使用するバッファの数を定義してください。
_______________________
Mladenさん、こんにちは。
情報ありがとうございます...もうやってしまいましたが...コードはこのような感じです。
#property indicator_separate_window
#property indicator_color3 Red
#property indicator_width1 3
#property indicator_buffers 3
#property indicator_color1 LawnGreen
#property indicator_color2 Red
#include // here the mom() function is incl.
double buffer[];
double mom1[];
int init() { SetIndexBuffer(0,buffer); SetIndexBuffer(1,mom1);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--)
{
mom1 = iCustom(NULL,0,"myIndi",0,i);
buffer = (
Mom(mom1,10,Bars,i); //doesn't work - no value in indi
// Mom(mom1,10,Bars,i); //error: parameter conversation not allowed
// mom1 // this works, but no subfunction incl.
);
}
return(0);
}
//normaly in mqh incl.
double Mom(const double& series[], int period, int totcount, int index)
{
if (totcount<1 || period<1) return (EMPTY_VALUE);
if (indextotcount-1) return (EMPTY_VALUE);
return (series-series);
}
);
会話のエラーはまだ残っています...
助けてくれてありがとうございます
さようなら、AT
こんにちは、Mladen!
情報ありがとうございます...もうやってしまいましたが...コードはこんな感じです。
#property indicator_separate_window
#property indicator_color3 Red
#property indicator_width1 3
#property indicator_buffers 3
#property indicator_color1 LawnGreen
#property indicator_color2 Red
#include // here the mom() function is incl.
double buffer[];
double mom1[];
int init() { SetIndexBuffer(0,buffer); SetIndexBuffer(1,mom1);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--)
{
mom1 = iCustom(NULL,0,"myIndi",0,i);
buffer = (
Mom(mom1,10,Bars,i); //doesn't work - no value in indi
// Mom(mom1,10,Bars,i); //error: parameter conversation not allowed
// mom1 // this works, but no subfunction incl.
);
}
return(0);
}
//normaly in mqh incl.
double Mom(const double& series[], int period, int totcount, int index)
{
if (totcount<1 || period<1) return (EMPTY_VALUE);
if (indextotcount-1) return (EMPTY_VALUE);
return (series-series);
}
);
会話のエラーはまだ残っています...
ありがとうございました。
さようなら、AT以下は、コンパイラーエラーがないバージョンです。_test.mq4
myIndi "が何なのかわからないので、iCustom()が "myIndi "インジケータからの値を返すかどうかテストできません。
Mladenさん、こんにちは。
私のインジは、JMA.mq4 / JMA Indiからの通常の出力です。
また、MA出力や他のものである可能性もあります。"myIndi "は特別なindiではありません。
そして、indiの呼び出しは、通常のindiウィンドウで動作します...
私のコードはこのような感じです。
#property indicator_separate_window
#property indicator_color3 Red
#property indicator_width1 3
#property indicator_buffers 3
#property indicator_color1 LawnGreen
#property indicator_color2 Red
#include // here the mom() function is incl.
double buffer[];
double mom1[];
int init() { SetIndexBuffer(0,buffer); SetIndexBuffer(1,mom1);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--)
{
mom1 = iCustom(NULL,0,"JMA",0,i); //normal JMA / MA output
// I get this out put, and it's ok, but the second output (buffer) is zero...
buffer = (
Mom(mom1,10,Bars,i); //no compiler error, but doesn't work - no value in indi window
// Mom(mom1,10,Bars,i); //error: parameter conversation not allowed
// mom1 // this works, but it's the value i want
);
}
return(0);
}
//normaly in mqh incl.
double Mom(const double& series[], int period, int totcount, int index)
{
if (totcount<1 || period<1) return (EMPTY_VALUE);
if (indextotcount-1) return (EMPTY_VALUE);
return (series-series);
}
);
私の作った失敗を得ることができません...
助けてくれてありがとうございました。
さようなら、AT
ムラデンさん、こんにちは。
このように書いたり変更したりすると
会話エラーも出てしまいます...何かいい方法はありませんか?
ありがとうございました。
さようなら、AT
#property indicator_separate_window
#property indicator_color3 Red
#property indicator_width1 3
#property indicator_buffers 3
#property indicator_color1 LawnGreen
#property indicator_color2 Red
//#include // here the mom() function is incl.
double buffer[];
double mom1[];
int init() { SetIndexBuffer(0,buffer); SetIndexBuffer(1,mom1);return(0); }
//normaly in mqh incl.
double Mom(const double& series[], int period, int totcount, int index)
{
if (totcount<1 || period<1) return (EMPTY_VALUE);
if (indextotcount-1) return (EMPTY_VALUE);
return (series-series);
}
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--)
{
mom1 = iMA(Symbol(),Period(),13,8,MODE_SMMA,PRICE_MEDIAN,i); //normal JMA / MA output
// I get this out put, and it's ok, but the second output (buffer) is zero...
buffer = (
// Mom(mom1,10,Bars,i) //no compiler error, but doesn't work - no value in indi window
Mom(mom1,10,Bars,i) //error: parameter conversation not allowed
// mom1 // this works, but it is NOT the value i want
);
}
return(0);
}
こんにちは、Mladen!
このように書いたり変更したりすると...
会話エラーも出てしまいます...何かいい方法はないでしょうか...?
ありがとうございました。
さようなら、AT
#property indicator_separate_window
#property indicator_color3 Red
#property indicator_width1 3
#property indicator_buffers 3
#property indicator_color1 LawnGreen
#property indicator_color2 Red
//#include // here the mom() function is incl.
double buffer[];
double mom1[];
int init() { SetIndexBuffer(0,buffer); SetIndexBuffer(1,mom1);return(0); }
//normaly in mqh incl.
double Mom(const double& series[], int period, int totcount, int index)
{
if (totcount<1 || period<1) return (EMPTY_VALUE);
if (indextotcount-1) return (EMPTY_VALUE);
return (series-series);
}
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--)
{
mom1 = iMA(Symbol(),Period(),13,8,MODE_SMMA,PRICE_MEDIAN,i); //normal JMA / MA output
// I get this out put, and it's ok, but the second output (buffer) is zero...
buffer = (
// Mom(mom1,10,Bars,i) //no compiler error, but doesn't work - no value in indi window
Mom(mom1,10,Bars,i) //error: parameter conversation not allowed
// mom1 // this works, but it is NOT the value i want
);
}
return(0);
}
at120
パラメータが const double[] であるはずなのに、doubleに 進化する要素を使うことはできません。mom1 "の代わりに "mom1 "を使ってください。
こんにちは、Mladen!
そこで質問なのですが、double 型をどのように const double series[] に "変換" するのでしょうか?
というのも、mom1だけを使用すると、出力として「0」が得られるからです...。
というのも、mom1だけを使うと出力が「0」になってしまうからです。そのためのサンプルコードはありますか?
ありがとうございました。
こんにちは、Mladen!
回答ありがとうございます、そこで質問ですが、私のdoubleを私のconst double series[]に「変換」する方法です。
というのも、mom1だけを使用すると、出力として「0」が得られるからです...。
というのも、mom1だけを使うと出力が「0」になってしまうからです。サンプルコードはありますか?
どうもありがとうございます。何も「変換」する必要はありません。""の部分を削除した瞬間に、ちゃんとしたパラメータになります。
チャート上での見え方はこんな感じです。
そして、これがコードです。_test_2.mq4
こんにちは、Mladen!
IndicatorBuffers(2)を忘れていたようで、これでうまくいきました。
今は正しい値が表示されているようです。
助けてくれてありがとうございます。
さようなら、AT
関数の パラメータでconstとして宣言する必要があるのはどのような配列ですか?