請問小幫手
若想要進行選股,條件是在上揚的週k5日均線之上,找出日K多頭排列(5日均>10日均>20日均且都上揚)出紅棒時的股票。
初步撰寫的內容如下,但跑出結果不如預期,想請小幫手看看哪裡有問題,謝謝:
VARs:close_dma_5(0), close_dma_10(0), close_dma_20(0), close_dma_60(0), close_dma_240(0); //日均
VARs:close_wma_5(0); //週均
close_wma_5 = average(GETField("close", "W"),5);
close_dma_5 = average(close, 5);
close_dma_10 = average(close, 10);
close_dma_20 = average(close, 20);
close_dma_60 = average(close, 60);
close_dma_240 = average(close, 240);
if close_wma_5 > close_wma_5[1] //週5上揚(當週收盤價>前一週收盤價)
then begin
if close > close_dma_60 and close_dma_60 > close_dma_60[1] //收盤價在日/60之上且日/60上揚
then begin
if close > open and close > close_dma_5 //收盤價>日/5 且 收紅k
then begin
if close_dma_5 > close_dma_5[1] and close_dma_10 > close_dma_10[1] and close_dma_20 > close_dma_20[1] // 日/5、10、20上揚
then begin
if close_dma_5 > close_dma_10 and close_dma_10 > close_dma_20 //日/5、10、20多頭排列
then ret=1;
end;
end;
end;
end;
3 評論