打印本文打印本文 关闭窗口关闭窗口

为什么不停的,每根K线都开平仓?这源码有问题?很简单的

作者:金字塔 来源:cxh99.com 发布时间:2017年01月29日
  • 咨询内容: p:=26;s:=12;m:=9;atrm:=20;
    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&')',21,75);diff:=stkindi('','macd.diff('&pp&','&ss&','&mm&')',21,75);atr:=stkindi('','atr.atr('&atrmm&')',21,75);

    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

     

  • 金字塔客服:

    cross(macd,0) and  diff>=0.03 or (hhv(h,10)-LLV(l,10))>=0.15

    这句里面的or是先判断还是and先判断?

打印本文打印本文 关闭窗口关闭窗口