- 精华
- 0
- 在线时间
- 923 小时
- UID
- 397
- 积分
- 4818
- 帖子
- 87
- 阅读权限
- 80
- 注册时间
- 2007-9-22
- 最后登录
- 2021-6-8
- 精华
- 0
- UID
- 397
- 积分
- 4818
- 帖子
- 87
- 主题
- 13
- 阅读权限
- 80
- 注册时间
- 2007-9-22
- 最后登录
- 2021-6-8
|
原帖由 柳长街 于 2007-10-16 15:42 发表
谢谢,有很多信号不对啊,要求股价穿越牙齿也就是红线发出信号
修改了个版本,这个会精确啦 :
Vars
NumericSeries MidPrice; // 定义变量用于保存高低价的平均值。
NumericSeries AvePrice; // 用来保存中间变量
NumericSeries EnterPoint;
Numeric myEntryPrice ;
Begin
// IF (Currentbar>9)
//{
MidPrice = (High[1] + Low[1])/2;
AvePrice = Average(MidPrice,8);
EnterPoint=AvePrice[5];
Commentary("触发价:"+Text(EnterPoint));
If(CrossOver(high, EnterPoint ))
{
myEntryPrice = IIF(EnterPoint < Open, Open,EnterPoint);
buy(1, myEntryPrice);
}
If(CrossUnder(low, EnterPoint ))
{
myEntryPrice = IIF(EnterPoint > Open, Open,EnterPoint);
SellShort(1, myEntryPrice);
}
//}
End
[ 本帖最后由 ilian 于 2007-10-16 19:31 编辑 ] |
-
总评分: 威望 + 828
查看全部评分
|