barfreq & barinterval 使用問題!

  •   152 
  • 最後發表   Woody16  2022 七月 12
Woody16 發文於   2022/07/05

Hi Sir ,

        用在策略雷達中! 請問為什麼 barfreq  & barinterval  無法作用呢?

 ==下面 OK ==     

if CurrentTime >= 114800 

and GetField("成交量") > 1000 and GetField("成交量") > average(volume[1],1)*0.1

ret=1 ; 

 

== 下面 有問題 ==

if CurrentTime >= 114800 

and barfreq ="Min" and barinterval =2 

and GetField("成交量") > 1000 and GetField("成交量") > average(volume[1],1)*0.1

ret=1 ; 

===

排序方式: 標準 | 最新
musashi 發文於   2022/07/06

可能是策略雷達指定頻率沒有設定2分鐘,你可以用以下方式測試,barfreq  & barinterval是可以用在策略雷達中。

if c>0 

and barfreq ="Min" 

and barinterval =2 

then ret=1 ; 

Woody16 發文於   2022/07/06

Hi musashi,

    不管用 你的程式或我的程式都要在策略雷達中設頻率為 2 分鐘才會執行,如果不對的話!是不會動作的!另為請問一下 C 是何參數呢? 謝謝!

musashi 發文於   2022/07/07

c是close的縮寫。

Woody16 發文於   2022/07/07

收到,謝謝!

XQ小幫手 發文於   2022/07/12

Hello Woody16,

 

您可以參考 barfreqbarinterval 的說明。

 

if CurrentTime >= 114800 

and barfreq ="Min" and barinterval =2 

and GetField("成交量") > 1000 and GetField("成交量") > average(volume[1],1)*0.1

ret=1 ; 

 

這段中您的寫法是要求當執行頻率為2分鐘的時候才會是 true 並在其他條件符合時警示,其他頻率是不觸發的。

小幫手建議您可以先閱讀網站上的教學區,裡面有XS語法的基礎和應用。

發表回覆
Close