以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  图表交易请帮忙改为后台,我改的后台不交易。  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=149771)

--  作者:qq代人发帖
--  发布时间:2017/3/28 14:17:37
--  图表交易请帮忙改为后台,我改的后台不交易。
图表交易请帮忙改为后台。改后台不交易。
//平多空单
 if  holding>0 and enterbars>1 and L<=zs then 
  BEGIN
   MyTPrice :=IF(OPEN<zs,OPEN,zs);
   sell(1,ss,LIMIT,MyTPrice-MINDIFF); 
  END  
 if holding<0 and enterbars>1 and H>=zs THEN 
  BEGIN
   MyTPrice :=IF(OPEN>zs,OPEN,zs);
   sellshort(1,ss,LIMIT,MyTPrice+MINDIFF);
  END 
//开多单
 IF H>=UpperBand and BLIQCON and THOLDING=0 THEN 
 BEGIN
  MyPrice :=IF(OPEN>UpperBand,OPEN,UpperBand);
  buy(1,ss,LIMIT,MyPrice+MINDIFF);
  zs:=Mdg;
  maxhl:=h;
 END
//开空单
 IF L<=LowerBand and SOPCON and THOLDING=0 THEN
  BEGIN
  MyPrice :=IF(OPEN<LowerBand,OPEN,LowerBand);
  buyshort(1,ss,LIMIT,MyPrice-MINDIFF);
  zs:=Mdd;
  maxhl:=l;
 END

if Tholding<0 and l<maxhl then begin //重新定位离场实现浮动止损止盈
 zs:=Mdd;
end
if Tholding>0 and h>maxhl then begin 
 zs:=Mdg;
end

--  作者:jinzhe
--  发布时间:2017/3/28 14:22:06
--  

if  tholding>0 and tenterbars>1 and L<=zs then
  BEGIN
   MyTPrice :=IF(OPEN<zs,OPEN,zs);
   tsell(1,ss,Lmt,MyTPrice-MINDIFF);
  END 
 if tholding<0 and tenterbars>1 and H>=zs THEN
  BEGIN
   MyTPrice :=IF(OPEN>zs,OPEN,zs);
   tsellshort(1,ss,lmt,MyTPrice+MINDIFF);
  END
//开多单
 IF H>=UpperBand and BLIQCON and THOLDING=0 THEN
 BEGIN
  MyPrice :=IF(OPEN>UpperBand,OPEN,UpperBand);
  tbuy(1,ss,lmt,MyPrice+MINDIFF);
  zs:=Mdg;
  maxhl:=h;
 END
//开空单
 IF L<=LowerBand and SOPCON and THOLDING=0 THEN
  BEGIN
  MyPrice :=IF(OPEN<LowerBand,OPEN,LowerBand);
  tbuyshort(1,ss,lmt,MyPrice-MINDIFF);
  zs:=Mdd;
  maxhl:=l;
 END

if Tholding<0 and l<maxhl then begin //重新定位离场实现浮动止损止盈
 zs:=Mdd;
end
if Tholding>0 and h>maxhl then begin
 zs:=Mdg;
end