求大神帮写一模型
开多仓:MACD值>上周期MACD值且MACD值<上周期MACD值+5 市价开仓 平多仓:MACD值<上周期MACD值-5或者MACD值>上周期MACD值+5 市价平仓
开空: MACD值<上周期MACD值且MACD值>上周期MACD值-5 市价开仓 平空仓:MACD值>上周期MACD值+5或者MACD值<上周期MACD值-5 市价平仓
macd:=stkindi('','macd.macd1',0,datatype);
if macd>ref(macd,1) and macd<ref(macd,1)+5 then buy(holding=0,1,marketr);
if (macd<ref(macd,1)-5) or (macd>ref(macd,1)+5) then sell(1,0,marketr);
if macd<ref(macd,1) and macd>ref(macd,1)-5 then buyshort(holding=0,1,marketr);
if (macd>ref(macd,1)+5) or (macd<ref(macd,1)-5) then sellshort(1,0,marketr);
谢谢大神