Stochastic Custom and Label
Суть индикатора Stochastic Custom and Label вынести уровни (#1 и #2) во входные параметры (полезно при вызове индикатора из эксперта и визуализации), а также добавить графический объект OBJ_LABEL в который выводится текущее значение линии 'Main'
Пример вызова данного индикатора из эксперта (показаны входные параметры и создание хендла в OnInit) ***
Код:
input group "Stochastic"
input int Inp_STO_KPeriod = 5; // K period
input int Inp_STO_DPeriod = 3; // D period
input int Inp_STO_Slowing = 3; // Slowing
input double Inp_STO_Level1 = 25.0; // Value Level #1 (25.0)
input double Inp_STO_Level2 = 75.0; // Value Level #2 (75.0)
***
//--- create handle of the indicator iCustom
handle_iStochastic=iCustom(m_symbol.Name(),Period(),"Stochastic Custom",
Inp_STO_KPeriod,Inp_STO_DPeriod,Inp_STO_Slowing,Inp_STO_Level1,Inp_STO_Level2);
//--- if the handle is not created
if(handle_iStochastic==INVALID_HANDLE)
{
//--- tell about the failure and output the error code
PrintFormat("Failed to create handle of the iCustom indicator for the symbol %s/%s, error code %d",
m_symbol.Name(),
EnumToString(Period()),
GetLastError());
//--- the indicator is stopped early
return(INIT_FAILED);
}