自訂指標的跨頻率寫法

  •   467 
  • 最後發表   RayQ  2024 五月 08
RayQ 發文於   2024/04/25

各位前輩日安:

小弟有一個之前前輩分享的"超級趨勢指標"的腳本
想把5分K的數值,跨頻率畫在1分K上

但是寫了很多方式,寫不出來~
請問各位前輩,我該用哪個函數來寫?

以下是原始腳本:

input: Length(12,"天數");

input: Multiplier(3,"ATR倍數");

var:V1(99999),v2(0);

var:updn(true); //true= up; false = dn

//

if currentBar = 1 then begin

   updn = true;

end;

if currentBar <> 1 then begin

   if updn = true then

   begin

        if close > v1 then begin

   updn = false;

   v1 = 99999;

   plot4(close-atr(length)*multiplier,"V V");

end;

    end

else

    begin

          if close < v2 then begin

  updn = true;

   v2 = 0;

   plot3(close+atr(length)*multiplier,"A A");

end;

    end;

end;

//

if updn = true then begin

  value1 = close + atr(length)*multiplier;

   if v1 > value1 then V1 =value1;

  plot1(V1);

end;

 

if updn = false then begin

   value2 = close - atr(length)*multiplier;

   if v2 < value2 then V2 = value2;

   plot2(v2);

end;

排序方式: 標準 | 最新
XS小編 發文於   2024/04/25

 Hello RayQ,

 

從腳本來看您要計算的跨頻率數值應該是ATR?

如果是的話請注意 atr 函數並不支援跨頻率。

可以參考 跨頻率ATR(平均真實區間) 此篇文章。

 

需注意跨分鐘頻率的話要使用 xfMin_GetValue 而非 xf_GetValue,且 xfMin_GetValue 並不支援期貨商品。

  • 按讚來自於
  • kakala0513
RayQ 發文於   2024/05/08
發表回覆
Close