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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 这样编写有问题吗?请改正

   

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


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

主题:这样编写有问题吗?请改正

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


加好友 发短信
等级:论坛游侠 帖子:232 积分:644 威望:0 精华:0 注册:2011/1/26 11:39:34
这样编写有问题吗?请改正  发帖心情 Post By:2013/1/19 11:12:35    Post IP:60.178.230.43[只看该作者]


买1开多条件:********;
买1止损条件:********;
买1止盈条件:********;
买1移止条件:********;
if 买1开多条件 and holding<=0 then begin
sellshort(1,0,thisclose);
buy(1,1,thisclose);
end

if 买1止损条件 and holding>0 then begin
sell(1,0,thisclose);
end

if 买1止盈条件 and holding>0 then BEGIN
sell(1,0,thisclose);
end

if 买1移止条件 and holding>0 then BEGIN
sell(1,0,thisclose);
end


买2开多条件:********;
买2止损条件:********;
买2止盈条件:********;
买2移止条件:********;
if 买2开多条件 and holding<=0 then begin
sellshort(1,0,thisclose);
buy(1,1,thisclose);
end

if 买2止损条件 and holding>0 then begin
sell(1,0,thisclose);
end

if 买2止盈条件 and holding>0 then BEGIN
sell(1,0,thisclose);
end

if 买2移止条件 and holding>0 then BEGIN
sell(1,0,thisclose);
end

 

卖1开空条件:********;
卖1止损条件:********;
卖1止盈条件:********;
卖1移止条件:********;
if 卖1开空条件 and holding>=0 then begin
sell(1,0,thisclose);
buyshort(1,1,thisclose);
end

if 卖1止损条件 and holding<0 then begin
sellshort(1,0,thisclose);
end

if 卖1止盈条件 and holding<0 then BEGIN
sellshort(1,0,thisclose);
end

if 卖1移止条件 and holding<0 then BEGIN
sellshort(1,0,thisclose);
end

 

卖2开空条件:********;
卖2止损条件:********;
卖2止盈条件:********;
卖2移止条件:********;
if 卖2开空条件 and holding>=0 then begin
sell(1,0,thisclose);
buyshort(1,1,thisclose);
end

if 卖2止损条件 and holding<0 then begin
sellshort(1,0,thisclose);
end

if 卖2止盈条件 and holding<0 then BEGIN
sellshort(1,0,thisclose);
end

if 卖2移止条件 and holding<0 then BEGIN
sellshort(1,0,thisclose);
end


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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2013/1/21 9:11:11    Post IP:58.246.57.26[只看该作者]

把持仓判断条件写在下单语句中比如

sellshort(holding<0,)

buy(holding=0,)



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

客户服务部

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

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

 回到顶部
帅哥哟,离线,有人找我吗?
300qh
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:232 积分:644 威望:0 精华:0 注册:2011/1/26 11:39:34
  发帖心情 Post By:2013/1/21 20:46:48    Post IP:125.115.76.218[只看该作者]

以上这样,如果有很多组买卖条件,只要不断增加就可以了是吗?

持仓判断写在开平仓函数里,与直接写在外面,有什么区别?请指点一下


 回到顶部
帅哥哟,离线,有人找我吗?
jinzhe
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2013/1/22 8:55:28    Post IP:58.246.57.26[只看该作者]

上面的语法都没问题,平仓反手把持仓判断写进下单语句而不是外面是怕下单时平仓判断有误


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

客户服务部

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

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

 回到顶部
帅哥哟,离线,有人找我吗?
300qh
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:232 积分:644 威望:0 精华:0 注册:2011/1/26 11:39:34
  发帖心情 Post By:2013/1/22 18:38:28    Post IP:60.178.231.13[只看该作者]

谢谢大师傅

 回到顶部