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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 问一个问题。

   

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


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

主题:问一个问题。

帅哥哟,离线,有人找我吗?
系统使用者
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
问一个问题。  发帖心情 Post By:2012/10/19 12:00:04    Post IP:118.113.56.153[显示全部帖子]

if holding=0 then begin
 if  x+y>0 then
  buy(1,30%,limitr,open-0.2);
end
if holding=0 then begin
 if x+y<0 then
  buyshort(1,30%,limitr,open-0.2); 
end

if holding>0 then begin
 if x+y<0 then begin
  sell(1,holding,limitr,open-0.2);
  buyshort(1,30%,limitr,open-0.2);
 end
end
if holding<0 then begin
 if x+y>0 then begin
  sellshort(1,holding,limitr,open-0.2);
  buy(1,30%,limitr,open-0.2);
 end
end

 

这样设计是否可以在信号出现的时候开盘价能成交?


 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  2楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
  发帖心情 Post By:2012/10/19 12:22:39    Post IP:118.113.56.153[显示全部帖子]

或者直接使用滑点

variable:DHcDs=1;{多、空单滑点数}

if holding=0 then begin
 if  x+y>0 then
  buy(1,30%,limitr,open-DHcDs);
end
if holding=0 then begin
 if x+y<0 then
  buyshort(1,30%,limitr,open-DHcDs); 
end

if holding>0 then begin
 if x+y<0 then begin
  sell(1,holding,limitr,open-DHcDs);
  buyshort(1,30%,limitr,open-DHcDs);
 end
end
if holding<0 then begin
 if x+y>0 then begin
  sellshort(1,holding,limitr,open-DHcDs);
  buy(1,30%,limitr,open-DHcDs);
 end
end

 

这样写可以否?


 回到顶部