//value1成交比重
if (GetSymbolField("TSE.TW","成交金額(元)","D")+GetSymbolField("OTC.TW","成交金額(元)","D")) <> 0
then value1 = getField("成交金額(元)","D") / (GetSymbolField("TSE.TW","成交金額(元)","D")+GetSymbolField("OTC.TW","成交金額(元)","D"))*100;
if date <> date[1] then condition1 = false;
if (time = 090000 and volume > 0 and value1 >= 0.1)
or (time = 090200 and trueAll(volume[1] = 0,2) and value1 >= 0.1) then condition1 = true;
if time = 090300 and condition1 = false then raiseRunTimeError("第1跟K比重未達標");

//value1成交比重
if (GetSymbolField("TSE.TW","成交金額(元)","D")+GetSymbolField("OTC.TW","成交金額(元)","D")) <> 0
then value1 = getField("成交金額(元)","D") / (GetSymbolField("TSE.TW","成交金額(元)","D")+GetSymbolField("OTC.TW","成交金額(元)","D"))*100;
if date <> date[1] then condition1 = false;
if (time = 090000 and volume > 0 and value1 >= 0.1)
or (time = 090200 and trueAll(volume[1] = 0,2) and value1 >= 0.1) then condition1 = true;
if time >= 090300 and condition1 = false then raiseRunTimeError("第1跟K比重未達標");

想抓成交值靠前的標的,程式第9行 = 跟 >= 的結果為什麼差這多,明顯>= 很多標的是符合的
,但是顯示錯誤,還是哪裡邏輯有問題?
time = 090200 and trueAll(volume[1] = 0,2),是因為有些標的緩開盤。
4 評論