各位帮忙看,为什么通不过?
//KDJ1Params
Numeric N(9);
Numeric M1(3);
Numeric M2(3);
Vars
NumericSeries HighestValue;
NumericSeries lowestValue;
NumericSeries RSV;
NumericSeries KValue;
NumericSeries DValue;
NumericSeries JValue;
Begin
NumericArray m15Close = HisData(Enum_Data_Close,Enum_Period_Min, 15,"",500);
NumericArray m15high = HisData(Enum_Data_High,Enum_Period_Min, 15,"",500);
NumericArray m15low = HisData(Enum_Data_Low,Enum_Period_Min, 15,"",500);
HighestValue = iHHV(m15high,N);
lowestValue = iLLV(m15low,N);
RSV=(m15Close-lowestValue)/(HighestValue-lowestValue)*100;
KValue=iSMA(RSV,M1,1);
DValue=iSMA(KValue,M2,1);
JValue = 3*KValue-2*DValue;
End m15Close m15high m15low这三个都是数组,数组不能直接运算,可以使用下标取数组中的某一个元素进行运算,也可以使用数组运算函数进行计算。 能给个示范例子吗 类似于这样。
RSV=(m15Close-lowestValue)/(HighestValue-lowestValue)*100; //KDJ1
Params
Numeric N(9);
Numeric M1(3);
Numeric M2(3);
Vars
NumericSeries HighestValue;
NumericSeries lowestValue;
NumericSeries RSV;
NumericSeries KValue;
NumericSeries DValue;
NumericSeries JValue;
Begin
NumericArray m15Close = HisData(Enum_Data_Close,Enum_Period_Min, 15,"",500);
NumericArray m15high = HisData(Enum_Data_High,Enum_Period_Min, 15,"",500);
NumericArray m15low = HisData(Enum_Data_Low,Enum_Period_Min, 15,"",500);
HighestValue = iHHV(m15high,N);
lowestValue = iLLV(m15low,N);
RSV=(m15Close-lowestValue)/(HighestValue-lowestValue)*100;
KValue=iSMA(RSV,M1,1);
PlotNumeric("K",KValue);
End KValue算不出来 //KDJ1
Params
Numeric N(9);
Numeric M1(3);
Numeric M2(3);
Vars
NumericSeries HighestValue;
NumericSeries lowestValue;
NumericSeries RSV;
NumericSeries KValue;
NumericSeries DValue;
NumericSeries JValue;
Begin
NumericArray m15Close = HisData(Enum_Data_Close,Enum_Period_Min, 15,"",500);
NumericArray m15high = HisData(Enum_Data_High,Enum_Period_Min, 15,"",500);
NumericArray m15low = HisData(Enum_Data_Low,Enum_Period_Min, 15,"",500);
HighestValue = iHHV(m15high,N);
lowestValue = iLLV(m15low,N);
RSV=(m15Close-lowestValue)/(HighestValue-lowestValue)*100;
NumericArray RSVArr;
for(int i =0;i<N*9;i++){
Numeric mk=((m15Close-lowestValue),i)/((HighestValue-lowestValue),i)*100;
ArrAdd(RSVArr,mk);
}
KValue=iSMA(RSVArr,M1,1);
PlotNumeric("K",KValue);
End 求高手帮助,求KValue值
页:
[1]