MAOnStochastic
Индикатор MAOnStochastic представляет из себя некоторую модификацию уже известных индикаторов. Добавлена третья линия - Stochastic сглаженный при помощи индикатора iMA (Moving Average, MA). По своей сути - это сигнальная линия Stochastic, только выполненная через другую технологию - создание хендла индикатора iMA на базе Stochastic.
Код:
//--- create handle of the indicator iStochastic
handle_iStochastic=iStochastic(Symbol(),Period(),
Inp_STO_Kperiod,Inp_STO_Dperiod,Inp_STO_slowing,
Inp_STO_ma_method,Inp_STO_price_field);
//--- 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 iStochastic indicator for the symbol %s/%s, error code %d",
Symbol(),
EnumToString(Period()),
GetLastError());
//--- the indicator is stopped early
m_init_error=true;
return(INIT_SUCCEEDED);
}
//--- create handle of the indicator iMA
handle_iMA=iMA(Symbol(),Period(),Inp_MA_ma_period,Inp_MA_ma_shift,
Inp_MA_ma_method,handle_iStochastic);
//--- if the handle is not created
if(handle_iMA==INVALID_HANDLE)
{
//--- tell about the failure and output the error code
PrintFormat("Failed to create handle of the iMA indicator for the symbol %s/%s, error code %d",
Symbol(),
EnumToString(Period()),
GetLastError());
//--- the indicator is stopped early
m_init_error=true;
return(INIT_SUCCEEDED);
}