找出連續 5 日, 10 日籌碼集中度均大於 0 的股票

  •   82 
  • 最後發表   阿水哥  2025 八月 20
阿水哥 發文於   2025/08/19

我在選股中心寫了一段程式如下:

目的是找出連續 5 日, 10 日籌碼集中度均大於 0 的股票, 執行後發現, 會漏掉一些股票, 比如 2421 建準 (過去 5 日的 10 日籌碼集中度均大於 0), 請幫我看看問題在哪?

謝謝

 

input:day(10,"天數");

setbarfreq("D");

settotalbar(day+10);

 

value1=GetField("主力買賣超張數","D");

value4=GetField("成交量","D");

 

Value3 = bollingerband(Close, 20, 2);

 

 

if volume<>0 then 

value2=summation(value1,day)/summation(value4,day)*100;

value5=summation(value1[1],day)/summation(value4[1],day)*100;

value6=summation(value1[2],day)/summation(value4[2],day)*100;

value7=summation(value1[3],day)/summation(value4[3],day)*100;

value8=summation(value1[4],day)/summation(value4[4],day)*100;

 

if value2>0 and value5>0 and value6>0 and value7>0 and value8>0 and close>value3 then 

ret=1;

 

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

 建準沒被選出來,因為close並沒有大於value3(布林通道上限)。另外,你的程式可以寫得更有效率,如下:

setbarfreq("D");
settotalbar(day+10);
input:day(10,"天數");
value1=GetField("主力買賣超張數","D");
value4=GetField("成交量","D");
Value3 = bollingerband(Close, 20, 2);
if volume<>0 then value2=summation(value1,day)/summation(value4,day)*100;
if trueAll(value2>0,5) and close>value3 then ret=1;

 

阿水哥 發文於   2025/08/20

感謝你幫忙找到問題

發表回覆
Close