寶塔線使用問題

  •   342 
  • 最後發表   Blue鵲  2024 九月 20
Blue鵲 發文於   2024/09/13

我使用版友寫的範例,想做出跟內建指標完全一模一樣的多空轉換時機。

 

綠轉紅

input: Length(12);

variable: _Index(0), HV(0), LV(0);

settotalbar(200);

HV = Close[1];

LV = Close[1];

for _Index = 2 to Length + 1

begin

  if HV <= Close[_Index] then HV = Close[_Index];

  if LV >= Close[_Index] then LV = Close[_Index];

end;

if Close[1] < LV[1] and Close > HV then ret=1;

 

紅轉綠

input: Length(12);

variable: _Index(0), HV(0), LV(0);

settotalbar(200);

HV = Close[1];

LV = Close[1];

for _Index = 2 to Length + 1

 

begin

  if HV <= Close[_Index] then HV = Close[_Index];

  if LV >= Close[_Index] then LV = Close[_Index];

end;

if Close[1] > HV[1] and Close < LV then ret=1;

 

我使用1分K來做警示訊號,商品是台指期,2個各為1個訊號,但實測沒有依照XQ內建的紅綠轉換時間,而且誤差很多,請問要如何設定才能跟XQ內建的指標多空轉換時間完全一模一樣?

附加文件

排序方式: 標準 | 最新
虎科大許教授 發文於   2024/09/13

//綠轉紅警示腳本

if barfreq<>"Min" or barinterval<>1 then raiseRunTimeError("限用1分鐘");

input:TWR(3,"期數");

variable:HH(0),LL(0);

HH = highest(h[1],TWR);

LL = lowest(L[1],TWR);

condition1=c>HH;

condition2=c<LL;

if condition1 and condition2[1] then ret=1;

 

//紅轉綠警示腳本

if barfreq<>"Min" or barinterval<>1 then raiseRunTimeError("限用1分鐘");

input:TWR(3,"期數");

variable:HH(0),LL(0);

HH = highest(h[1],TWR);

LL = lowest(L[1],TWR);

condition1=c>HH;

condition2=c<LL;

if condition2 and condition1[1] then ret=1;

XS小編 發文於   2024/09/20

Hello Blue鵲,

 

小編補充,目前XS內建指標中有寶塔線,您也可以參考裡面的腳本作修改。

發表回覆
Close