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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 第一次开仓和第二次开仓的条件不同问题?

   

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


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

主题:第一次开仓和第二次开仓的条件不同问题?

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


加好友 发短信
等级:新手上路 帖子:91 积分:130 威望:0 精华:0 注册:2012/4/8 17:32:53
第一次开仓和第二次开仓的条件不同问题?  发帖心情 Post By:2012/5/13 0:58:57 [只看该作者]

老师你好,我是做日内交易的。我想达到这样一个目的:

第一次开多单的条件是A;平仓条件是B;

第一次开空单的条件是B;平仓条件是A;

第二次以及以后所有的开多条件是A and C ;平仓条件还是B;

第二次以及以后所有的开空条件是B and D;平仓条件还是A;

请问这样怎么用语言去实现它,谢谢!

 

 


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


加好友 发短信 czt
等级:蜘蛛侠 帖子:1445 积分:6114 威望:0 精华:3 注册:2012/1/16 10:31:19
  发帖心情 Post By:2012/5/14 8:45:04 [只看该作者]

variable:x:=0,y:=0;
if time>000930 and time<001530 and A and x=0 then
begin
   sellshort(1,0,market);
   buy(1,1,market);
   x:=x+1;
end

if time>000930 and time<001530 and b and y=0 then
begin
   sell(1,0,market);
   buyshort(1,1,market);
   y:=y+1;
end

if time>000930 and time<001530 and A and C and x=1 then
begin
   buy(1,1,market);
end

if time>000930 and time<001530 and A and x=1 then
begin
   sellshort(1,0,market);
end

if time>000930 and time<001530 and B and D and y=1 then
begin
   buyshort(1,1,market);
end

if time>000930 and time<001530 and B and y=1 then
begin
   sell(1,0,market);
end


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


加好友 发短信
等级:新手上路 帖子:91 积分:130 威望:0 精华:0 注册:2012/4/8 17:32:53
  发帖心情 Post By:2012/5/14 14:11:54 [只看该作者]

以下是引用rushtaotao在2012-5-14 8:45:04的发言:

variable:x:=0,y:=0;
if time>000930 and time<001530 and A and x=0 then
begin
   sellshort(1,0,market);
   buy(1,1,market);
   x:=x+1;
end

if time>000930 and time<001530 and b and y=0 then
begin
   sell(1,0,market);
   buyshort(1,1,market);
   y:=y+1;
end

if time>000930 and time<001530 and A and C and x=1 then
begin
   buy(1,1,market);
end

if time>000930 and time<001530 and A and x=1 then
begin
   sellshort(1,0,market);
end

if time>000930 and time<001530 and B and D and y=1 then
begin
   buyshort(1,1,market);
end

if time>000930 and time<001530 and B and y=1 then
begin
   sell(1,0,market);
end

 

 

 

老师你好!你帮我写的这个程序只能管住第二次开仓的情况,不能管住第三次开仓的情况! 我开了第二次后要y=y+1+1吗?


 回到顶部