以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  请老师看看这个模型的问题在哪里  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=71417)

--  作者:FJ6008
--  发布时间:2014/10/27 15:40:24
--  请老师看看这个模型的问题在哪里

 

ss:=1; //手数
//variable:myenterbars=0;
maa:ema(c,2);
YC:ema(c,6),PRECIS2,COLOR00FFFF,LINETHICK1;

BU:=CROSS(maa,YC);
SEL:=CROSS(YC,maa);
DRAWTEXT(CROSS(BU,SEL),(L+(O-C)/8),\'买\'),COLORFF00FF;
DRAWTEXT(CROSS(SEL,BU),(H+(O-C)/8),\'卖\'),COLORFFFF00;
tt1:=CROSS(maa,yc);
tt2:=CROSS(yc,maa);
//当开始没有持仓
if  holding=0 then begin
     if tt1 then  begin
         buy(1,ss,l)
         goto continueline;
     end
    
     if tt2 then begin
        buyshort(1,ss,h);
        goto continueline;
     end
end

if tt1 and  holding<0 and  enterbars>=0 then begin
     sellshort(1,ss,market);//平空
     buy(1,ss,market);//开多
     goto continueline;
end

if tt2 and  holding>0 and  enterbars>=0 then begin
     sell(1,ss,market);//平多
     buyshort(1,ss,market);//开空
     goto continueline;
end

continueline@ 资产:tasset,linethick0;
持仓: holding,NODRAW

 

请老师帮忙给修改一下;就是一个:金叉做多,死叉做空模型;


  


--  作者:jinzhe
--  发布时间:2014/10/27 15:41:59
--  

 buy(1,ss,l)
限价下单

要写成

 buy(1,ss,limitr,l);

而且还少了一个分号


--  作者:FJ6008
--  发布时间:2014/10/27 16:00:21
--  

手数ss:=2;
//variable:myenterbars=0;
maa:ema(c,2);
YC:ema(c,6),PRECIS2,COLOR00FFFF,LINETHICK1;

BU:=CROSS(maa,YC);
SEL:=CROSS(YC,maa);
DRAWTEXT(CROSS(BU,SEL),(L+(O-C)/8),\'买\'),COLORFF00FF;
DRAWTEXT(CROSS(SEL,BU),(H+(O-C)/8),\'卖\'),COLORFFFF00;
tt1:=CROSS(maa,yc);
tt2:=CROSS(yc,maa);
//当开始没有持仓
if  holding=0 then begin
     if tt1 then  begin
        buy(1,ss,limitr,l);
        goto continueline;
     end     
     if tt2 then begin
        buyshort(1,ss,limitr,l);
        goto continueline;
     end
end

if tt1 and  holding<0 and  enterbars>=0 then begin
     sellshort(1,ss,market);//平空
     buy(1,ss,market);//开多
     goto continueline;
end

if tt2 and  holding>0 and  enterbars>=0 then begin
     sell(1,ss,market);//平多
     buyshort(1,ss,market);//开空
     goto continueline;
end

continueline@ 资产:tasset,linethick0;
持仓: holding,NODRAW;

 

这样就0k了,谢谢!

我上次那个模型有结论了吗?


--  作者:jinzhe
--  发布时间:2014/10/27 16:04:59
--  
什么?
--  作者:FJ6008
--  发布时间:2014/10/27 16:42:43
--  
发帖心情 Post By:2014/9/29 15:09:12 [只看该作者]

我再尝试中,你最好仔细再想想细节,哪些地方还需要修改



金字塔—专业程序化交易量化投资平台

客户服务部

-----------------------------------------------------------

欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 

 

9月29日的那个模型要求


--  作者:jinzhe
--  发布时间:2014/10/27 16:44:47
--  
发原贴