vbs如何向公式系統(tǒng)傳遞數(shù)組 [金字塔]
- 咨詢內(nèi)容:
vbs中有如下類型數(shù)據(jù),如何向金字塔公式系統(tǒng)傳遞?
dc := 1000;
VARIABLE:openPrice2[dc]=0;
<%vOpenPrice2 = ffl.vardata("openPrice2")
'對vOpenPrice2數(shù)組中每個元素進行計算處理并賦值'......
ffl.vardata("openPrice2") = vOpenPrice2
%>
請問以上寫法正確嗎?
- 金字塔客服:
測試一下不就知道了,用MSGBOX打印看看傳遞過去的數(shù)據(jù)是否是數(shù)組
- 用戶回復(fù):
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 '前面一根是陽線,后面連續(xù)陰線
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)) '連續(xù)陰線直到遇到陽線為止
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 '前面一根是陰線,后面連續(xù)陽線
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)) '連續(xù)陽線直到遇到陰線為止
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”!請問問題出在哪兒了?
- 網(wǎng)友回復(fù):
你的數(shù)組用法是有問題的,因為定義的數(shù)組與序列變量還是有些區(qū)別
openPrice2:=c;
highPrice2:=c;
lowPrice2:=c;
closePrice2:=c;你這樣定義這4個變量為序列變量酒可以解決了
如果以上指標公式不適用于您常用的行情軟件
或者您想改編成選股公式,以便快速選出某種形態(tài)個股的話,
- 上一篇:Demoaddin 為什么生成是adi文件
- 下一篇:沒有了!
相關(guān)文章
-
沒有相關(guān)內(nèi)容