請問小幫手:
if average(c,5) cross average(close,20)
then value1 = high;
if clsoe > value1 and "value1發生在過去5天內"
then ret=1;
請問" " 內的表述要如何撰寫?用哪一個函數表達?
謝謝!
請問小幫手:
if average(c,5) cross average(close,20)
then value1 = high;
if clsoe > value1 and "value1發生在過去5天內"
then ret=1;
請問" " 內的表述要如何撰寫?用哪一個函數表達?
謝謝!
Hello Prudent,
如果您是要判斷過去5根Bar內是否有發生過 average(c,5) cross average(close,20) 的狀況的話,可以參考 TrueAny 函數。
舉例來說,使用在日頻率上:
condition1 = average(c,5) cross average(close,20);
if condition1 then value1 = high;
if close > high and trueany(condition1, 5) then ret = 1;
trueany(condition1, 5) 就會是過去5日內 condition1 是否有達成。
謝謝小幫手!
問題果然解決了,非常謝謝!!
2 評論