このカスタムインジケータ(iTrend.mq4)は、既存のEAにプログラムすることができますか...その場合、どのようにコード化されますか?

 
??
 
はい、可能です(記事「インジケータコードをExpert Advisorコードに転送 する」を参照してください。Expert Advisorの一般的な構造スキームとインジケータ機能) しかし、なぜですか?
 
wizkid:
??

カスタムインジケータの使用方法、または呼び出し方法については、非常に簡単です...「iCustom」を使用して、次のように関数を定義します。

double MyTrend=iCustom(NULL,0,"iTrend",0,0);

インジケータを "expert/indicator/"ディレクトリに置く。


他の値については、MetaEditor Libraryに全て記載されています。 その他、私の理解では、インジケータを関数のようにEAに組み込もうとするのは、時間とコンピュータ資源の 浪費です。別のファイルとして、それらは互いに競合することはありません。

 
seawolf wrote >>

if you are asking how to use, or call, a custom indicator, it's very simple... use the "iCustom" to define the function like this

place the indicator in the "expert/indicator/" directory... then there is no need to specify either the path, or use the .mq4 file extension.


everything you need to know about the other values is in the MetaEditor Library. Other than that, my understanding is that trying to build the indicator into your EA like a function is a waste of time and computer resources. you do not really gain anything, terminal handles indicators and EA's differently and the processing of the indicator would chew up availability of the EA to Terminal thread. As separate files they would not conflict with each other.

Rosh
wrote
>>
はい、可能です(記事「インジケータコードをExpert Advisorコードに転送 する」参照)。エキスパートアドバイザーとインジケータ関数の一般的な構造スキーム)。

おっしゃるとおりにしたのですが、コンパイルするとこのようなメッセージが出ます。

 

iTrend インジケータに入力パラメータがありますか?

もしあれば、iCustom()呼び出しの中で指定する必要があります。

 
phy wrote>>

iTrend インジケータに入力パラメータがありますか?

もしあれば、それらは iCustom() 呼び出しで指定する必要があります。

入力パラメータは、ここで指定する必要があります...double MyTrend=iCustom(NULL,0,"iTrend",0,0);

 

double MyTrend=iCustom(NULL,0,"iTrend",P1, P2, P3, P4, 0,0);

すべての入力パラメータを指定する必要がありますね。いくつあるんだ?

 
phy wrote>>

double MyTrend=iCustom(NULL,0,"iTrend",P1, P2, P3, P4, 0,0);

すべての入力パラメータを指定する必要がありますね。何個あるんですか?

7つあります。つまり、P1からP7まで次のようになります。double MyTrend=iCustom(NULL,0,"iTrend",P1, P2, P3, P4, P5, P6,P7, 0,0);

 
wizkid wrote>>

7つあるので、P1からP7まで以下のようになります。double MyTrend=iCustom(NULL,0,"iTrend",P1, P2, P3, P4, P5, P6,P7, 0,0);

というエラーメッセージが出ます。

 

名前はiTrendなのかi_Trendなのか?

 
phy wrote>>

名前はiTrendなのかi_Trendなのか?

iTrend

理由: