以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  求助这个模板写得对么~  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=5512)

--  作者:hazaiisme
--  发布时间:2011/3/13 0:53:17
--  求助这个模板写得对么~

if holding=0 and hazai=1 then begin
 buy(1,1,limitr,close);
 newprice:=close;
 stoplossline:=newprice-stoplossrange;
end

if holding>0 then begin
 if(hh>newprice) then begin
  newprice:=hh;
 end 
 stoplossline:=newprice-stoplossrange;
 if enterbars>=2 and close<stoplossline then begin
  sell(1,holding,limitr,close);
    stoplossline:=0;
    newprice:=0;
  end
end

if holding=0 and hazai=-1 then begin
 buy(1,1,limitr,close);
 newprice:=close;
 stoplossline:=newprice-stoplossrange;
end

if holding<0 then
 if(ll<newprice) then begin begin
  newprice:=ll;
 end
 stoplossline=newprice+stoplossrange;
 if enterbars>=2 and close>stoplossline then begin
  buyshort(1,holding,limitr,close);
  stoplossline:=0;
  newprice:=0;
 end  
end


--  作者:z7c9
--  发布时间:2011/3/13 9:22:27
--  

可以