|
我是新人在網上找到這個Indicator,放到香港股票AB中出現 Warning 505.Division by zero. Divisor array at [13] is equal zero.
請問:
1> 怎樣解決這個除數組有0之部份
2> 怎樣知道每個Indicator計算出來之值是什麼 ? (例如:當股票第128棒時,PeriodRSI、PeriodStoch、HHV和LLV的值是多少。)
誠心求教,感激不盡!
_SECTION_BEGIN("Dynamic Trader Oscillator");
PeriodRSI= Param("PeriodRSI", 13, 1, 250, 1);
PeriodStoch=Param("PeriodStoch", 8, 1, 250, 1);
MAType=Param("MAType", 1, 1, 2, 1);
PeriodSK=Param ("PeriodSK", 5, 1, 250, 1);
PeriodSD=Param("PeriodSD", 3, 1, 250, 1);
Upper=Param("Upper", 70, 50, 100, 1);
Lower=Param("Lower", 30, 0, 50, 1);
StoRSI= 100*((RSI( PeriodRSI) -LLV( RSI( PeriodRSI ) , PeriodStoch ) ) / ( ( HHV( RSI( PeriodRSI) , PeriodStoch) ) - LLV(RSI(PeriodRSI), PeriodStoch ) ) );
// -------------- Warning 505.Division by zero. Divisor array at [13] is equal zero.
if(MAType==1)
{
SK=MA(StoRSI,PeriodSK);
SD=MA(SK,PeriodSD);
}
if(MAType==2)
{
SK=EMA(StoRSI,PeriodSK);
SD=EMA(SK,PeriodSD);
}
Plot(SK,"DTOscSK",ParamColor( "ColorSK", colorBlue ),styleLine);
Plot(SD,"DTOscSD",ParamColor( "ColorSD", colorYellow ),styleDashed);
Plot(0,"ZeroLine",ParamColor( "ColorZero", colorWhite ),styleLine);
Plot(Upper,"Upper",ParamColor( "ColorUpper", colorRed ),styleLine);
Plot(Lower,"Lower",ParamColor( "ColorLower", colorGreen ),styleLine);
_SECTION_END();
|
|