- 精华
- 0
- 在线时间
- 24 小时
- UID
- 4528
- 积分
- 168
- 帖子
- 47
- 阅读权限
- 40
- 注册时间
- 2009-5-30
- 最后登录
- 2010-1-15
- 精华
- 0
- UID
- 4528
- 积分
- 168
- 帖子
- 47
- 主题
- 7
- 阅读权限
- 40
- 注册时间
- 2009-5-30
- 最后登录
- 2010-1-15
|
Params // 宣告参数定义
Numeric Lots(50);
Vars
NumericSeries diff;
NumericSeries dea;
NumericSeries lonma;
NumericSeries lon;
Numeric vid;
NumericSeries rc;
NumericSeries mlong;
Begin
If(BarStatus==0)
mlong=0;
Else If(CurrentBar>=2)
{
vid=Summation(Vol,2)/((Highest(HIGH,2)-Lowest(LOW,2))*100);
rc=(Close-Close[1])*vid;
//mlong=rc+mlong[1];
mlong=Summation(rc,CurrentBar+1);
diff=SMA(mlong,15,1);
dea=SMA(mlong,20,1);
lon=diff-dea;
lonma=AverageFC(lon,9);
If(CrossOver(lon,lonma))
{
BuyToCover(0,0);
Buy(lots,0);
}Else If(CrossUnder(lon,lonma))
{
Sell(0,0);
SellShort(lots,0);
}
}
Commentary("rc="+Text(rc));
Commentary("mlong="+Text(mlong));
End
[ 本帖最后由 kgy000 于 2009-12-30 13:19 编辑 ] |
附件: 你需要登录才可以下载或查看附件。没有帐号?注册
|