wxxx 发表于 2012-11-9 21:45:36

//Table 41.5  在比较低的收盘价买入,在比较高的收盘价卖出
IF (MA((high-low),10)<MA((high-low),25))  and (C<C and C<MA(C,5)) Then Buy('', DEFAULT, ( O[-1] +(0.2*(high-low))), -1, OT_Stop, OB_NextBar,  '');
if (C>MA(C,10) and C>MA(C,25)) Then Sell('', DEFAULT, ( O[-1] -(0.2*(high-low))), -1, OT_Stop, OB_NextBar, '');
if BarsSinceEntry>0 then Sell('', DEFAULT, EntryPrice-MA((high-low),25), -1, OT_Stop, OB_NextBar, '');
IF  (MA((high-low),10)<MA((high-low),25))   and (C>C and C>MA(C,5)) Then SellShort('', DEFAULT, ( O[-1] -(0.2*(high-low))), -1, OT_Stop, OB_NextBar,  '');
IF (C<MA(C,10) and C<MA(C,25)) Then BuyToCover('', DEFAULT, ( O[-1] +(0.2*(high-low))), -1, OT_Stop, OB_NextBar, '');
if BarsSinceEntry>0 then BuyToCover('', DEFAULT, EntryPrice+MA((high-low),25), -1, OT_Stop, OB_NextBar, '');
{
多头:
如果收盘价小于前一天的收盘价,且小于5天收盘价的均值,且10天的
平均振幅小于25天的平均振幅,那么第二天下stop单买入,买入价格是
开盘价加上前一天的振幅的1/5。
条件止损:如果收盘价大于10天,25天收盘价的均值,
下stop单,在下一个开盘价减之前振幅1/5的价位出场
直接止损:进场价减去25天的振幅均值。

空头:
如果收盘价大于前一天的收盘价,且大于5天收盘价的均值,同时10天的振幅
均值小于25天的振幅均值,那么就第二天下stop单,以开盘价减去前一天振幅
的1/5作为做空价。
条件止损:如果收盘价小于10天,25天收盘价的均值,那么就下
stop单,以开盘价加上前一天振幅的1/5作为出场价
直接止损:进场价加上25天的振幅均值。


}

wxxx 发表于 2012-11-9 21:58:30

//Table 41.6  5 vs 15 Day Closing Averages
if MA(C,5)>MA(C,15) and MA(C,5)>MA(C,15) and MA(C,5)>MA(C,15)and MA(C,5)<MA(C,15) then
        Buy('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
if MA(C,5)<MA(C,15) and MA(C,5)<MA(C,15) and MA(C,5)<MA(C,15) and MA(C,5)>MA(C,15) then
        SellShort('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
{
当连续4天出现5天收盘价均值大于15天收盘价均值时,用市价单买入;
反之则做空。没有止损点。
}

wxxx 发表于 2012-11-9 22:13:30

//Fig 41.2  3月买入大豆.
Variable: e(0);
e:=Month;
if e=3 and e<>ethen Buy('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
if Month=7 then Sell('', DEFAULT, 0, 0, OT_Market, OB_NextBar, '');
SetProfitTarget(2000);
SetStopLoss (4000);

wxxx 发表于 2012-11-9 22:18:35

//Fig 41.3  7月做空大豆
Variable: e(0);
e:=Month;
if e=7 and e<>ethen SellShort('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
if Month=11 then BuyToCover('', DEFAULT, 0, 0, OT_Market, OB_NextBar, '');
SetProfitTarget(4000);
SetStopLoss (5000);

wxxx 发表于 2012-11-9 22:41:28

//Table 41.8  3 Day 30 Day Crossover
if MA(C,3)<MA(C,30) and MA(C,3)>MA(C,30) and MA(C,3)>MA(C,30) and MA(C,3)>MA(C,30)then
Buy('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
if MA(C,3)<MA(C,30) then Sell('', DEFAULT, 0, 0, OT_Market, OB_NextBar, '');

if MA(C,3)>MA(C,30) and MA(C,3)<MA(C,30) and MA(C,3)<MA(C,30) and MA(C,3)<MA(C,30)then
SellShort('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
if MA(C,3)>MA(C,30) then BuyToCover('', DEFAULT, 0, 0, OT_Market, OB_NextBar, '');

wxxx 发表于 2012-11-9 22:50:04

//Table 41.9 15 and 30 Days Back Indicator
if C>C and C>C then Buy('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
if C<C or C<C then Sell('', DEFAULT, 0, 0, OT_Market, OB_NextBar, '');
if C<C and C<C then SellShort('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
if C>C or C>C then BuyToCover('', DEFAULT, 0, 0, OT_Market, OB_NextBar, '');

{
在任意时刻只要收盘价小于任意周期(15,30)的均价就多头出场;
反之亦然。
}

wxxx 发表于 2012-11-9 23:05:54

//Table 42.1  和3个里面2个开盘价到收盘价反着做
Variable: e(0);
if C>O then e:=1;
if C<O then e:=-1;
if MA(e,3)<0 then Buy('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
if MA(e,3)>0 then SellShort('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
SetExitOnClose;

wxxx 发表于 2012-11-9 23:21:58

//Table 42.2  6 Indicator (Simple Majority)
Variable: e(0),aa(0),bb(0),cc(0),dd(0),ee(0),ff(0),gg(0);
if C>O then e:=1;
if C<O then e:=-1;
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 or ((high-low)>MA((high-low),10)) and C<C then dd:=1;
if ((high-low)<MA((high-low),10)) and C<C or ((high-low)>MA((high-low),10)) and C>C 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 MA(e,3)<0 then ff:=1;
if MA(e,3)>0 then ff:=-1;
if aa+bb+cc+dd+ee+ff>0 then Buy('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
if aa+bb+cc+dd+ee+ff<0 then SellShort('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
SetExitOnClose;

wxxx 发表于 2012-11-9 23:22:24

//Table 42.3  6 Indicator With 66% Stoploss
Variable: e(0),aa(0),bb(0),cc(0),dd(0),ee(0),ff(0),gg(0);
if C>O then e:=1;
if C<O then e:=-1;
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 or ((high-low)>MA((high-low),10)) and C<C then dd:=1;
if ((high-low)<MA((high-low),10)) and C<C or ((high-low)>MA((high-low),10)) and C>C 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 MA(e,3)<0 then ff:=1;
if MA(e,3)>0 then ff:=-1;
if aa+bb+cc+dd+ee+ff>0 then Buy('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
Sell('', DEFAULT, O[-1] -0.66*MA((high-low),3), -1, OT_Stop, OB_NextBar, '');
if aa+bb+cc+dd+ee+ff<0 then SellShort('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
BuyToCover('', DEFAULT, O[-1] +0.66*MA((high-low),3), -1, OT_Stop, OB_NextBar, '');
SetExitOnClose;

wxxx 发表于 2012-11-9 23:30:39

42章,43章,还有接下来的44章,都是对以前章节介绍的策略的组合。//Table 43.1  5 Combined Non-Either-Or Indicators
Variable:aa(0),bb(0),cc(0),dd(0),ee(0);
if C<C and C>C and C>C and C>C and C>C then aa=1; else aa:=0;
if C>C and C<C and C<C and C<C and C<C then aa:=-1;
if C<C and C>C and C>C and C>C and C>C and C>C then bb=1; else bb:=0;
if C>C and C<C and C<C and C<C and C<C and C<C then bb:=-1;
if L>L and L<LLV(L,3) and C>C  and C<Cthen cc=1; else cc:=0;
if H<H and H>HHV(H,3) and C<C and C>Cthen cc:=-1;
if HHV(L,3)-LLV(L,3)<=0.2*(HHV(H,3)-LLV(L,3)) then dd=1; else dd:=0;
if HHV(H,3)-LLV(H,3)<=0.2* (HHV(H,3)-LLV(L,3))then dd:=-1;
if C<O and C<O then ee=1; else ee:=0;
if C>O and C>O then ee:=-1;
if  aa+bb+cc+dd+ee>0 then Buy('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
if  aa+bb+cc+dd+ee<0 then SellShort('', DEFAULT, 0, 0, OT_Market, OB_NextBar,  '');
SetExitOnClose;
页: 1 2 3 4 5 6 7 [8] 9 10 11 12
查看完整版本: 战胜金融期货市场(把小的市场优势整合成为强大的赚钱策略)