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


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

   

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


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

主题:求助

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


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

持续一分钟,这个不好整


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

客户服务部

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

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

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


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

input :a1(5),b1(10),.................n1(250);
VARIABLE:jige=0,yingkui=0;

ma1:ma(c,a1);
ma2:ma(c,b1);
.
.
.
.
.
.
man:ma(c,n1);

if c> ma1 and c>ma2 and .................and c>man and holding=0 then begin
buy(holding=0,1,market);
jiage:=c;
yingkui:=openprofit;
end//开多
//if c-jiage>yingkui then yingkui:=c-jiage;
//if (yingkui-(c-jiage))/yingkui>30%
if c<ma1 or c<ma2 or ...............or c<man then begin
sell(holding>0,1,market);
end //平多

if c< ma1 and c<ma2 and .................and c<man and holding=0 then begin
buyshort(holding=0,1,market);
jiage:=c;
yingkui:=openprofit;
end//开空

if c>ma1 or c>ma2 or ...............or c>man then begin
sellshort(holding<0,1,market);
end
//平空
if yingkui>0 and openprofit>yingkui then yingkui:=openprofit;//最大盈利

if yingkui <0 and openprofit<yingkui then yingkui:=openprofit;//最大亏损


if holding>0 and  yingkui>0 and (yingkui-openprofit)/yingkui>=30% then  sell(1,0,market);//最大盈利回撤30%后止盈,多头

if holding<0 and  yingkui>0 and (yingkui-openprofit)/yingkui>=30% then  sellshort(1,0,market);//最大盈利回撤30%后止盈,空头

if holding>0 and yingkui<0 and (openprofit-yingkui)/openprofit>=30% then sell(1.0,market);//最大亏损回撤30%后止损,多头

if holding<0 and yingkui<0 and (openprofit-yingkui)/openprofit>=30% then sell(1.0,market);//最大亏损回撤30%后止损,空头

 

 

其中的定义均线省略写了,可以按照上面的参数定义自行添加



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

客户服务部

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

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

 回到顶部