M12:MA(CLOSE,12);
M240:MA(CLOSE,240); //60日均线
DIFF:= EMA(CLOSE,12) – EMA(CLOSE,26); //MACD快线
DEA:=EMA(DIFF,9); //MACD慢线
SS:DIFF>0 AND DEA>0; //MACD快慢线在0轴以上
SX:DIFF<0 AND DEA<0; //MACD快慢线在0轴以下
JC:=CROSS(DIFF,DEA); //形成金叉
SC:=CROSSDOWN(DIFF,DEA); //形成死叉
做多:C>M240 AND CROSS(12,240) AND SS AND JC;//收盘价大于240日线并且MACD快慢线在0轴以上形成金叉提示做多
做空:C<M240 AND CROSSDOWN(12,240) AND SX AND SC;//收盘价小于240日线并且MACD快慢线在0轴以下形成死叉提示做空
做单思路:
1、收盘价大于240均线并且12日线上穿240均线,MACD0轴之上金叉确认开仓做多,前一个MACD死叉的最低价的1.5倍止损,2倍止盈
2、收盘价小于240均线并且12日线下穿240均线,MACD0轴之下死叉确认开仓做空,前一个MACD金叉的最高价的1.5倍止损,2倍止盈
M12:MA(CLOSE,12);
M240:MA(CLOSE,240); //60日均线
DIFF:= EMA(CLOSE,12) – EMA(CLOSE,26); //MACD快线
DEA:=EMA(DIFF,9); //MACD慢线
SS:DIFF>0 AND DEA>0; //MACD快慢线在0轴以上
SX:DIFF<0 AND DEA<0; //MACD快慢线在0轴以下
JC:=CROSS(DIFF,DEA); //形成金叉
SC:=CROSSDOWN(DIFF,DEA); //形成死叉
做多:C>M240 AND CROSS(12,240) AND SS AND JC;//收盘价大于240日线并且MACD快慢线在0轴以上形成金叉提示做多
做空:C<M240 AND CROSSDOWN(12,240) AND SX AND SC;//收盘价小于240日线并且MACD快慢线在0轴以下形成死叉提示做空
//做多策略
做多,BPK;
C<VALUEWHEN(SC,L)*1.5,SP;
C>VALUEWHEN(SC,L)*2,SP;
//做空策略
做空,SPK;
C>VALUEWHEN(JC,H)*1.5,BP;
C<VALUEWHEN(JC,H)*1/2,BP;
//设置
AUTOFILTER;