TREND LINES

TREND LINES

Type : Indicator, Name : Swing Trader Trendline

Inputs:
Strength(5),
TLAlrt(«TRUE»),
ColorCur(Tool_White),
ShowHis(«TRUE»),
ColorHis(Tool_Magenta);

Vars:
TL3(0),
TL4(0),
TL3Val(0),
HFlag(0),
Count(0);

Array:
SwingHD[4](0),
SwingHT[4](0),
SwingHP[4](0);

IF SwingHighBar(1, High, Strength, Strength + 1) = Strength Then Begin
Plot1[Strength](SwingHigh(1, High, Strength, Strength + 1), «SwingHigh»);
For Count = 4 DownTo 2 Begin
SwingHD[Count] = SwingHD[Count -1];
SwingHT[Count] = SwingHT[Count -1];
SwingHP[Count] = SwingHP[Count -1];
End;
SwingHD[1] = Date[Strength];
SwingHT[1] = Time[Strength];
SwingHP[1] = High[Strength];
IF HFlag = -1 Then Begin
IF UpperStr(ShowHis) = «TRUE» Then Begin
TL3Val = TL_GetValue(TL3, SwingHD[1], SwingHT[1]);
TL4 = TL_New(SwingHD[3], SwingHT[3], SwingHP[3], SwingHD[1],
SwingHT[1], TL3Val);
TL_SetColor(TL4, ColorHis);
End;
TL_Delete(TL3);
End;
HFlag = 1;
End;

IF SwingHD[4] <> 0 AND HFlag = 1 Then Begin
TL3 = TL_New(SwingHD[2], SwingHT[2], SwingHP[2], SwingHD[1],
SwingHT[1], SwingHP[1]);
TL_SetExtRight(TL3, True);
TL_SetColor(TL3, ColorCur);
IF UpperStr(TLAlrt) = «TRUE» Then TL_SetAlert(TL3, 1);
HFlag = -1;
End;

Подписаться
Уведомить о
0 комментариев
Межтекстовые Отзывы
Посмотреть все комментарии