【N日的新高/低(New N-Day Hilo)】
- UID
- 2
- 积分
- 2874674
- 威望
- 1387366 布
- 龙e币
- 1487308 刀
- 在线时间
- 13156 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-11-24
|
【N日的新高/低(New N-Day Hilo)】
- inputs:
- NumDays( 7 ),
- NewQualDays( 0 ),
- OldQualDays( 0 ) ;
- variables:
- var0( 0 ),
- var1( 0 ),
- var2( 0 ),
- var3( 0 ),
- var4( 0 ),
- var5( 0 ),
- var6( false ),
- var7( false ),
- var8( 0 ),
- var9( 0 ) ;
- arrays:
- arr0[ 12, 100 ]( 0 ),
- arr1[3]( 0 ) ;
- Value1 = RS_DailyDataArray( NumDays, arr0, var0, arr1 ) ;
- condition1 = CurrentBar = 1 or Date <> Date[1] ;
- if condition1 then
- begin
- Value2 = RS_Extremes( NumDays, arr0, var0, var1, var2,
- var3, var4 ) ;
- var5 = NumDays - OldQualDays ;
- var6 = var2 <= var5 and var2 > NewQualDays ;
- var7 = var4 <= var5 and var4 > NewQualDays ;
- end ;
-
-
- condition1 = var6 and High > var1
- and IffLogic( arr0[ 12, var0 ] = arr1[3], arr1[1] <= var1, true );
- if condition1 then
- begin
- if Date <> var8 then
- Plot1( High, "NewNDayHi" ) ;
- var8 = Date ;
- end
- else
- begin
- condition1 = var7 and Low < var3 and IffLogic( arr0[ 12, var0 ] =
- arr1[3], arr1[2] >= var3, true ) ;
- if condition1 then
- begin
- if Date <> var9 then
- Plot2( Low, "NewNDayLo" ) ;
- var9 = Date ;
- end ;
- end;
- Plot3( var1, "HiLine" ) ;
- Plot4( var3, "LoLine" ) ;
- if var6 then
- SetPlotWidth( 3, 2 ) ;
- if var7 then
- SetPlotWidth( 4, 2 ) ;
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|
|
|
|
|
|