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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 程序化最后2个问题

   

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


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

主题:程序化最后2个问题

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


加好友 发短信
等级:超级版主 帖子:18691 积分:0 威望:0 精华:0 注册:2013/7/15 9:22:16
程序化最后2个问题  发帖心情 Post By:2014/1/29 10:49:24    Post IP:58.246.57.26[只看该作者]

请教:程序化最后问题:“关注问题1、2”

1、固定止损:3个点
   系统“自动移动止盈”:如果赚了3个点,自动设置止盈0.4,
                         如果赚了5个点,自动设置止盈:把0.4改为2,
                         如果赚了10个点,自动设置止盈:把2改为5,


v_2013_min1:=stkindi('','公式1.var2013',0,1);
v_2013_min5:=stkindi('','公式1.var2013',0,2);
v_2013_min15:=stkindi('','公式1.var2013',0,3);
v_2014_min1:=stkindi('','公式1.var2014',0,1);
v_2014_min5:=stkindi('','公式1.var2014',0,2);
v_2014_min15:=stkindi('','公式1.var2014',0,3);
if v_2013_min1 or v_2013_min5 or v_2013_min15 then tbuy(tbuyholding(0)=0,1,mkt);
if v_2014_min1 or v_2014_min5 or v_2014_min15 then tbuyshort(tsellholding(0)=0,1,mkt);//满足任意一个条 件后开仓{上述经测试没有问题}
if tenterprice-dynainfo(7)>3 and tbuyholding(0)>0 then tsell(1,0,mkt);
if dynainfo(7)-tenterprice>3 and tsellholding(0)>0 then tsellshort(1,0,mkt);//固定止损{问题1、此处有盈 利2-3个点系统会自动平仓}


if hhv(h,tenterbars+1)-tenterprice>3 and hhv(h,tenterbars+1)-dynainfo(7)>=0.4 and tbuyholding(0)>0 then  tsell(1,0,mkt);
if hhv(h,tenterbars+1)-tenterprice>5 and hhv(h,tenterbars+1)-dynainfo(7)>=2 and tbuyholding(0)>0 then  tsell(1,0,mkt);
if hhv(h,tenterbars+1)-tenterprice>10 and hhv(h,tenterbars+1)-dynainfo(7)>=10 and tbuyholding(0)>0 then  tsell(1,0,mkt);

if tenterprice-llv(l,tenterbars+1)>3 and dynainfo(7)-llv(l,tenterbars+1)>=0.4 and tsellholding(0)>0  then tsellshort(1,0,mkt);
if tenterprice-llv(l,tenterbars+1)>5 and dynainfo(7)-llv(l,tenterbars+1)>=2 and tsellholding(0)>0 then  tsellshort(1,0,mkt);
if tenterprice-llv(l,tenterbars+1)>10 and dynainfo(7)-llv(l,tenterbars+1)>=10 and tsellholding(0)>0  then tsellshort(1,0,mkt);//移动止盈{问题2:上述赚钱了,会自动平仓,程序没有按要求去执行}


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


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

v_2013_min1:=stkindi('','公式1.var2013',0,1);
v_2013_min5:=stkindi('','公式1.var2013',0,2);
v_2013_min15:=stkindi('','公式1.var2013',0,3);
v_2014_min1:=stkindi('','公式1.var2014',0,1);
v_2014_min5:=stkindi('','公式1.var2014',0,2);
v_2014_min15:=stkindi('','公式1.var2014',0,3);
if v_2013_min1 or v_2013_min5 or v_2013_min15 then tbuy(tbuyholding(0)=0,1,mkt);
if v_2014_min1 or v_2014_min5 or v_2014_min15 then tbuyshort(tsellholding(0)=0,1,mkt);//满足任意一个条 件后开仓{上述经测试没有问题}
if tenterprice-dynainfo(7)>3 and tbuyholding(0)>0 then tsell(1,0,mkt);
if dynainfo(7)-tenterprice>3 and tsellholding(0)>0 then tsellshort(1,0,mkt);//固定止损{问题1、此处有盈 利2-3个点系统会自动平仓}


if hhv(h,tenterbars+1)-tenterprice>3 and hhv(h,tenterbars+1)-dynainfo(7)>=0.4 and tbuyholding(0)>0 then  tsell(1,0,mkt);
if hhv(h,tenterbars+1)-tenterprice>5 and hhv(h,tenterbars+1)-dynainfo(7)>=2 and tbuyholding(0)>0 then  tsell(1,0,mkt);
if hhv(h,tenterbars+1)-tenterprice>10 and hhv(h,tenterbars+1)-dynainfo(7)>=5 and tbuyholding(0)>0 then  tsell(1,0,mkt);

if tenterprice-llv(l,tenterbars+1)>3 and dynainfo(7)-llv(l,tenterbars+1)>=0.4 and tsellholding(0)>0  then tsellshort(1,0,mkt);
if tenterprice-llv(l,tenterbars+1)>5 and dynainfo(7)-llv(l,tenterbars+1)>=2 and tsellholding(0)>0 then  tsellshort(1,0,mkt);
if tenterprice-llv(l,tenterbars+1)>10 and dynainfo(7)-llv(l,tenterbars+1)>=5 and tsellholding(0)>0  then tsellshort(1,0,mkt);

 

 

之前说的是赢了10点止盈10点,所以我才这样写,后来又说是5点,我也改过了,

现在再改一次



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

客户服务部

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

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

 回到顶部