源码内容:
用在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;