- 精华
- 0
- 在线时间
- 395 小时
- UID
- 175500
- 积分
- 72
- 帖子
- 36
- 阅读权限
- 30
- 注册时间
- 2013-11-11
- 最后登录
- 2021-6-15
- 精华
- 0
- UID
- 175500
- 积分
- 72
- 帖子
- 36
- 主题
- 17
- 阅读权限
- 30
- 注册时间
- 2013-11-11
- 最后登录
- 2021-6-15
|
本帖最后由 hbxtxq77 于 2015-5-28 20:49 编辑
自己写的空头代码,如何过滤掉多头趋势中的信号?
Params
Numeric B_Length1(13);// 长周期突破
Numeric B_Length2(3);
Numeric lots(1);// 头寸大小
Vars
NumericSeries HiBand1;
NumericSeries HiBand2;
NumericSeries LoBand1;
NumericSeries LoBand2;
NumericSeries MA3;
//以下多头
Begin
HiBand1 = highest(high,B_Length1);//长
LoBand1 = lowest(low,B_Length1);//长
HiBand2 = highest(high,B_Length2);//短
LoBand2 = lowest(low,B_Length2);//短
MA3 = ((High-Low)/2+LOW);
PlotNumeric("HiBand1",HiBand1);
PlotNumeric("LoBand1",LoBand1);
plotnumeric("HiBand2",HiBand2);
plotnumeric("LoBand2",LoBand2);
PlotNumeric("MA3",MA3);
if(HiBand1[1]>hiband2[1])
{
SellShort(lots,0);
}
Else
if ( LoBand1[1]<LoBand2[1])
{
BuyToCover(lots,0);
}
End |
附件: 你需要登录才可以下载或查看附件。没有帐号?注册
|