设为首页收藏本站

 找回密码
 注册
查看: 13169|回复: 0
打印 上一主题 下一主题

策略信号图系列之一Aberration(出轨)系统 [复制链接]

Rank: 3Rank: 3

精华
0
UID
92518
积分
164
帖子
50
主题
25
阅读权限
40
注册时间
2012-1-12
最后登录
2018-1-11
1#
发表于 2012-2-21 10:46:14 |显示全部楼层
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

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-5-24 03:50

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部