【线性回归直线(Linear Reg Line)】
- UID
- 2
- 积分
- 2892617
- 威望
- 1396340 布
- 龙e币
- 1496277 刀
- 在线时间
- 13326 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-12-25
|
【线性回归直线(Linear Reg Line)】
- inputs:
- Length( 30 ),
- EndDate_YYMMDD( 0 ),
-
- EndTime_HHMM( 0 ),
- Color( Yellow ),
- ExtRight( true ) ;
- variables:
- var0( iff( EndDate_YYMMDD < 500000, EndDate_YYMMDD + 1000000,
- EndDate_YYMMDD ) ),
- var1( 0 ),
- var2( 0 ),
- var3( 0 ),
- var4( 0 ) ;
- if var4 = 0 then
-
- begin
- condition1 = var0 = 1000000 and LastBarOnChart ;
- if condition1 then
- begin
- var1 = LinearRegValue( C, Length, 0 ) ;
- var2 = LinearRegValue( C, Length, Length - 1 ) ;
- var3 = TL_New( Date[ Length - 1 ], Time[ Length - 1 ], var2, Date, Time,
- var1 ) ;
- var4 = 1 ;
- end
- else
- begin
- condition1 = Date = var0 and ( Time = EndTime_HHMM or EndTime_HHMM = 0 ) ;
- if condition1 then
- begin
- var1 = LinearRegValue( C, Length, 0 ) ;
- var2 = LinearRegValue( C, Length, Length - 1 ) ;
- var3 = TL_New( Date[ Length - 1 ], Time[ Length - 1 ], var2, Date, Time,
- var1 ) ;
- var4 = 2 ;
- end ;
- end;
- condition1 = var4 = 1 or var4 = 2 ;
- if condition1 then
- begin
- TL_SetColor( var3, Color ) ;
- TL_SetExtLeft( var3, false ) ;
- if ExtRight then
- TL_SetExtRight( var3, true )
- else
- TL_SetExtRight( var3, false ) ;
- end ;
- end
- else if var4 = 1 then
-
-
- begin
- var1 = LinearRegValue( C, Length, 0 ) ;
- var2 = LinearRegValue( C, Length, Length - 1 ) ;
- TL_SetBegin( var3, Date[ Length - 1 ], Time[ Length - 1 ], var2 ) ;
- TL_SetEnd( var3, Date, Time, var1 ) ;
- end ;
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|
|
|
|
|
|