請問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;
2 評論