RE: REGRESSION CHANNELS gesucht für TS... | |
Hi,
ohne Gewähr!
Gruß TomE
Inputs: Len(20),offset(1),k(AvgTrueRange(10)), BarsPlus(0), SlctDate(0), SlctTime(0), Color(2), ExtRight(True); Variables: LRV(0), LRV1(0), LRV2(0), LRVAgo(0), LRVAgo1(0), LRVAgo2(0), TL(0), TL1(0), TL2(0), Flag(0),flag1(0),flag2(0), z(0), x(0), y(0),g(0),j(0);
Z= C; g=LinearRegValue(z, Len, BarsPlus); j= LinearRegValue(z, Len, Len-1); x=LinearRegSlope(z,LEN);
LRV =offset*k+ g; LRVAgo =offset*k+j;
If LastBarOnChart {d=slctdate and t=slcttime} AND Flag = 0 Then Begin TL = TL_New(D[Len-1], T[Len-1], LRVAgo, D, T, LRV); Flag = 1; value3=0; End; If Flag = 1 Then Begin TL_SetColor(TL, Color); If ExtRight Then TL_SetExtRight(TL, True) Else TL_SetExtRight(TL, False); End; If Flag = 1 Then Begin TL_SetBegin(TL, Date[Len-1], Time[Len-1], LRVAgo); TL_SetEnd(TL, D, T, LRV); End; If CheckAlert then If value3=0 then if x<0 and z crosses over LRV then begin alert=true; value3=0; end; {...........................................} LRV1 =0*k+ g; LRVAgo1 =0*k+ j;
If LastBarOnChart {slctdate and t=slcttime} AND Flag1 = 0 Then Begin TL1 = TL_New(D[Len-1], T[Len-1], LRVAgo1, D, T, LRV1); Flag1 = 1; End; If Flag1 =1 Then Begin TL_SetColor(TL1, Color); If ExtRight Then TL_SetExtRight(TL1, True) Else TL_SetExtRight(TL1, False); End; If Flag1 = 1 Then Begin TL_SetBegin(TL1, D[Len-1], T[Len-1], LRVAgo1); TL_SetEnd(TL1, Date, Time, LRV1); End;
{...................................................} LRV2 =-1*offset*k+g; LRVAgo2 =-1*offset*k+j;
If LastBarOnChart { d=slctdate and t=slcttime} AND Flag2 = 0 Then Begin TL2 = TL_New(D[Len-1], T[Len-1], LRVAgo2, D, T, LRV2); Flag2 = 1; value4=0; End; If Flag2 = 1 Then Begin TL_SetColor(TL2, Color); If ExtRight Then TL_SetExtRight(TL2, True) Else TL_SetExtRight(TL2, False); End; If Flag2 =1 Then Begin TL_SetBegin(TL2, D[Len-1], T[Len-1], LRVAgo2); TL_SetEnd(TL2, D, T, LRV2); End; If CheckAlert then If value4=0 then if x>0 and z crosses under LRV2 then begin alert=true; value4=0; end;
if false then plot1(flag2,"");
|