- 精华
- 0
- 在线时间
- 40 小时
- UID
- 140858
- 积分
- 43
- 帖子
- 29
- 阅读权限
- 10
- 注册时间
- 2013-7-1
- 最后登录
- 2017-1-31
- 精华
- 0
- UID
- 140858
- 积分
- 43
- 帖子
- 29
- 主题
- 12
- 阅读权限
- 10
- 注册时间
- 2013-7-1
- 最后登录
- 2017-1-31
|
本帖最后由 jrqh116098 于 2016-1-11 19:49 编辑
小米老师,对不起,是我弄错了。
和朋友讨论了下,不是自带代码本身的问题,是我的全局变量没有写好。
If(MarketPosition==1)
{
If(Open>=LastEntryPrice+MoreLength && GetGlobalVar(0)<TotalN)
{
Buy(MyNumeric,Open+MySmooth*Minpoint);
SetGetGlobalVar(0,GetGlobalVar(0)+1);
Commentary("多头加仓");
}
While(High>=LastEntryPrice+MoreLength && GetGlobalVar(0)<TotalN)
{
Buy(MyNumeric,LastEntryPrice+MoreLength+MySmooth*Minpoint);
SetGetGlobalVar(0,GetGlobalVar(0)+1);
Commentary("多头加仓");
}
}
全局变量SetGetGlobalVar(0,GetGlobalVar(0)+1); 是不是能这么用?换成NumericSeries i;就没有闪烁了。 |
|