- 精华
- 0
- 在线时间
- 98 小时
- UID
- 21061
- 积分
- 89
- 帖子
- 54
- 阅读权限
- 30
- 注册时间
- 2010-12-7
- 最后登录
- 2014-3-11
- 精华
- 0
- UID
- 21061
- 积分
- 89
- 帖子
- 54
- 主题
- 17
- 阅读权限
- 30
- 注册时间
- 2010-12-7
- 最后登录
- 2014-3-11
|
Params
Numeric LineRegLength(20);
Numeric multiB(0.004);
Numeric multiS(0.002);
Numeric recBar(2);
Numeric maxtime(3);
Numeric opentime(900);
Numeric lasttime(1450);
Numeric endtime(1458);
Vars
NumericSeries LineValue(0);
NumericSeries times(0);
NumericSeries maxProfit(0);
Begin
if(CurrentBar>LineRegLength+1)
{
LineValue=LinearRegValue(Close,LineRegLength,0);
}
Else
{
LineValue=LineValue[1];
}
if (Time >= opentime/10000 + initime/10000 && Time <= lasttime/10000 && times < maxtime && MarketPosition == 0 )
{
if(LineValue>LineValue[recBar]*(1+multiB))
{
Buy(1,open);
times = times + 1;
}
if( LineValue<LineValue[recBar]*(1-multiS))
{
SellShort(1,open);
times = times + 1;
}
}
end
什么原因呢 |
|