以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://www.weistock.com/bbs/index.asp)
--  金字塔软件问题提交  (http://www.weistock.com/bbs/list.asp?boardid=2)
----  不能自动交易  (http://www.weistock.com/bbs/dispbbs.asp?boardid=2&id=143594)

--  作者:曹晓东
--  发布时间:2016/11/30 10:24:22
--  不能自动交易
a1:=stickline(barpos=datacount-22,c,o,10,0,COLORMAGENTA); 
a2:=stickline(barpos=datacount-10,c,o,10,0,COLORMAGENTA); 
a3:=c<a1;
a4:=c>a1;

mm:=ref(h,1)=hhv(h,3);
nn:=ref(l,1)=llv(l,3);
if mm then bj:=1;
if nn then bj:=-1;
nn1:=barslast(mm);
nn2:=barslast(nn);
if c<ref(l,nn1+1) and bj=1 then i:=1;
if c>ref(h,nn2+1) and bj=-1 then i:=-1;

uu3:=cross(i=1,0.5);//绿
uu4:=cross(i=-1,0.5);//红

if a3 and uu3 then begin  
 buyshort(holding=0,1,market);//阴包阳,卖出
 end
if a4 and uu4 then begin
 buy(holding=0,1,market);//阳包阴,买入
 end
 

 
 if holding>0 and c>a2 then sellshort(1,0,thisclose);
  
 if holding>0 and c<a2 then sell(1,0,thisclose);
 



不能自动交易能否帮忙指点指点   

--  作者:wenarm
--  发布时间:2016/11/30 12:32:00
--  
输出你的条件,看下开平仓条件是否满足