//| "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()并没有像它应该的那样工作。
以测试它,你可以运行专家顾问的代码。
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()指标,同样的代码是有效的
看看所产生的数组的索引方向,也许它需要扩展。
索引方向一切正常,在以前的版本中也是如此。在448和450中,它没有工作。
我曾多次建议,开发人员应更彻底地测试终端的主要功能。
但从构建到构建,他们得到不同的关键错误,而不是关键错误。
我想我永远不会看到一个稳定的版本出现(())。
在复制数据之前的滑移,需要时间来计算指标,所以即使手柄正确返回,数据还没有被计算出来。
一般来说,建议在inite中调用指标,并在OnTick()或其他特殊函数中已经请求数据。
同样,你从零条复制了5个数据,但在复制缓冲区中,零条是在1970年左右(取决于最大条数的设置),这就是为什么我说要看数组的索引。
在复制数据之前的滑移,需要时间来计算指标,所以尽管手柄正确返回,但数据还没有被计算出来。
Sleep(1000); // 调用iCustom()后1秒确实有帮助,但。我应该现在拿起延迟时间吗? 我应该如何知道计算过程将需要多长时间?
给予正确的指示器手柄指向垃圾是不对的!而且它以前一定是正常工作的,因为没有这样的问题。
一般来说,建议在初始阶段调用指标,并在OnTick()或其他特殊函数中要求提供数据。
这对我来说是一个很好的提示,谢谢 )因为如果我这样做,我就不会看到这个问题......
你又一次从零条复制了5个数据,但在copyBuffer中零条是在1970年左右(取决于最大条数的设置),这就是为什么我说要看数组的索引。
根据我对帮助文档的理解,在CopyBuffer()中,零条实际上是 "当前时间",而且在复制时,数组已经被扩展。
Sleep(1000); //调用iCustom()后的1秒确实有帮助,但是......我现在应该选择什么样的延迟时间? 我应该如何知道计算过程将需要多长时间?
给予正确的指示器手柄指示垃圾是不对的!而且它以前一定是正常工作的,因为没有这样的问题。
以下指标选项(红色圈出的)能否以编程方式设置?
我还没有找到一个方法来做这件事。
我不知道这是否是一个错误,但我认为在所有类型的muvings(SignalFrAMA、SignalAMA、SignalMA、SignalDEMA、SignalTEMA)的主库的代码中存在错误,见CSignalTEMA::ShortCondition()
同样在SignalMA库中的
我不知道这是否是一个错误,但我认为在所有类型的muvings(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存在。
存在性检查是由函数执行的。