- variable:sj=1150605,fc=close,fo=open,fh=high,fl=low;//记义一些常量
% j7 P5 a# y/ P$ }, Y - d0:=barssince(date>=sj);//从给定的时间到当前的周期
' z8 u4 X/ K% R8 x0 } - d1:BARSLAST(low=LLV(L,d0))+1;//周期内到达最低点的周期数$ t! I. Q1 A/ f/ b, }4 E7 M
- g1:barslast(high=hhv(h,d0))+1;//周期内到达最高点的周期数
+ u9 d" ^( }4 L: S, q$ |( t - qs:if(d1[datacount]>g1[datacount],1,0),linethick0;//趋势向上为1,向下为0
& C5 e9 O7 [: U, s0 i% u1 t( {+ z; H - dz:fl[datacount-d1[datacount]+1];//低点值8 d1 m4 G5 Q! N# w# C% m
- gz:fh[datacount-g1[datacount]+1];//高点值
复制代码 |