請問如何選出5日內曾發生訊號的個股?

  •   119 
  • 最後發表   Prudent  2023 九月 28
Prudent 發文於   2023/09/20

請問小幫手:

if average(c,5) cross average(close,20)

then value1 = high;

if clsoe > value1 and "value1發生在過去5天內"

then ret=1;

請問" " 內的表述要如何撰寫?用哪一個函數表達?

謝謝!

排序方式: 標準 | 最新
XQ小幫手 發文於   2023/09/28

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 是否有達成。

Prudent 發文於   2023/09/28

謝謝小幫手!

問題果然解決了,非常謝謝!!

發表回覆
Close