- 精华
- 0
- 在线时间
- 23 小时
- UID
- 182857
- 积分
- 20
- 帖子
- 15
- 阅读权限
- 10
- 注册时间
- 2014-3-19
- 最后登录
- 2014-9-16
- 精华
- 0
- UID
- 182857
- 积分
- 20
- 帖子
- 15
- 主题
- 4
- 阅读权限
- 10
- 注册时间
- 2014-3-19
- 最后登录
- 2014-9-16
|
楼主这样写下看下行不行
params
Numeric length1(10);
Numeric length2(20);
Vars
NumericSeries MA1;
NumericSeries MA2;
Begin
MA1=AverageFC(Close,length1);
MA2=AverageFC(close,legnth2);
PlotNumeric("MA1",MA1);
PlotNumeric("MA2",MA2);
If(MA1[1]>MA2[1] And Close[1]>Max(close[1],length2))
{
Buy(0,open);
}
If(MA1[1]<MA2[1] And Close[1]<Min(close[1],length2))
{
SellShort(0,open);
}
If(Close[1]<MA2[1]) And MarketPosition==1)
{
Sell(0,open)
}
If(Close[1]>MA2[1] AND marketposion==-1)
{
Sell(0,OPEN);
}
End
|
|