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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → [求助]请老师帮忙写一下加减仓公式,万分感谢!

   

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


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

主题:[求助]请老师帮忙写一下加减仓公式,万分感谢!

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2016/5/13 9:49:09    Post IP:180.169.30.6[显示全部帖子]

A是整数还是有小数的?


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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2016/5/13 10:06:17    Post IP:180.169.30.6[显示全部帖子]

A是有顺序的变化,比如:1,2,3,4这样的顺序。还是不规则的,比如1,4,2,-1,5,这样的无规则顺序变化?


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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2016/5/13 10:37:53    Post IP:180.173.43.114[显示全部帖子]

if a>0 and ref(a>0,1) and a<10 and a-ref(a,1)>1 and b>ref(b,1) and c>ref(c,1) then buY(1,4,marketr);
if a>0 and ref(a>0,1) and a<10 and a-ref(a,1)>1 and ((b>ref(b,1) and c<ref(c,1)) or (c>ref(c,1) and b<ref(b,1))) then buY(1,2,marketr);
if a>0 and ref(a>0,1) and a<10 and a-ref(a,1)>1 and b<ref(b,1) and c<ref(c,1) then buY(1,1,marketr);

if a<0 and ref(a<0,1) and a>-10 and ref(a,1)-a>1 and b<ref(b,1) and c<ref(c,1) then buyshort(1,4,marketr);
if a<0 and ref(a<0,1) and a>-10 and ref(a,1)-a>1 and ((b>ref(b,1) and c<ref(c,1)) or (c>ref(c,1) and b<ref(b,1))) then buyshort(1,2,marketr);
if a<0 and ref(a<0,1) and a>-10 and ref(a,1)-a>1 and b>ref(b,1) and c>ref(c,1) then buyshort(1,1,marketr);

if a>1 and ref(a,1)-a>1` then sell(1,round(1/ref(a,1)*holding),marketr);
if a<=0 and ref(a,1)>0 then sell(1,0,marketr);

if a<-1 and a-ref(a,1)>1 then sellshort(1,round(1/ref(a,1)*holding),marketr);
if a>=0 and ref(a,1)<0 then sellshort(1,0,marketr);



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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2016/5/13 10:59:03    Post IP:180.169.30.6[显示全部帖子]

if a>0 and ref(a>0,1) and a<10 and a-ref(a,1)>1 and b>ref(b,1) and c>ref(c,1) then buY(1,4,marketr);
if a>0 and ref(a>0,1) and a<10 and a-ref(a,1)>1 and ((b>ref(b,1) and c<ref(c,1)) or (c>ref(c,1) and b<ref(b,1))) then buY(1,2,marketr);
if a>0 and ref(a>0,1) and a<10 and a-ref(a,1)>1 and b<ref(b,1) and c<ref(c,1) then buY(1,1,marketr);

if a<0 and ref(a<0,1) and a>-10 and ref(a,1)-a>1 and b<ref(b,1) and c<ref(c,1) then buyshort(1,4,marketr);
if a<0 and ref(a<0,1) and a>-10 and ref(a,1)-a>1 and ((b>ref(b,1) and c<ref(c,1)) or (c>ref(c,1) and b<ref(b,1))) then buyshort(1,2,marketr);
if a<0 and ref(a<0,1) and a>-10 and ref(a,1)-a>1 and b>ref(b,1) and c>ref(c,1) then buyshort(1,1,marketr);
a1:=ref(a,1);

if a>1 and ref(a,1)-a>1 then sell(1,round(1/a1*holding),marketr);
if a<=0 and ref(a,1)>0 then sell(1,0,marketr);

if a<-1 and a-ref(a,1)>1 then sellshort(1,round(1/a1*holding),marketr);
if a>=0 and ref(a,1)<0 then sellshort(1,0,marketr);



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

客户服务部

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

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

 回到顶部