- 精华
- 0
- 在线时间
- 138 小时
- UID
- 348
- 积分
- 347
- 帖子
- 83
- 阅读权限
- 50
- 注册时间
- 2007-9-13
- 最后登录
- 2021-9-14
- 精华
- 0
- UID
- 348
- 积分
- 347
- 帖子
- 83
- 主题
- 31
- 阅读权限
- 50
- 注册时间
- 2007-9-13
- 最后登录
- 2021-9-14
|
就是以2N+1为周期求峰值,但是我用plotnumeric试着画了一下,不仅出不了图,而且能直接让TB崩溃。毛病在什么地方?
Params
Numeric TYPE(0);
Numeric length1(10);
Numeric length2(10);
Vars
Numeric Highvalue;
Numeric Lowvalue;
Begin
IF(TYPE==0)
{ If (CurrentBar < 2*length1+1 )
{
Highvalue=Highest(Close,2*length1+1);
}
Else
{
If(close[length1]==Highest(Close,2*length1+1)&&close[length1]>=Highest(Close,length1))
{Return Highvalue=close[length1];}
}
}
IF(TYPE==1)
{ If (CurrentBar < 2*length2+1 )
{
Lowvalue=Lowest(Close,2*length2+1);
}
Else
{If(close[length2]==Lowest(Close,2*length2+1)&&close[length2]<=lowest(Close,length2))
{Return Lowvalue=close[length2];}
}
}
End
[ 本帖最后由 jeckforlete 于 2009-5-11 23:30 编辑 ] |
|