根据 叶随雨落 的帖子修改成了两个选股公式。一个是当 MACD小于0时,收盘价突破下降趋势线的选股公式;一个是 MACD大于0时,收盘价突破上升趋势线的选股公式;
注意:选出股票后还要进行人工筛选,结合主图、股价位置、K线形态、成交量等,选出自己认可的股票。还要注意,买入前一定要根据自己的资金实力、风险承受能力,设置好仓位、止损位!
时刻牢记,止损、止损、再止损!
{突破趋势线 选股}
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
N1:=BARSLAST(CROSS(DIF,DEA))+1;
N2:=BARSLAST(CROSS(DEA,DIF))+1;
{①DIFF DEA时,收盘价突破上升趋势线}
A1:=BACKSET(ISLASTBAR & N2,REF(REF(HHVBARS(H,N1)+1,N2),N2)+REF(N2,N2)+N2);
B1:=BACKSET(ISLASTBAR & N2,REF(HHVBARS(H,N1),N2)+N2+1);
QS1:=DRAWLINE(CROSS(A1,0.5),H,CROSS(B1,0.5),H,1),COLORRED;
XG1:=MACD 0 AND C O AND C REF(H,1) AND CROSS(C,QS1);
{②DIFF DEA时,收盘价突破下降趋势线}
A3:=BACKSET(ISLASTBAR & N2,REF(REF(HHVBARS(H,N1)+1,N2),N1)+REF(N2,N1)+N1);
B3:=BACKSET(ISLASTBAR & N2,REF(HHVBARS(H,N1)+1,N2)+N2);
QS3:=DRAWLINE(CROSS(A3,0.5),H,CROSS(B3,0.5),H,1),COLORRED;
XG3:MACD 0 AND C O AND C REF(H,1) AND CROSS(C,QS3);