咨询内容:应该在 (diff>=0.03 or (hhv(h,10)-LLV(l,10))>=0.15) 满足条件后,macd指标出现金叉后,应该马上第二个K线就做交易,但为什么会经常延后2,3根?是为什么?就是说,相交是需要2个K线判别的,第三根应该马上做交易的,但经常延后2,3根开仓,是为什么? multipler:=10; macd:=stkindi('','macd.macd1',0,datatype); diff:=stkindi('','macd.diff',0,datatype); atr:=stkindi('','atr.atr',0,datatype);
if cross(macd,0) and (diff>=0.03 or (hhv(h,10)-LLV(l,10))>=0.15) then begin sellshort(1,0,market); buy(holding=0,1,market); end if cross(0,macd) and (diff>=0.03 or (hhv(h,10)-LLV(l,10))>=0.15) then begin sell(1,0,market); buyshort(holding=0,1,market); end
if openprofit/multipler>1.5*atr then begin sell(1,0,marketr); sellshort(1,0,market); end if openprofit<0 and abs(openprofit)/multipler>1.5*atr then begin sell(1,0,marketr); sellshort(1,0,market); end