- 精华
- 0
- 在线时间
- 2366 小时
- UID
- 116737
- 积分
- 781
- 帖子
- 210
- 阅读权限
- 60
- 注册时间
- 2013-3-14
- 最后登录
- 2019-8-16
- 精华
- 0
- UID
- 116737
- 积分
- 781
- 帖子
- 210
- 主题
- 32
- 阅读权限
- 60
- 注册时间
- 2013-3-14
- 最后登录
- 2019-8-16
|
inputs:
Length(20),
Strength(3),
MaximumSlope(10),
MaximumPivots(3);
variables:
FoundHighPivot(false),
FoundLowPivot(False),
N(0),M(0),
SH1(-1), SH2(-1),starBar(0),
SL1(-1), SL2(-1),
TH(-1), TL(-1),
highslope(0.0),lowslope(0.0),ProjectHigh(0.0),ProjectLow(0.0);
if date>date[1] then
starBar=BarNumber;
N=1;
SH1=PivotHighVSBar(N,high,strength,strength,Length);
if SH1<>-1 then begin
N=2;
FoundHighPivot=False;
while FoundHighPivot=False and N<=MaximumPivots begin
SH2=PivotHighVSBar(N,high,strength,strength,Length);
condition1= currentbar-SH2>=starBar;
if SH2<>-1 and high[SH1]<high[SH2] and condition1 then
FoundHighPivot=true;
N=N+1;
end;
end;
N=1;
SL1=PivotLowVSBar(N,low,strength,strength,Length);
if SL1<>-1 then begin
N=2;
FoundLowPivot=False;
while FoundLowPivot=False and N<=MaximumPivots begin
SL2=PivotLowVSBar(n,LOW,strength,strength,Length);
condition2= currentbar-SL2>=starBar;
if SL2<>-1 and Low[SL1]>Low[SL2] and condition2 then
FoundLowPivot=true;
N=N+1;
end;
end;
if FoundHighPivot and FoundLowPivot then begin
TH=tl_new(date,time[sh2],high[sh2],date,time[SH1],high[SH1]);
TL=tl_new(date,time[sl1],low[sl1],date,time[Sl2],low[Sl2]);
end;
|
附件: 你需要登录才可以下载或查看附件。没有帐号?注册
|