策略雷達增加價量篩選

  •   365 
  • 最後發表   tsung  2025 六月 07
tsung 發文於   2025/06/05

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

,想再加入" 價格要在20~100之間,常交量要在1000張以上",要如何寫入程式?謝謝

 

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/06/05

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); 
        condition1=close>shortaverage and 
            midaverage>shortaverage and 
            shortaverage>Longaverage and 
            Longaverage>SuperLongaverage;
        condition2=close>=20 and close<=100;
        condition3=v>=1000;
        if  condition1 and
            condition2 and
            condition3
        then ret=1;
    end;

tsung 發文於   2025/06/06

太感謝了!!

謝謝您

tsung 發文於   2025/06/07

不好意思,量是目前成交量不是單量,感謝您!

請問目前總成交量要大於1000張,要怎麼改?感謝您

 

虎科大許教授 發文於   2025/06/07

condition3=getField("成交量", "D")>=1000;

發表回覆
Close