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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 关于策略编写问题?

   

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


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

主题:关于策略编写问题?

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


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

,limitr ,enterprice1

开仓下单价格是这样写的,

enterprice1的初值是0,所以问题是,用0的价格下单要表达什么意思?



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

客户服务部

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

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

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


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

但是你的条件写的简单,还没有上下穿就触发了,导致了下单价格是0

所以这个下单价格为0你是要表达什么意思?



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

客户服务部

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

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

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


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

 if holding=0 and  cc=0 then buy(1,p,limitr ,enterprice1),ignorecheckprice;

你的下单语句是这样写的,cc的初值是0,没持仓时holding也是0,那么就是第一根k就满足了开仓条件,然后以0的价格下单



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

客户服务部

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

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

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


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

什么是“小级别建仓,大级别平仓”?


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

客户服务部

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

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

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


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


 

//1 上穿20曰线平空开多,下穿20日线平多开空


ma20:=ma(c,20);

ma60:=ma(c,60);

if cross(c,ma20)  then begin

   sellshort(1,0,thisclose);

    buy(holding=0,1,thisclose);

end

 

if cross(ma20,c) then begin

   sell(1,0,thisclose);

   buyshort(holding=0,1,thisclose);

end

//2 上穿20日线开多后,再次上穿60日线,这持有多单,只能在下穿60日线平多(小级别建仓,大级别平仓)

//2 下穿20日线开空后,再次下穿60日线,这持有空单,只能在上穿60日线平空(小级别建仓,大级别平仓)

if enterbars>1 and cross(ma60,c) and count(cross(c,ma60),enterbars+1)>0 then sell(1,0,marketr);

if enterbars>1 and cross(c,ma60) and count(cross(ma60,c),enterbars+1)>0 then sellshort(1,0,marketr);

//3 止盈和止损,两种条件holding<0 and h>=min(enterprice+zsx,kstop1) 和holding>0 and l<=max(enterprice-zsx,dstop1) 

if holding<0 and h>=min(enterprice+zsx,kstop1) then sellshort(1,0,thisclose);

if holding>0 and l<=max(enterprice-zsx,dstop1)  then sell(1,0,thisclose);



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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2017/1/4 14:27:19    Post IP:180.169.30.6[显示全部帖子]

//1 上穿20曰线平空开多,下穿20日线平多开空


ma20:=ma(c,20);

ma60:=ma(c,60);

if cross(c,ma20)  then begin

  

    buy(holding=0,1,thisclose);

end

 

if cross(ma20,c) then begin

  

   buyshort(holding=0,1,thisclose);

end

//2 上穿20日线开多后,再次上穿60日线,这持有多单,只能在下穿60日线平多(小级别建仓,大级别平仓)

//2 下穿20日线开空后,再次下穿60日线,这持有空单,只能在上穿60日线平空(小级别建仓,大级别平仓)

if enterbars>1 and cross(ma60,c) and count(cross(c,ma60),enterbars+1)>0 then sell(1,0,marketr);

if enterbars>1 and cross(c,ma60) and count(cross(ma60,c),enterbars+1)>0 then sellshort(1,0,marketr);

//3 止盈和止损,两种条件holding<0 and h>=min(enterprice+zsx,kstop1) 和holding>0 and l<=max(enterprice-zsx,dstop1) 

if holding<0 and h>=min(enterprice+zsx,kstop1) then sellshort(1,0,thisclose);

if holding>0 and l<=max(enterprice-zsx,dstop1)  then sell(1,0,thisclose);

 

if holding<0 and enterbars>1 and cross(c,ma20) and count(cross(ma60,c),enterbars+1)=0 then sellshort(1,0,marketr);
if holding>0 and enterbars>1 and cross(ma20,c) and count(cross(c,ma60),enterbars+1)=0 then sell(1,0,marketr);


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

客户服务部

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

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

 回到顶部