Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

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

1楼
zengxing 发表于:2016/10/26 19:26:40
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
2楼
jinzhe 发表于:2016/10/27 8:46:14

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

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

共2 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03125 s, 3 queries.