//+------------------------------------------------------------------+//| Check for long position opening |//+------------------------------------------------------------------+bool CSampleExpert::LongOpened_1(void)
{
bool res=false;
//--- check for long position (BUY) possibilityif(m_macd_current_1<m_signal_current_1)
{
InpTradeCommand(InpLongOpened_1Command);
//--- in any case we must exit from expert
res=true;
}
//--- resultreturn(res);
}
//+------------------------------------------------------------------+//| Check for short position opening |//+------------------------------------------------------------------+bool CSampleExpert::ShortOpened_1(void)
{
bool res=false;
//--- check for short position (SELL) possibilityif(m_macd_current_1>m_signal_current_1)
{
InpTradeCommand(InpShortOpened_1Command);
//--- in any case we must exit from expert
res=true;
}
//--- resultreturn(res);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+//| main function returns true if any position processed |//+------------------------------------------------------------------+bool CSampleExpert::Processing_1(void)
{
//--- we work only at the time of the birth of new bardatetime time_0=iTime(m_symbol.Name(),Period_1,0);
if(time_0==ExtPrevBars_1)
return(false);
ExtPrevBars_1=time_0;
if(!m_symbol.RefreshRates())
{
ExtPrevBars_1=0;
return(false);
}
//--- refresh indicatorsif(BarsCalculated(m_handle_macd_1)<2)
return(false);
if(CopyBuffer(m_handle_macd_1,0,InpBars_1,2,m_buff_MACD_main_1) !=2 ||
CopyBuffer(m_handle_macd_1,1,InpBars_1,2,m_buff_MACD_signal_1)!=2)
{
ExtPrevBars_1=0;
return(false);
}
// m_indicators.Refresh();//--- to simplify the coding and speed up access//--- data are put into internal variables
m_macd_current_1 =m_buff_MACD_main_1[0];
m_signal_current_1 =m_buff_MACD_signal_1[0];
//--- check for long position (BUY) possibilityif(LongOpened_1())
return(true);
//--- check for short position (SELL) possibilityif(ShortOpened_1())
return(true);
//--- exit without position processingreturn(false);
}
//+------------------------------------------------------------------+
我不知道--这是我做的!我是自学成才的,都是靠科学探究。
\\\\\\\\\\\\\ 我自己也很惊讶--这似乎也是一个好的结果--我的专家很重--需要很长时间来测试
你的信号是不同的
原本是一个交叉的正负线
你的信号中也有主线
你有一个不同的信号
,在原来的交叉线加减
,你也有信号中的主线
是的!我用了三条线--负的(粉红色)线就像零--与它交叉的两条线给出了信号。
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
3月正处于下行期----------,我可能会在新年前完成这项测试。
是的!我使用了三条线--减去(粉红色)的线是零--而与之相交的两条线给出了一个信号
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
3月下去----------,我可能会在新年前完成这个测试(只完成了一半)。
如果猫头鹰使用自定义指标
,那么应该简单地将信号转移到专家顾问
,不要使用该指标。
对不起,你能根据我对adx-buy-sell指标的要求创建一个专家顾问吗?
如果它是一个信号指标 - 你可以使用这个专家顾问(mt4)https://www.mql5.com/ru/forum/310846/page63#comment_17088893
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
黄色标记的地方--写上你的指标名称
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
如果你用一个十字架,没有未来,那就没有利润了
如果猫头鹰使用自定义指标
,那么你只需要将信号转移到EA
,而不是使用指标。
我有一个沉重的专家顾问,从事实来看,它有很多的功能,从水平线和趋势线。
这里是https://www.mql5.com/ru/code/34046
函数本身--从这里开始工作的指标
如果你用一个十字架,没有未来,就没有利润。
不过,我有一个不同的结果--在测试结束前还有一段路要走
TOTAL:"来回ADX "3月和4月指标--由于某种原因没有成功。
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
以下是指标本身
结果:指标“来回 ADX”3 月 4 月 - 由于某种原因不成功
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
这是指标
在这里,专家在测试仪中巧妙地工作 - 检查信号指标
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
更正 - 没有写在这里