Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共11 条记录, 每页显示 10 条, 页签: [1] [2]
[浏览完整版]

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

1楼
系统使用者 发表于:2012/10/18 13:31:09
指标组合策略:
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;
2楼
sunjunwin 发表于:2012/10/18 14:20:15

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

3楼
jinzhe 发表于:2012/10/18 14:25:51

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;请解释该函数的含义

 

 

4楼
系统使用者 发表于:2012/10/18 15:16:38

SetExitOnClose;请解释该函数的含义

 

收盘平仓

5楼
系统使用者 发表于:2012/10/18 15:20:07

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楼
系统使用者 发表于:2012/10/18 15:21:54

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;

也通不过

7楼
jinzhe 发表于:2012/10/18 15:22:32

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

 

这个是修改过的

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;

8楼
系统使用者 发表于:2012/10/18 15:23:55
而且结果也不对
9楼
系统使用者 发表于:2012/10/18 15:24:06

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);

10楼
jinzhe 发表于:2012/10/18 15:24:20

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

if time>151300 and time<=151500 then begin

sell(1,0,market);

sellshort(1,0,market);

end

共11 条记录, 每页显示 10 条, 页签: [1] [2]


Powered By Dvbbs Version 8.3.0
Processed in 0.01563 s, 3 queries.