1,某根k指多少周期范围内的k?
2,过去10根k的所有成交量和当前k成交量的比亏损比例?
根据你上述的需要表达,无法很友好的实现,只能采用下列方式处理掉。逐根比较计算范围内的值,并且必须在序列模式下。
my_sum:=0;
if ref(c,1)>close then my_sum:=my_sum+ref(VOL,1);
if ref(c,2)>close then my_sum:=my_sum+ref(VOL,2);
if ref(c,3)>close then my_sum:=my_sum+ref(VOL,3);
if ref(c,4)>close then my_sum:=my_sum+ref(VOL,4);
if ref(c,5)>close then my_sum:=my_sum+ref(VOL,5);
aa:sum(VOL,5);
bbb:my_sum/sum(VOL,5);
for循环由于必须使用数组参与,只能定位到一组数据。
//for i=1 to 5 do begin
// if close[DATACOUNT-i]>close[DATACOUNT] then my_sum:=my_sum+VOL[DATACOUNT-i];
//end