有關警示問題

  •   96 
  • 最後發表   彭琪  2023 三月 21
彭琪 發文於   2023/03/20

1.在日内3分K頻率下,當收盤價突破當日前方最高點時發出警示,腳本該如何寫?

2.在日内3分K頻率下,在30分鐘範圍內(也就是10根K棒)當收盤價突破前方最高點時發出警示,腳本該如何寫?

3.在日内3分K頻率下,當收盤時的OBV值突破前方最高點時發出警示,腳本該如何寫?

4.在日内3分K頻率下,在30分鐘範圍內(也就是10根K棒)當收盤時的OBV值突破前方最高點時發出警示,腳本該如何寫?

XQ小幫手 發文於   2023/03/21

 Hello 彭琪,

 

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

這些都是很基礎的條件。

若教學文章有那裡不懂的話,可以告知讓小幫手請相關人員檢視。

 

您所謂的 30分鐘範圍內 ,是指 前方最高點 是這30分鐘內的最高點嗎?

如果是的話:

 

1.

value1 = getfield("High", "D");

if close > value1[1] then ret = 1;

 

2.

value1 = highest(high, 10);

if close > value1[1] then ret = 1;

 

OBV 的計算您可以參考內建指標,需注意obv會受到計算起點的影響,所以除非計算起點和指標相同,不然obv的數值會和指標的不同。

 

3.

variable: obvolume(0);

 

if CurrentBar = 1 then obvolume = 0 else begin

    if close > close[1] then obvolume = obvolume[1] + volume else begin

if close < close[1] then obvolume = obvolume[1] - volume 

        else obvolume = obvolume[1];

end;

    end;

 

if issessionfirstbar then value1 = obvolume;

if obvolume > value1 then begin

    ret = 1;

    value1 = obvolume;     //value1會是當天之前的最高obv

    end;

 

4.

variable: obvolume(0);

 

if CurrentBar = 1 then obvolume = 0 else begin

    if close > close[1] then obvolume = obvolume[1] + volume else begin

if close < close[1] then obvolume = obvolume[1] - volume 

        else obvolume = obvolume[1];

end;

    end;

 

value1 = highest(obvolume, 10);

if obvolume > value1[1] then ret = 1;

發表回覆
Close