- 精华
- 2
- 在线时间
- 2808 小时
- UID
- 4130
- 积分
- 20901
- 帖子
- 6519
- 阅读权限
- 200
- 注册时间
- 2009-4-15
- 最后登录
- 2019-4-12
- 精华
- 2
- UID
- 4130
- 积分
- 20901
- 帖子
- 6519
- 主题
- 17
- 阅读权限
- 200
- 注册时间
- 2009-4-15
- 最后登录
- 2019-4-12
|
已解决
Vars
NumericSeries diff;
NumericSeries dea;
NumericSeries lon;
Numeric vid;
NumericSeries rc;
NumericSeries mlong;
Begin
If(BarStatus==0)
mlong=0;
Else If(CurrentBar>=2)
{
If(high==Low)
vid=0;
Else
vid=Summation(Vol,2)/((Highest(HIGH,2)-Lowest(LOW,2))*100);
rc=(Close-Close[2])*vid;
//mlong=rc+mlong[1];
mlong=Summation(rc,CurrentBar+1);
diff=SMA(mlong,15,1);
dea=SMA(mlong,20,1);
lon=diff-dea;
If(CrossOver(lon,0))
{
Buy(1,0);
}Else If(CrossUnder(lon,0))
{
SellShort(1,0);
}
}
Commentary("vid="+Text(vid));
Commentary("CurrentBar="+Text(CurrentBar));
Commentary("mlong="+Text(mlong));
Commentary("rc="+Text(rc));
End
配合以下指标,可以查看lon
Params
Vars
NumericSeries diff;
NumericSeries dea;
NumericSeries lon;
Numeric vid;
NumericSeries rc;
NumericSeries mlong;
Begin
If(BarStatus==0)
mlong=0;
Else If(CurrentBar>=2)
{
If(high==Low)
vid=0;
Else
vid=Summation(Vol,2)/((Highest(HIGH,2)-Lowest(LOW,2))*100);
rc=(Close-Close[2])*vid;
mlong=Summation(rc,CurrentBar+1);
diff=SMA(mlong,15,1);
dea=SMA(mlong,20,1);
lon=diff-dea;
}
PlotNumeric("line",0);
PlotNumeric("lon",lon);
End |
|