- 精华
- 0
- 在线时间
- 16 小时
- UID
- 256662
- 积分
- 2
- 帖子
- 1
- 阅读权限
- 10
- 注册时间
- 2017-9-8
- 最后登录
- 2018-7-19
- 精华
- 0
- UID
- 256662
- 积分
- 2
- 帖子
- 1
- 主题
- 1
- 阅读权限
- 10
- 注册时间
- 2017-9-8
- 最后登录
- 2018-7-19
|
发表于 2017-9-20 17:08:24
|显示全部楼层
请问第一个双均线系统,为什么会有讯号消失的情况呢?跟第二个有什么区别吗
Params
Numeric length1(5);
Numeric length2(20);
Vars
NumericSeries firstline;
NumericSeries secondline;
BoolSeries buycon;
BoolSeries sellcon;
Begin
// 集合竞价和小节休息过滤
If(!CallAuctionFilter()) Return;
firstline=Average(close,length1);
secondline=Average(close,length2);
buycon=firstline>secondline ;
sellcon=firstline<secondline ;
if (marketposition!=1 and buycon[1] and vol>0) Buy(1,open);
if(marketposition!=-1 and sellcon[1] and vol>0)sellshort(1,open);
end
-----------------------------------系统自带双均线--------------------------------------------------------------
Numeric FastLength(5);
Numeric SlowLength(20);
Vars
NumericSeries AvgValue1;
NumericSeries AvgValue2;
Begin
AvgValue1 = AverageFC(Close,FastLength);
AvgValue2 = AverageFC(Close,SlowLength);
PlotNumeric("MA1",AvgValue1);
PlotNumeric("MA2",AvgValue2);
// 集合竞价和小节休息过滤
If(!CallAuctionFilter()) Return;
If(MarketPosition <>1 && AvgValue1[1] > AvgValue2[1])
{
Buy(1,Open);
}
If(MarketPosition <>-1 && AvgValue1[1] < AvgValue2[1])
{
SellShort(1,Open);
}
//PlotNumeric("PL",Portfolio_TotalProfit);
End
|
|