- 精华
- 0
- 在线时间
- 466 小时
- UID
- 110420
- 积分
- 547
- 帖子
- 326
- 阅读权限
- 50
- 注册时间
- 2012-5-11
- 最后登录
- 2019-1-11
- 精华
- 0
- UID
- 110420
- 积分
- 547
- 帖子
- 326
- 主题
- 16
- 阅读权限
- 50
- 注册时间
- 2012-5-11
- 最后登录
- 2019-1-11
|
本帖最后由 受伤的小鱼 于 2012-12-23 12:19 编辑
受伤的小鱼 发表于 2012-12-23 05:07
暂且先不提那个可能发生暴仓的情况,而17,1.8,1.1这组参数在2010-2011的TB系数最大优化结果里是排在第3 ...
在对策略进行下一步之前,先看看语序的问题的影响,而且优化的1.8和1.1因为倍数的缩小,发生这种事儿的概率就会增大
Params
Numeric atrlen(20);
Numeric atrvl(2);
Numeric atrvs(2);
Numeric test(0);
Vars
Numeric offs;
NumericSeries atr;
Numeric uprail;
Numeric lorail;
Numeric lprice;
Numeric sprice;
BoolSeries entryl01;
BoolSeries entrys01;
Begin
offs=MinMove*PriceScale;
atr=Average(h-l,atrlen);
uprail=open+atrvl*atr[1];
lorail=open-atrvs*atr[1];
lprice=uprail+2*offs;
sprice=lorail-2*offs;
entryl01=high>uprail;
Entrys01=low <lorail;
if (test==0)
{
if (MarketPosition<>1 and entryl01 ) Buy(0,lprice);
if (MarketPosition<>-1 and entrys01 ) SellShort(0,sprice);
}
if (test==1)
{
if (MarketPosition<>-1 and entrys01 ) SellShort(0,sprice);
if (MarketPosition<>1 and entryl01 ) Buy(0,lprice);
}
Commentary("swag"+Text(CountIf (entryl01 and entrys01,CurrentBar)));
end
通过countif统计历史上这组参数发生这样的事件1次:2012年9月27!不讨论这吧,只能说今后还会发生,而且发生的更恶劣,来回10次,暴你仓。。。。。。。。。
可别小看这2万,有时一年下来决定盈亏的就在于那一次,2万相当于本金来说20%啊!!!!
呷饭先!!!!!!!! |
附件: 你需要登录才可以下载或查看附件。没有帐号?注册
|