-- 作者:macro
-- 发布时间:2012/5/4 9:52:09
--
openPrice := open; highPrice := high; lowPrice := low; closePrice := close; dc := 1000; VARIABLE:openPrice2[dc]=0,highPrice2[dc]=0,lowPrice2[dc]=0,closePrice2[dc]=0; <% vOpenPrice = ffl.vardata("openPrice") vHighPrice = ffl.vardata("highPrice") vLowPrice = ffl.vardata("lowPrice") vClosePrice = ffl.vardata("closePrice") last = ubound(vOpenPrice) vo = 0 vh = 0 vl = 0 vc = 0 i = 1 j = 0 dim openPriceArray(1000) dim highPriceArray(1000) dim lowPriceArray(1000) dim closePriceArray(1000) do while(i <= last) if ((vOpenPrice(i) > vClosePrice(i)) and (vOpenPrice(i-1) < vClosePrice(i-1))) then \'前面一根是阳线,后面连续阴线 vo = vOpenPrice(i) vh = vHighPrice(i) vl = vLowPrice(i) vc = vClosePrice(i) i = i + 1 do until ((vOpenPrice(i+1) < vClosePrice(i+1)) or (i > 1000)) \'连续阴线直到遇到阳线为止 vc = vClosePrice(i) if (vHighPrice(i) > vh) then vh = vHighPrice(i) end if if (vLowPrice(i) < vl) then vl = vLowPrice(i) end if i = i + 1 loop openPriceArray(j) = vo highPriceArray(j) = vh lowPriceArray(j) = vl closePriceArray(j) = vc j = j + 1 end if if ((vOpenPrice(i) < vClosePrice(i)) and (vOpenPrice(i-1) > vClosePrice(i-1))) then \'前面一根是阴线,后面连续阳线 vo = vOpenPrice(i) vh = vHighPrice(i) vl = vLowPrice(i) vc = vClosePrice(i) i = i + 1 do until ((vOpenPrice(i+1) > vClosePrice(i+1)) or (i > 1000)) \'连续阳线直到遇到阴线为止 vc = vClosePrice(i) if (vHighPrice(i) > vh) then vh = vHighPrice(i) end if if (vLowPrice(i) < vl) then vl = vLowPrice(i) end if i = i + 1 loop openPriceArray(j) = vo highPriceArray(j) = vh lowPriceArray(j) = vl closePriceArray(j) = vc j = j + 1 end if loop ffl.vardata("openPrice2") = openPriceArray ffl.vardata("highPrice2") = highPriceArray ffl.vardata("lowPrice2") = lowPriceArray ffl.vardata("closePrice2") = closePriceArray %> //KLINE(openPrice,highPrice,lowPrice,closePrice,1); KLINE(openPrice2,highPrice2,lowPrice2,closePrice2,1);
采用这种方式,编译通不过,提示“未定义的变量:OPENPRICE2”!请问问题出在哪儿了?
|