Hello! I am redesigning my Expert Advisor from the article https://www.mql5.com/ru/articles/648 and trying to insert my own function. The problem is, I can't change indicator to fractal. If signal_indicator_handles[s]=iMA(Symbols[s],_Period,IndicatorPeriod[s],0,MODE_SMA,PRICE_CLOSE) I replace it with iFractals(Symbols[s], PERIOD_M15); I get wrong price. Can you help and tweak the code?
//+------------------------------------------------------------------+//| Получает хэндлы индикаторов |//+------------------------------------------------------------------+void GetIndicatorHandles()
{
//--- Пройдемся по всем символамfor(int s=0; s<NUMBER_OF_SYMBOLS; s++)
{
//--- Если торговля по этому символу разрешенаif(Symbols[s]!="")
{
//--- Если хэндл еще не полученif(signal_indicator_handles[s]==INVALID_HANDLE)
{
//--- Получим хэндл индикатора
signal_indicator_handles[s]=iMA(Symbols[s],_Period,IndicatorPeriod[s],0,MODE_SMA,PRICE_CLOSE);
//--- Если не удалось получить хендл индикатораif(signal_indicator_handles[s]==INVALID_HANDLE)
Print("Не удалось получить хэндл индикатора для символа "+Symbols[s]+"!");
}
}
}
}
//+------------------------------------------------------------------+//| Получает значения индикаторов |//+------------------------------------------------------------------+bool GetIndicatorsData(int symbol_number)
{
//--- Количество значений индикаторного буфера для определения торгового сигнала int NumberOfValues=3;
//--- Если хэндл индикатора был полученif(signal_indicator_handles[symbol_number]!=INVALID_HANDLE)
{
//--- Установим обратный порядок индексации (... 3 2 1 0)ArraySetAsSeries(indicator[symbol_number].value,true);
//--- Получим значения индикатораif(CopyBuffer(signal_indicator_handles[symbol_number],0,0,NumberOfValues,indicator[symbol_number].value)<NumberOfValues)
{
Print("Не удалось скопировать значения ("+
Symbols[symbol_number]+"; "+TimeframeToString(_Period)+") в массив indicator! Ошибка ("+
IntegerToString(GetLastError())+"): "+ErrorDescription(GetLastError())+"");
return(false);
}
return(true);
}
//--- Если хэндл индикатора не получен, то...else
{
// ...попробуем получить его еще раз
GetIndicatorHandles();
}
return(false);
}
Проверка
Print("++++++++indicator[symbol_number][0]",Symbols[symbol_number],"= ",indicator[symbol_number].value[0]);
В этой статье мы рассмотрим реализацию простой схемы для мультивалютного эксперта. В данном случае имеется в виду, что эксперт можно будет настроить на тестирование/торговлю по одинаковым условиям, но с разными параметрами для каждого символа. В качестве примера создадим схему для двух символов, но сделаем это так, чтобы при необходимости можно было добавлять дополнительные символы, внося небольшие изменения в код.
Hi all, can you please tell me if it's possible to turn off the news of the category I'm not interested in and simply cluttering up the news window in MT5? How can I do it?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hello! I am redesigning my Expert Advisor from the article https://www.mql5.com/ru/articles/648 and trying to insert my own function. The problem is, I can't change indicator to fractal. If signal_indicator_handles[s]=iMA(Symbols[s],_Period,IndicatorPeriod[s],0,MODE_SMA,PRICE_CLOSE) I replace it with iFractals(Symbols[s], PERIOD_M15); I get wrong price. Can you help and tweak the code?
Do you create by hand?
No.
Hi all!
Help with this question.
How can I make the standard indicator used not be displayed in the MT4 chart window when testing of the Expert Advisor is completed?
Hi all!
Help with this question.
How can I make the standard indicator used not be displayed in the MT4 chart window when testing of the Expert Advisor is completed?
No.
You can get the identifier of the created graph as follows:
See help for HideTestIndicators()
Get the identifier of the created graph as follows: