- 精华
- 0
- 在线时间
- 91 小时
- UID
- 92518
- 积分
- 164
- 帖子
- 50
- 阅读权限
- 40
- 注册时间
- 2012-1-12
- 最后登录
- 2018-1-11
- 精华
- 0
- UID
- 92518
- 积分
- 164
- 帖子
- 50
- 主题
- 25
- 阅读权限
- 40
- 注册时间
- 2012-1-12
- 最后登录
- 2018-1-11
|
Aberration System
Parameter: Length(35), StdDevUp(2.0), StdDevDn(-2.0)
Vars: UpBand(0), DnBand(0), Ave(0)
UpBand = BollingerBand(Close,Length,StdDevUp)
DnBand = BollingerBand(Close,Length,StdDevDn)
Ave = Average(Close,Length)
if ( MarketPosition = 0 ) and ( Close > UpBand ) then
Buy("BE") tomorrow at market
end if
if ( MarketPosition = 0 ) and ( Close < DnBand ) then
Sell("SE") tomorrow at market
end if
if ( MarketPosition = 1 ) and ( Close < Ave ) then
ExitLong("LX") today at close
end if
if ( MarketPosition = -1 ) and ( Close > Ave ) then
ExitShort("SX") today at close
end if
在Tradestation下
Input: Length(35), StdDevUp(2.0), StdDevDn(-2.0);
Vars: UpBand(0), DnBand(0), Ave(0);
UpBand=BollingerBand(Close, Length, StdDevUp);
DnBand=BollingerBand(Close, Length, StdDevDn);
Ave=Average(Close, Length);
{--------Enter Long--------}
if (MarketPosition=0) and (Close > UpBand) then
Buy("BE") tomorrow at market;
{--------Enter Short--------}
if (MarketPosition=0) and (Close < DnBand) then
Sell("SE") tomorrow at market;
{--------Exit Long--------}
if (MarketPosition=1) and (Close < Ave) then
ExitLong("LX") today at Close;
{--------Exit Short--------}
if (MarketPosition=-1) and (Close > Ave) then
ExitShort("SX") today at Close;
========================
Parameter: Length(35), 標準差(2) ;
VARS:均線(0),上(0),下(0) ;
IF NOT(high=low) then
均線 = MA(C,Length)
Value1 = StdDev(C,Length)
上 = 均線 + 標準差*Value1
下 = 均線 - 標準差*Value1
IF C CROSS OVER 上 THEN
BUY NEXT BAR AT MARKET
END IF
IF C CROSS UNDER 下 THEN
SELL NEXT BAR AT MARKET
END IF
IF C < 均線 THEN
EXITLONG THIS BAR AT CLOSE
END IF
IF C > 均線 THEN
EXITSHORT THIS BAR AT CLOSE
END IF
END IF |
|