multipler:=10; macd:=stkindi('','macd.macd1',0,datatype); diff:=stkindi('','macd.diff',0,datatype); atr:=stkindi('','atr.atr',0,datatype); 和 下面代码,效果应该完全一样吧,为什么会不一样呢? (下面代码,在参数表中,设置了p缺省为26 s缺省12 m缺省9 atrm缺省14) multipler:=10; pp:=NUMTOSTR(p,0); ss:=NUMTOSTR(s,0); mm:=NUMTOSTR(m,0); atrmm:=NUMTOSTR(atrm,0); macd:stkindi('','macd.macd1('&pp&','&ss&','&mm&')',0,datatype); diff:=stkindi('','macd.diff('&pp&','&ss&','&mm&')',0,datatype); atr:=stkindi('','atr.atr('&atrmm&')',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 效果不一样呢 |
macd:stkindi('','macd.macd1('&pp&','&ss&','&mm&')',0,datatype);
diff:=stkindi('','macd.diff('&pp&','&ss&','&mm&')',0,datatype);
atr:=stkindi('','atr.atr('&atrmm&')',0,datatype);
去掉等号就能在k线图上看到值了,你把两种方法都去掉等号,看下数值