//| "Voting" that price will grow. |//| INPUT: no. |//| OUTPUT: number of "votes" that price will grow. |//| REMARK: no. |//+------------------------------------------------------------------+int CSignalTEMA::LongCondition()
{
int result=0;
int idx =StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed barif(DiffCloseMA(idx)<0.0)
{
//--- the close price is below the indicatorif(IS_PATTERN_USAGE(1) && DiffOpenMA(idx)>0.0 && DiffMA(idx)>0.0)
{
//--- the open price is above the indicator (i.e. there was an intersection), but the indicator is directed upwards
result=m_pattern_1;
//--- consider that this is an unformed "piercing" and suggest to enter the market at the current price
m_base_price=0.0;
}
}
else
{
//--- the close price is above the indicator (the indicator has no objections to buying)if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
//--- if the model 2 is usedif(IS_PATTERN_USAGE(2) && DiffMA(idx)>0.0)
{
//--- the indicator is directed upwardsif(DiffOpenMA(idx)<0.0)
{
//--- the open price is below the indicator (i.e. there was an intersection)
result=m_pattern_2;
//--- suggest to enter the market at the "roll back"
m_base_price=m_symbol.NormalizePrice(MA(idx));
}
else
{
//--- the open price is above the indicatorif(DiffLowMA(idx)<0.0)
{
//--- the low price is below the indicator
result=m_pattern_2;
//--- consider that this is a formed "piercing" and suggest to enter the market at the current price
m_base_price=0.0;
}
}
}
}
//--- return the resultreturn(result);
}
//+------------------------------------------------------------------+//| "Voting" that price will fall. |//| INPUT: no. |//| OUTPUT: number of "votes" that price will fall. |//| REMARK: no. |//+------------------------------------------------------------------+int CSignalTEMA::ShortCondition()
{
int result=0;
int idx =StartIndex();
//--- analyze positional relationship of the close price and the indicator at the first analyzed barif(DiffCloseMA(idx)>0.0)
{
//--- the close price is above the indicatorif(IS_PATTERN_USAGE(1) && DiffOpenMA(idx)<0.0 && DiffMA(idx)<0.0)
{
//--- the open price is below the indicator (i.e. there was an intersection), but the indicator is directed downwards
result=m_pattern_1;
//--- consider that this is an unformed "piercing" and suggest to enter the market at the current price
m_base_price=0.0;
}
}
else
{
//--- the close price is below the indicator (the indicator has no objections to buying)if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
//--- if the model 2 is usedif(IS_PATTERN_USAGE(2) && DiffMA(idx)<0.0)
{
//--- the indicator is directed downwardsif(DiffOpenMA(idx)<0.0)---------------------------------------->ДОЛЖЕН БЫТЬ ЗНАК "БОЛЬШЕ"!!!
{
//--- the open price is above the indicator (i.e. there was an intersection)
result=m_pattern_2;
//--- suggest to enter the market at the "roll back"
m_base_price=m_symbol.NormalizePrice(MA(idx));
}
else
{
//--- the open price is below the indicatorif(DiffHighMA(idx)>0.0)
{
//--- the high price is above the indicator
result=m_pattern_2;
//--- consider that this is a formed "piercing" and suggest to enter the market at the current price
m_base_price=0.0;
}
}
}
}
//--- return the resultreturn(result);
}
のSignalMAライブラリにもあります。
int CSignalMA::ShortCondition()
{
.......
//--- analyze positional relationship of the close price and the indicator at the first analyzed barif(DiffCloseMA(idx)>0.0)
{
.......
}
else
{
//--- the close price is below the indicator (the indicator has no objections to buying)if(IS_PATTERN_USAGE(0))
result=m_pattern_0;
//--- if the model 2 is used
То что ниже не корректно:
if(DiffMA(idx)<0.0)
{
//--- the indicator is directed downwardsif(IS_PATTERN_USAGE(2) && DiffOpenMA(idx)<0.0)
{
.....
}
Последние 2 условия должны выглядеть так:
if(IS_PATTERN_USAGE(2) && DiffMA(idx)<0.0)
{
//--- the indicator is directed downwardsif(DiffOpenMA(idx)>0.0)
{
.....
}
どれだ?
いくつかのインジケーターで試してみましたが、どちらも以前は問題なく動作していたのに、今は動作しません。
2) コアに接続してテスト実行しようとすると、しばしば問題が発生する(n回目の実行で動作) 画像を参照してください。
テレパスのグループがすでにあなたの問題を調査しています。
iCustom()が正常に動作しないことは、テレパスでなくとも理解できます。
をクリックしてExpert Advisorのコードを実行し、テストすることができます。
double buffer[];
ResetLastError()。
int MA_handle = iCustom(NULL, 0, "Examples\Custom Moving Average", 21, 0, MODE_SMMA);
//int MA_handle = iMA(NULL, 0, 21, 0, MODE_SMMA, PRICE_MEDIAN);
Print("MA_handle = ", MA_handle, " error = ", GetLastError());
int copy = CopyBuffer(MA_handle, 0, 0, 5, buffer);
if (copy == -1) Print("Failed to get Custom Moving Average indicator");
さもなくば
for (int i = 0; i < 5; i++) Print("buffer[", i, "] = ", buffer[i];
というメッセージが表示され、「カスタム移動平均のインジケータの値の取得に失敗しました」という結果になります。
すなわち、CopyBufferはiCustom()インジケータハンドルに対してエラー(-1を返す)を出します。もし標準のiMA()インジケータを取るなら、同じコードが動作します
出来上がった配列のインデックスの方向を見て、もしかしたら拡張する必要があるかもしれません。
インデックス方向はすべて正常で、以前のビルドではこれも動作していました。
私はこれまで何度も、開発者は端末の主要機能をもっと徹底的にテスト すべきだと提案してきました。
が、ビルドごとに、クリティカルなエラーではなく、異なるクリティカルなエラーが発生するのです。
つまり、あるものが修正されると、正常に動作していたものが壊れ、終わりが見えません。 安定版なんて来ないんだろうなぁ((
データをコピーする前のスリップでは、インジケーターの計算に時間がかかるため、ハンドルが正しく返っても、まだデータの計算が終わっていません。
一般的に、インジケータはiniteで呼び出し、OnTick()やその他の特別な関数で既にデータを要求することをお勧めします。
また、ゼロバーから5つのデータをコピーしていますが、コピーバッファのゼロバーは1970年前後にあります(最大バーの設定に依存します)。
データをコピーする前のスリップでは、インジケーターの計算に時間がかかるため、ハンドルは正しく戻るものの、データの計算がまだ行われていません。
Sleep(1000); // iCustom()を呼び出してから1秒後、役に立ちました。ディレイタイムを今拾うべきか? 計算にかかる時間はどうすればわかるのか?
ゴミを指して正しいインジケーターハンドルを出すのは間違っている!以前はそのような問題はなかったので、正しく動作していたはずだ。
一般的には、initisでインジケータを呼び出し、OnTick()や他の特別な関数ですでにデータを要求することをお勧めします。
それは私にとって良いヒントです、ありがとう )そのようにやっていたら、問題に気づかなかったでしょうから...。
ここでもゼロバーから5つのデータをコピーしていますが、コピーバッファのゼロバーは1970年前後(最大バーの設定に依存)なので、配列のインデックスを 見るように言いました。
ヘルプを見る限り、CopyBuffer()のゼロバーは実際には「現在」であり、コピー時にはすでに配列が展開されているようです。
Sleep(1000); // iCustom()を呼び出してから1秒後、助かりました。遅延時間はどうすればいいのでしょうか? 計算にかかる時間はどうすればいいのでしょうか?
ゴミを示すインジケーターハンドルを正しく表示するのは間違っている!以前はそのような問題はなかったので、正しく動作していたはずだ。
以下のインジケーターオプション(赤枠)は、プログラムで設定することは可能ですか?
その方法は見つかっていません。
バグかどうかわかりませんが、マスター用の全種類のミュービング(SignalFrAMA, SignalAMA, SignalMA, SignalDEMA, SignalTEMA)のライブラリのコードに誤りがあるようです、CSignalTEMA::ShortCondition() を参照してください。
のSignalMAライブラリにもあります。
バグかどうかわかりませんが、マスター用の全種類のミュービング(SignalFrAMA, SignalAMA, SignalMA, SignalDEMA, SignalTEMA)のライブラリのコードに誤りがあるようです、CSignalTEMA::ShortCondition()を参照してください。
のSignalMAライブラリにもあります。
https://www.mql5.com/ru/forum/1111/page391#comment_67358
通話内容をフルラインで伝える。
/i:<MQL5フォルダのパス>を指定します。
完全なコールストリングを与える。
ここでは、試したすべての選択肢を紹介します。
各試行後、ファイルがパス上に存在するかどうかを確認した。
D:\Users\Дмитрий\AppData\Roaming\MetaQuotes\Terminal\44 D6FB562C883F0C70690F3306A3851D\MQL5\Scripts\sInstallerTestScript.ex5
道を踏み外した侵入者
D:\Users\Дмитрий\AppData\Roaming\MetaQuotes\Terminal\44 D6FB562C883F0C70690F3306A3851D\MQL5\Include\InstallerTestInclude\IncInstallerTest.mqh
が存在します。
機能で存在確認を行った。