欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 使用if的交易条件实际是一样的,但是交易结果就不一样。

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有3203人关注过本帖树形打印复制链接

主题:使用if的交易条件实际是一样的,但是交易结果就不一样。

帅哥哟,离线,有人找我吗?
qq代人发帖
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:18691 积分:0 威望:0 精华:0 注册:2013/7/15 9:22:16
使用if的交易条件实际是一样的,但是交易结果就不一样。  发帖心情 Post By:2013/11/20 13:45:06    Post IP:58.246.57.26[显示全部帖子]

请教:使用if的交易条件实际是一样的,但是交易结果就不一样。
平空:SELLSHORT(平空条件,手数,MARKET);
平多:SELL(平多条件,手数,MARKET);
开多:BUY(开多条件,手数,MARKET);
开空:BUYSHORT(开空条件,手数,MARKET);
为什么
if cmi >=300 then begin 
  
  if x=0 then begin //趋势kaicang
  趋势开多:BUY(开多条件 ,手数,MARKET);
  趋势开空:BUYSHORT(开空条件 ,手数,MARKET);
    if holding<>0 then begin 
    x:=1;
    end
  end
  if x=1 then begin //趋势pingcang
  趋势平空:SELLSHORT(平空条件,手数,MARKET);
  趋势平多:SELL(平多条件,手数,MARKET);
    if holding=0 then begin 
    x:=0;
    end
  end
end

if cmi <300 then begin
  if  x=1 then begin 
  平空:SELLSHORT(平空条件,手数,MARKET);
  平多:SELL(平多条件,手数,MARKET);
    if holding=0 then begin 
    x:=0;
    end
  end
  {if  y=0 then begin 
  开多1:BUY(开多平空条件 and holding <=0 and cmi<300,手数,MARKET);
  开空1:BUYSHORT(开空平多条件 and holding >=0 and cmi<300,手数,MARKET); 
    if holding<>0 then begin 
    y:=1;
    end
  end
  if  y=1 then begin
  平空2:SELLSHORT(开多平空条件 and holding <0 or p1>0,手数,MARKET);
  平多2:SELL(开空平多条件 and holding >0 or  p1<0,手数,MARKET);
    if holding<>0 then begin 
    y:=0;
    end
  end  
end



//注意交易系统先开后平的原则
{ if  x=0 then begin
   开多:BUY(开多条件 ,手数,MARKET);
  if holding>0 then begin 
   x:=1;
   Y:=1;
   end
  end
  
  if  y = 0 then begin 
   开空:BUYSHORT(开空条件,手数,MARKET);
   if holding<0 then begin 
   X:=1;
   y:=1;
   end
  end   
 if  x=1 then begin
  趋势平多:SELL(平多条件,手数,MARKET);
   if holding <=0 then begin
   x:=0;
   end
  END
  if  y=1 then begin
  趋势平空:SELLSHORT(平空条件,手数,MARKET);
    if holding >=0 then begin
   y:=0;
   end
  ENd}
为什么下面的if代码和上面的不一样
交易结果不一样

 回到顶部