以下是股指期货1分钟周期均价线+MACD双结合交易模型源码(无源码的请下载附件导入)
源码内容:
用在IF主力合约,K线周期为1分钟。
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);//MACD
F:=REF(AVPRICE,BARSBK); //调用买开那根K的线的均线价格
G:=REF(AVPRICE,BARSSK);
BK1:=MACD>REF(MACD,1) AND REF(MACD,1)>REF(MACD,2);
BK2:=MACD<=-0.5 AND REF(MACD,2)<=LLV(MACD,10);
BK1 AND BK2,BK;
SP1:=L<=BKPRICE-5;//买开后,最低价低于买开价5个点以上止损
SP2:=MACD>=0.5 AND REF(MACD,1)>=HHV(MACD,10) AND MACD<=REF(MACD,1);
SP1 OR SP2,SP;
SK1:=MACD<REF(MACD,1) AND REF(MACD,1)<REF(MACD,2);
SK2:=MACD>=0.5 AND REF(MACD,2)>=HHV(MACD,10);
SK1 AND SK2,SK;
BP1:=C>=G+5;
BP2:=MACD<=-0.5 AND REF(MACD,1)<=LLV(MACD,10) AND MACD>=REF(MACD,1);
BP1 OR BP2,BP;
AUTOFILTER;
|