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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → [求助]持仓与反手,急~~

   

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


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

主题:[求助]持仓与反手,急~~

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


加好友 发短信
等级:论坛游民 帖子:115 积分:829 威望:0 精华:0 注册:2010/9/9 11:50:11
[求助]持仓与反手,急~~  发帖心情 Post By:2011/10/25 21:41:32    Post IP:119.114.80.88[只看该作者]

if holding>0 and (ek2) then begin
  sell(1,holding,limitr,c),ORDERQUEUE;
  buyshort(1 and time>091000,ss,limitr,c),ORDERQUEUE;
end

if holding<0 and (ed2) then begin
  sellshort(1,holding,limitr,c),ORDERQUEUE;
  buy(1 and time>091000,ss,limitr,c),ORDERQUEUE;
end

 

buy(ed1 and holding=0,ss,limitr,c);
buyshort(ek1 and holding=0,ss,limitr,c);

buy((d4) and holding=0,ss,limitr,c);
buyshort((k4) and holding=0,ss,limitr,c);

 

是这样:  当d4 k4持仓 遇到ed2 ek2不反手


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


加好友 发短信
等级:金字塔养老院 帖子:1323 积分:6764 威望:0 精华:0 注册:2011/6/14 17:27:11
  发帖心情 Post By:2011/10/26 9:24:30    Post IP:58.246.57.26[只看该作者]

不清楚楼主的 D4 K4等条件是什么,所以我自己随意的定义了下,测试结果是有反手的

ek2:=cross (ma(c,5),ma(c,10));
ed2:=cross (ma(c,10),ma(c,5));
ss:=10;
ed1:=c>ref(c,1);
ek1:=c<ref(c,1);
d4:=c>o;
k4:=c<h;

if holding>0 and (ek2) then begin
  sell(1,holding,limitr,c),ORDERQUEUE;
  buyshort(time>091000,ss,limitr,c),ORDERQUEUE;
end

if holding<0 and (ed2) then begin
  sellshort(1,holding,limitr,c),ORDERQUEUE;
  buy(time>091000,ss,limitr,c),ORDERQUEUE;
end

 

 

buy((d4) and holding=0,ss,limitr,c);
buyshort((k4) and holding=0,ss,limitr,c);

[此贴子已经被作者于2011-10-26 9:53:02编辑过]


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

客户服务部

-----------------------------------------------------------

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

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com
 回到顶部
帅哥哟,离线,有人找我吗?
msy0985
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:115 积分:829 威望:0 精华:0 注册:2010/9/9 11:50:11
  发帖心情 Post By:2011/10/26 10:25:37    Post IP:175.147.59.60[只看该作者]

您误解了,我写的是 我需要得到的答案

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


加好友 发短信
等级:金字塔养老院 帖子:1323 积分:6764 威望:0 精华:0 注册:2011/6/14 17:27:11
  发帖心情 Post By:2011/10/26 10:37:39    Post IP:58.246.57.26[只看该作者]


 

反手1:=ed1 and time>091000;

反手2:=ek1 and time>091000;

if holding>0 and (ek2) then begin
  sell(1,holding,limitr,c),ORDERQUEUE;
  buyshort(反手1,ss,limitr,c),ORDERQUEUE;
end

if holding<0 and (ed2) then begin
  sellshort(1,holding,limitr,c),ORDERQUEUE;
  buy(反手2,ss,limitr,c),ORDERQUEUE;
end

 

buy(ed1 and holding=0,ss,limitr,c);
buyshort(ek1 and holding=0,ss,limitr,c);

buy((d4) and holding=0,ss,limitr,c);
buyshort((k4) and holding=0,ss,limitr,c);

 

是这样:  当d4 k4持仓 遇到ed2 ek2不反手

 

是这个意思吗?

[此贴子已经被作者于2011-10-26 10:38:28编辑过]


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

客户服务部

-----------------------------------------------------------

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

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