//+------------------------------------------------------------------+//| main function returns true if any position processed |//+------------------------------------------------------------------+bool CSampleExpert::Processing(void)
{
//--- refresh ratesif(!m_symbol.RefreshRates())
return(false);
//--- refresh indicatorsif(BarsCalculated(m_handle_macd)<2)
return(false);
if(CopyBuffer(m_handle_macd,1,0,2,m_buff_MACD_main) !=2)
return(false);
// m_indicators.Refresh();//--- to simplify the coding and speed up access//--- data are put into internal variables
m_macd_current =m_buff_MACD_main[0];
m_macd_previous =m_buff_MACD_main[1];
//--- it is important to enter the market correctly,//--- but it is more important to exit it correctly...//--- first check if position exists - try to select itif(m_position.Select(Symbol()))
{
if(m_position.PositionType()==POSITION_TYPE_BUY)
{
//--- try to close or modify long positionif(LongClosed())
return(true);
if(LongModified())
return(true);
}
else
{
//--- try to close or modify short positionif(ShortClosed())
return(true);
if(ShortModified())
return(true);
}
}
//--- no opened position identifiedelse
{
//--- check for long position (BUY) possibilityif(LongOpened())
return(true);
//--- check for short position (SELL) possibilityif(ShortOpened())
return(true);
}
//--- exit without position processingreturn(false);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+//| Check for short position opening |//+------------------------------------------------------------------+bool CSampleExpert::ShortOpened(void)
{
bool res=false;
//--- check for short position (SELL) possibilityif(m_macd_current>m_macd_previous)
{
intOnInit()
{
IndicatorSetInteger(INDICATOR_DIGITS,_Digits); // Точки после запятой//---SetIndexBuffer(0,level1,INDICATOR_DATA); // Назначение массива буферуSetIndexBuffer(1,
levelcol1,INDICATOR_COLOR_INDEX);
//--- задаем количество индексов цветов для графического построенияPlotIndexSetInteger(0,PLOT_COLOR_INDEXES,3);
//--- задаем цвет для каждого индексаPlotIndexSetInteger(0,PLOT_LINE_COLOR,0,LightSeaGreen);
PlotIndexSetInteger(0,PLOT_LINE_COLOR,1,DimGray);
PlotIndexSetInteger(0,PLOT_LINE_COLOR,2,Red);
在专家顾问中。3-颜色。3种情况。
//| Копируем значения индикаторов в массивы, используя хэндлы индикатора//+---------------------------------------------------------------------+if(CopyBuffer(VHandle,0,0,3,lv1)<0 || CopyBuffer(VHandle,1,0,3,lvcol1)<0)
{
Alert("Ошибка копирования буферов хэндла индикатора V2 - ошибка:",GetLastError(),"!!");
return;
}
这就是我到达的地方,但我现在应该点击哪个部分?
对不起,但#13520非常清楚。把它看作是家庭作业。我将无法再回答。
这是我到达的地方,但我现在必须点击哪个部分?
你找错地方了。只需重新启动MT5终端并打开终端中的 "日志 "选项卡。
你给我看了交易终端的信息,但我有一个关于Meta Tester5代理商管理程序的问题,我的代理商 没有连接到云端,可能是因为系统是Windows 10?
你有一个弱的处理器。你的内存非常少。你的CPU使用率经常很高。如果有人要求你做#13520,你就必须做。
顺便说一下,在您的MQL5档案 中检查一下--代理商是否出现,如果出现,他们的PR是多少?(你需要一个截图)。
1.如何使服务在启动MT5时自动启动?
2.该服务是否通过特定符号访问数据?也就是说,我可以在指定tf符号和其他的情况下获得iOpen()类型吗?
你好,请问你能帮助我吗?问题,如何将颜色指数传递给专家顾问?
CopyBuffer(VHandle,3,0,3,lvcol1)<0. 缓冲区为INDICATOR_COLOR_INDEX你好,请问你能帮助我吗?问题,你如何将颜色指数传递给EA?
CopyBuffer(VHandle,3,0,3,lvcol1)<0. Buffer - INDICATOR_COLOR_INDEX如果你想在变色时得到一个信号。
例如,我得到的信息是这样的
你需要看看指标中的缓冲区是什么。
它是1 - 我在专家顾问(黄色)中也写了1。
SanAlex 谢谢你的帮助。我有点糊涂了。不是缓冲区号码,而是颜色指数?
在指标。
在专家顾问中。3-颜色。3种情况。
转移线。不能做任何事情。确切地说,当颜色发生变化时,就会得到信号。
1.把光标放在最下面一行的开头,按左边的删除按钮。
2.亚历山大回答正确,甚至给出了代码,但像往常一样,它是一个混乱的,但他强调了你需要的东西...
你的第一个缓冲区包含一个指示器颜色的索引。因为你总共有3种颜色,这个缓冲区的值只能是0、1或2。因此,将第一个缓冲区的值读入一个数组,并检查这个数组是否包含0、1或2