【三角收敛/突破(Pennant Brkout)】
- UID
- 2
- 积分
- 2874674
- 威望
- 1387366 布
- 龙e币
- 1487308 刀
- 在线时间
- 13156 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-11-24
|
【三角收敛/突破(Pennant Brkout)】
- inputs:
- Length( 7 ),
- MaxConsolIndex( 1.5 ),
- BarsPast( 5 ),
- DrawLines( true ),
- DrawExtensions( true ),
- Color1( Red ),
- Color2( Magenta ) ;
-
- variables:
- var0( Length - 1 ),
- var1( 0 ),
- var2( 0 ),
- var3( 0 ),
- var4( 0 ),
- var5( Color2 ),
- var6( 0 ),
- var7( 0 ) ;
- Value1 = Pennant( Length, MaxConsolIndex, BarsPast, var1, var2,
- var3, var4 ) ;
- if Value1 = 1 then
- begin
-
- if var5 = Color2 then
- var5 = Color1
- else
- var5 = Color2 ;
- if DrawLines then
- begin
- var6 = TL_New( Date[var0], Time[var0], var1, Date,
- Time, var2 ) ;
- TL_SetExtLeft( var6, false ) ;
- TL_SetExtRight( var6, false ) ;
- TL_SetColor( var6, var5 ) ;
- var7 = TL_New( Date[var0], Time[var0], var3, Date,
- Time, var4 ) ;
- TL_SetExtLeft( var7, false ) ;
- TL_SetExtRight( var7, false ) ;
- TL_SetColor( var7, var5 ) ;
- end ;
- end
- else
- begin
- condition1 = Value1 = 2 or Value1 = 3 ;
- if condition1 then
- begin
- if DrawLines then
- begin
- TL_SetSize( var6, 2 ) ;
- TL_SetSize( var7, 2 ) ;
- end ;
- if Value1 = 2 then
- Plot1( High, "PenBrkoutUp" )
- else if Value1 = 3 then
- Plot2( Low, "PenBrkoutDn" ) ;
- end ;
- end;
- if DrawExtensions then
- begin
- if var2 > 0 then
- Plot3( var2, "HiExt", var5 ) ;
- if var4 > 0 then
- Plot4( var4, "LoExt", var5 ) ;
- end ;
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|
|
|
|
|
|