- UID
- 2
- 积分
- 2874664
- 威望
- 1387361 布
- 龙e币
- 1487303 刀
- 在线时间
- 13156 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-11-24
|
【LinearRegLine】
- Inputs: Len(Numeric), BarsPlus(Numeric), SlctDate(Numeric), SlctTime(Numeric), Color(Numeric), ExtRight(TrueFalse);
- Variables: var0(0), var1(0), var2(0), var3(0);
- var0 = LinearRegValue(Close, Len, BarsPlus);
- var1 = LinearRegValue(Close, Len, Len-1);
- condition1 = LastBarOnChart AND SlctDate = 0 AND var3 = 0 ;
- If condition1 Then Begin
- var2 = TL_New(Date[Len-1], Time[Len-1], var1, Date, Time, var0);
- var3 = 1;
- End;
- condition1 = Date = SlctDate AND (Time = SlctTime OR SlctTime = 0) ;
- If condition1 Then Begin
- var2 = TL_New(Date[Len-1], Time[Len-1], var1, Date, Time, var0);
- var3 = 2;
- End;
- condition1 = var3 = 1 OR var3 = 2 ;
- If condition1 Then Begin
- If var3 = 2 Then
- var3 = 3;
- TL_SetColor(var2, Color);
- TL_SetExtLeft(var2, False);
- If ExtRight Then
- TL_SetExtRight(var2, True)
- Else
- TL_SetExtRight(var2, False);
- End;
- If var3 = 1 Then Begin
- TL_SetBegin(var2, Date[Len-1], Time[Len-1], var1);
- TL_SetEnd(var2, Date, Time, var0);
- End;
- If var0 <> -1 Then
- LinearRegLine = 1
- Else
- LinearRegLine = -1;
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|