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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → [推荐]请版主把它改为金字塔模式

   

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


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

主题:[推荐]请版主把它改为金字塔模式

帅哥哟,离线,有人找我吗?
系统使用者
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
[推荐]请版主把它改为金字塔模式  发帖心情 Post By:2012/10/18 13:31:09    Post IP:118.113.231.212[只看该作者]

指标组合策略:
Variable: aa(0),bb(0),cc(0),dd(0),ee(0),ff(0),gg(0),hh(0);
IF MA(C,2)<MA(C,5)then aa:=1;
if MA(C,2)>MA(C,5)then aa:=-1;
if C>MA(C,40) then bb:=1;
if C<MA(C,40) then bb:=-1;
if HHVBars(C,50)>LLVBars(C,50) then cc:=1;
if HHVBars(C,50)<LLVBars(C,50) then cc:=-1;
if ((high-low)<MA((high-low),10)) and C>C[1] or ((high-low)>MA((high-low),10)) and C<C[1] then dd:=1;
if ((high-low)<MA((high-low),10)) and C<C[1] or ((high-low)>MA((high-low),10)) and C>C[1] then dd:=-1;
if C>(MA(H,15)+MA(L,15))/2 then ee:=1;
if C<(MA(H,15)+MA(L,15))/2 then ee:=-1;
if C<O and C[1]<O[1] then ff=1; else ff:=0;
if C>O and C[1]>O[1] then ff:=-1;
if L>L[1] and L[1]<LLV(L,3)[2] and C>C[1]  and C[1]<C[2]then gg=1; else gg:=0;
if H<H[1] and H[1]>HHV(H,3)[2] and C<C[1] and C[1]>C[2]then gg:=-1;
if HHV(L,3)-LLV(L,3)<=0.2*(HHV(H,3)-LLV(L,3)) then hh=1; else hh:=0;
if HHV(H,3)-LLV(H,3)<=0.2* (HHV(H,3)-LLV(L,3))then hh:=-1;
if aa+bb+cc+dd+ee+ff+gg+hh>0 then Buy('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
if aa+bb+cc+dd+ee+ff+gg+hh<0 then SellShort('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
SetExitOnClose;

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


加好友 发短信
等级:论坛游民 帖子:110 积分:554 威望:0 精华:0 注册:2012/10/18 11:04:01
  发帖心情 Post By:2012/10/18 14:20:15    Post IP:222.174.201.11[只看该作者]

大体都能用吧  估计只有几个变量和数组没定义 定义一下不就成了


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


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

Variable: aa(0),bb(0),cc(0),dd(0),ee(0),ff(0),gg(0),hh(0);
IF MA(C,2)<MA(C,5)then aa:=1;
if MA(C,2)>MA(C,5)then aa:=-1;
if C>MA(C,40) then bb:=1;
if C<MA(C,40) then bb:=-1;
if HHVBars(C,50)>LLVBars(C,50) then cc:=1;
if HHVBars(C,50)<LLVBars(C,50) then cc:=-1;
if ((high-low)<MA((high-low),10)) and C>C[1] or ((high-low)>MA((high-low),10)) and C<C[1] then dd:=1;
if ((high-low)<MA((high-low),10)) and C<C[1] or ((high-low)>MA((high-low),10)) and C>C[1] then dd:=-1;
if C>(MA(H,15)+MA(L,15))/2 then ee:=1;
if C<(MA(H,15)+MA(L,15))/2 then ee:=-1;
if C<O and C[1]<O[1] then ff=1; else ff:=0;
if C>O and C[1]>O[1] then ff:=-1;
if L>L[1] and L[1]<LLV(L,3)[2] and C>C[1]  and C[1]<C[2]then gg=1; else gg:=0;
if H<H[1] and H[1]>HHV(H,3)[2] and C<C[1] and C[1]>C[2]then gg:=-1;
if HHV(L,3)-LLV(L,3)<=0.2*(HHV(H,3)-LLV(L,3)) then hh=1; else hh:=0;
if HHV(H,3)-LLV(H,3)<=0.2* (HHV(H,3)-LLV(L,3))then hh:=-1;
前面可以如此修改

 

最后3句:

if aa+bb+cc+dd+ee+ff+gg+hh>0 then Buy('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');请解释BUY里面各个参数的含义

 

if aa+bb+cc+dd+ee+ff+gg+hh<0 then SellShort('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');请解释SELLSRHOT里面各个参数的含义

 

SetExitOnClose;请解释该函数的含义

 

 



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

客户服务部

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

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

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


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
  发帖心情 Post By:2012/10/18 15:16:38    Post IP:118.113.231.212[只看该作者]

SetExitOnClose;请解释该函数的含义

 

收盘平仓


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


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
  发帖心情 Post By:2012/10/18 15:20:07    Post IP:118.113.231.212[只看该作者]

Variable: aa(0),bb(0),cc(0),dd(0),ee(0),ff(0),gg(0),hh(0);
IF MA(C,2)<MA(C,5)then aa:=1;
if MA(C,2)>MA(C,5)then aa:=-1;
if C>MA(C,40) then bb:=1;
if C<MA(C,40) then bb:=-1;
if HHVBars(C,50)>LLVBars(C,50) then cc:=1;
if HHVBars(C,50)<LLVBars(C,50) then cc:=-1;
if ((high-low)<MA((high-low),10)) and C>C[1] or ((high-low)>MA((high-low),10)) and C<C[1] then dd:=1;
if ((high-low)<MA((high-low),10)) and C<C[1] or ((high-low)>MA((high-low),10)) and C>C[1] then dd:=-1;
if C>(MA(H,15)+MA(L,15))/2 then ee:=1;
if C<(MA(H,15)+MA(L,15))/2 then ee:=-1;
if C<O and C[1]<O[1] then ff=1; else ff:=0;
if C>O and C[1]>O[1] then ff:=-1;
if L>L[1] and L[1]<LLV(L,3)[2] and C>C[1]  and C[1]<C[2]then gg=1; else gg:=0;
if H<H[1] and H[1]>HHV(H,3)[2] and C<C[1] and C[1]>C[2]then gg:=-1;
if HHV(L,3)-LLV(L,3)<=0.2*(HHV(H,3)-LLV(L,3)) then hh=1; else hh:=0;
if HHV(H,3)-LLV(H,3)<=0.2* (HHV(H,3)-LLV(L,3))then hh:=-1;

if aa+bb+cc+dd+ee+ff+gg+hh>0 then  buy(1,25%,limitr,close);
if aa+bb+cc+dd+ee+ff+gg+hh<0 then  buyshort(1,25%,limitr,close);

 

通不过


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


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
  发帖心情 Post By:2012/10/18 15:21:54    Post IP:118.113.231.212[只看该作者]

if L>L[1] and L[1]<LLV(L,3)[2] and C>C[1]  and C[1]<C[2]then gg=1; else gg:=0;

也通不过


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


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

我晕,怎么复制的是原来没修改过的代码

 

这个是修改过的

Variable: aa=0,bb=0,cc=0,dd=0,ee=0,ff=0,gg=0,hh=0;
IF MA(C,2)<MA(C,5)then aa:=1;
if MA(C,2)>MA(C,5)then aa:=-1;
if C>MA(C,40) then bb:=1;
if C<MA(C,40) then bb:=-1;
if HHVBars(C,50)>LLVBars(C,50) then cc:=1;
if HHVBars(C,50)<LLVBars(C,50) then cc:=-1;
if ((high-low)<MA((high-low),10)) and C>C[1] or ((high-low)>MA((high-low),10)) and C<C[1] then dd:=1;
if ((high-low)<MA((high-low),10)) and C<C[1] or ((high-low)>MA((high-low),10)) and C>C[1] then dd:=-1;
if C>(MA(H,15)+MA(L,15))/2 then ee:=1;
if C<(MA(H,15)+MA(L,15))/2 then ee:=-1;
if C<O and C[1]<O[1] then ff=1; else ff:=0;
if C>O and C[1]>O[1] then ff:=-1;
if L>L[1] and L[1]<ref(LLV(L,3),2) and C>C[1]  and C[1]<C[2]then gg:=1; else gg:=0;
if H<H[1] and H[1]>ref(HHV(H,3),2) and C<C[1] and C[1]>C[2]then gg:=-1;
if HHV(L,3)-LLV(L,3)<=0.2*(HHV(H,3)-LLV(L,3)) then hh=1; else hh:=0;
if HHV(H,3)-LLV(H,3)<=0.2* (HHV(H,3)-LLV(L,3))then hh:=-1;



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

客户服务部

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

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

 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  8楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
  发帖心情 Post By:2012/10/18 15:23:55    Post IP:118.113.231.212[只看该作者]

而且结果也不对

 回到顶部
帅哥哟,离线,有人找我吗?
系统使用者
  9楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
  发帖心情 Post By:2012/10/18 15:24:06    Post IP:118.113.231.212[只看该作者]

Variable: aa:=0,bb:=0,cc:=0,dd:=0,ee:=0,ff:=0,gg:=0,hh:=0;
IF MA(C,2)<MA(C,5)then aa:=1;
if MA(C,2)>MA(C,5)then aa:=-1;
if C>MA(C,40) then bb:=1;
if C<MA(C,40) then bb:=-1;
if HHVBars(C,50)>LLVBars(C,50) then cc:=1;
if HHVBars(C,50)<LLVBars(C,50) then cc:=-1;
if ((high-low)<MA((high-low),10)) and C>C[1] or ((high-low)>MA((high-low),10)) and C<C[1] then dd:=1;
if ((high-low)<MA((high-low),10)) and C<C[1] or ((high-low)>MA((high-low),10)) and C>C[1] then dd:=-1;
if C>(MA(H,15)+MA(L,15))/2 then ee:=1;
if C<(MA(H,15)+MA(L,15))/2 then ee:=-1;
if C<O and C[1]<O[1] then ff=1; else ff:=0;
if C>O and C[1]>O[1] then ff:=-1;
if L>L[1] and L[1]<LLV(L,3) and C>C[1]  and C[1]<C[2]then gg=1; else gg:=0;
if H<H[1] and H[1]>HHV(H,3) and C<C[1] and C[1]>C[2]then gg:=-1;
if HHV(L,3)-LLV(L,3)<=0.2*(HHV(H,3)-LLV(L,3)) then hh=1; else hh:=0;
if HHV(H,3)-LLV(H,3)<=0.2* (HHV(H,3)-LLV(L,3))then hh:=-1;

if aa+bb+cc+dd+ee+ff+gg+hh>0 then  buy(1,25%,limitr,close);
if aa+bb+cc+dd+ee+ff+gg+hh<0 then  buyshort(1,25%,limitr,close);


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


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

收盘前平仓,以股指1分钟周期为例:

if time>151300 and time<=151500 then begin

sell(1,0,market);

sellshort(1,0,market);

end



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

客户服务部

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

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

 回到顶部
总数 11 1 2 下一页