- UID
- 2
- 积分
- 2874604
- 威望
- 1387331 布
- 龙e币
- 1487273 刀
- 在线时间
- 13155 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-11-24
|
【CoefficientREasy】
- inputs:
- Dep( numericseries ),
- Len( numericsimple ) ;
- variables:
- var0( 0 ),
- var1( 0 ),
- var2( 0 ),
- var3( 0 ),
- var4( 0 ),
- var5( 0 ),
- var6( 0 ),
- var7( 0 ),
- var8( 0 ),
- var9( 0 ) ;
- CoefficientREasy = -2 ;
- if Len > 0 then
- begin
- var0 = 0.5 * ( Len - 1 ) ;
- var1 = 0 ;
- for var8 = 0 to Len - 1
- begin
- var1 = var1 + Dep[var8] ;
- end ;
- var1 = var1 / Len ;
- var4 = 0 ;
- var2 = 0 ;
- var3 = 0 ;
- for var8 = 0 to Len - 1
- begin
- var6 = Len - 1 - var8 - var0 ;
- var5 = Dep[var8] - var1 ;
- var4 = var4 + Square( var6 ) ;
- var2 = var2 + Square( var5 ) ;
- var3 = var3 + var6 * var5 ;
- end ;
- var9 = var4 * var2 ;
- if var9 > 0 then
- begin
- var7 = var3 / SquareRoot( var9 ) ;
- condition1 = var7 >= -1 and var7 <= 1 ;
- if condition1 then
- CoefficientREasy = var7 ;
- end ;
- end ;
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|