請問Xscript警示,10MA大於5MA大於20MA大於60MA的寫法

  •   284 
  • 最後發表   tsung  2025 六月 05
tsung 發文於   2025/05/23

請問Xscript警示(策略雷達),要盤中即時選出"  10MA > 5MA > 20MA > 60MA 的寫法  "

以下寫可以嗎?謝謝您(策略雷達觸發如附件圖的圈起來的位置)

input: shortlength(5,"短期均線期數");

input: midlength(10,"中期均線期數");

input: Longlength(20,"長期均線期數");

input: SuperLong(60,"超長期均線期數");

variable: shortaverage(0);

variable: midaverage(0);

variable: Longaverage(0);

variable: SuperLongaverage(0);

 

settotalbar(3);

setbarback(maxlist(shortlength,midlength,Longlength,SuperLong));

 

if Close > close[1] then

begin

 shortaverage=Average(close,shortlength);

 midaverage=Average(close,midlength) ;

 Longaverage = Average(close,Longlength); 

 SuperLongaverage = Average(close,SuperLong); 

 if  close>shortaverage and 

     midaverage>shortaverage and 

shortaverage>Longaverage and 

Longaverage>SuperLongaverage

 then ret=1;

end;

附加文件

排序方式: 標準 | 最新
虎科大許教授 發文於   2025/05/23

if midaverage>shortaverage and //10均>5均

shortaverage>Longaverage and //5均>20均

Longaverage>SuperLongaverage //20均>60均

 then ret=1;

tsung 發文於   2025/06/05

感謝您

發表回覆
Close