XQ小幫手你好,
請問一下, 若想要篩選符合多個條件, 可以用下列語法?
condition7 = condition2 and condition3 and condition4;
condition8 = condition5 and condition6;
if condition1 or condition7 or condition8 then ret=1 ;
XQ小幫手你好,
請問一下, 若想要篩選符合多個條件, 可以用下列語法?
condition7 = condition2 and condition3 and condition4;
condition8 = condition5 and condition6;
if condition1 or condition7 or condition8 then ret=1 ;
Hello JingGang,
可以,您這就等同於如下語法。
if condition1 or (condition2 and condition3 and condition4) or (condition5 and condition6) then ret = 1;
你好,
不知道為什麼, 我用OR的語法, 但是輸出只有 condition8 ?
可以幫我檢查一下為什麼嗎?
謝謝
condition1 = GetField("Volume", "D") > GetField("Volume", "D")[1] and GetField("Volume", "D")[1] < average(GetField("Volume", "D")[1], 5) and close > high[1];
condition2 = trueall(getfield("Volume", "D")[1] < getfield("Volume", "D")[2], 5);
condition3 = getfield("Volume", "D") > lowest(getfield("Volume", "D"), 6);
condition4 = close > getfield("high", "D")[lowestbar(getfield("Volume", "D"), 6)];
value1 = average(volume, 5);
value2 = truecount(volume < value1, 5);
value3 = lowestbar(volume, value2);
condition5 = value3 <> 0;
condition6 = high[value3] < close;
condition7 = condition2 and condition3 and condition4;
condition8 = condition5 and condition6;
if condition1 or condition7 or condition8 then ret=1 ;
3 評論