- UID
- 2
- 积分
- 2874674
- 威望
- 1387366 布
- 龙e币
- 1487308 刀
- 在线时间
- 13156 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-11-24
|
【Pivot】
- inputs:
- PriceValue( numericseries ),
- Len( numericsimple ),
- LeftStrength( numericsimple ),
- RightStrength( numericsimple ),
- Instance( numericsimple ),
- HiLo( numericsimple ),
- oPivotPriceValue( numericref ),
- oPivotBar( numericref ) ;
- variables:
- var0( 0 ),
- var1( 0 ),
- var2( 0 ),
- var3( 0 ),
- var4( false ),
- var5( false ) ;
- var3 = 0 ;
- var5 = false ;
- var1 = RightStrength ;
- while var1 < Len and var5 = false
- begin
-
-
- var0 = PriceValue[var1] ;
- var4 = true ;
-
- var2 = var1 + 1 ;
- while var4 = true and var2 - var1 <= LeftStrength
- begin
- condition1 = ( HiLo = 1 and var0 < PriceValue[var2] )
- or ( HiLo = -1 and var0 > PriceValue[var2] ) ;
-
- if condition1 then
- var4 = false
- else
- var2 = var2 + 1 ;
- end ;
-
-
- var2 = var1 - 1 ;
- while var4 = true and var1 - var2 <= RightStrength
- begin
- condition1 = ( HiLo = 1 and var0 <= PriceValue[var2] )
- or ( HiLo = -1 and var0 >= PriceValue[var2] ) ;
-
- if condition1 then
- var4 = false
- else
- var2 = var2 - 1 ;
- end ;
-
- if var4 = true then
- var3 = var3 + 1 ;
-
-
- if var3 = Instance then
- var5 = true
- else
- var1 = var1 + 1 ;
- end ;
- if var5 = true then
- begin
- oPivotPriceValue = var0 ;
- oPivotBar = var1 + ExecOffset ;
- Pivot = 1 ;
- end
- else
- begin
- oPivotPriceValue = -1 ;
- oPivotBar = -1 ;
- Pivot = -1 ;
- end ;
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|