Формула ZIGZAG

  • Автор темы NRV
  • Дата начала

NRV

New member
Ребят никто не задавался вопросом почему ZIGZAG такой редкий индикатор? Да я знаю он перерисовывается и т.д. ну может его просто не правильно готовят?
Есть ли у кого формула данного индикатора? или с разу же под эксель макрос? был бы очень благодарен...
 

Француз

New member
Держите формулу на EasyLanguage

{***********************************************************************
Description : This Indicator plots ZigZag Percent
Provided By : Omega Research, Inc. (c) Copyright 1999
************************************************************************}

Inputs: WavePcnt(5), Color(Yellow), Thicknes(1);
Variables: SH(0), SL(0), RP(0), RPDate(0), RPTime(0), ZigZag(0), Switch(0), NextZig(0);

IF CurrentBar = 1 Then Begin
RP = MedianPrice;
RPDate = Date;
RPTime = Time;
NextZig = Text_New(Date, Time, 0, NumToStr(WavePcnt, 0)+"%-");
Text_SetColor(NextZig, Color);
End;

SH = SwingHigh(1, High, 1, 2);
SL = SwingLow(1, Low, 1, 2);

IF SH <> -1 Then Begin
IF Switch <> -1 AND SH >= RP * (1+(WavePcnt*.01)) Then Begin
Condition1 = True;
Switch = -1;
Condition2 = True;
End;
IF Condition1 = False AND Switch = -1 AND SH >= RP Then Begin
TL_SetEnd(ZigZag, Date[1], Time[1], SH);
Condition2 = True;
End;
IF Condition2 Then Begin
Condition2 = False;
RP = SH;
RPDate = Date[1];
RPTime = Time[1];
End;
End;

IF SL <> -1 Then Begin
IF Switch <> 1 AND SL <= RP - (RP*(WavePcnt*.01)) Then Begin
Condition1 = True;
Switch = 1;
Condition2 = True;
End;
IF Condition1 = False AND Switch = 1 AND SL <= RP Then Begin
TL_SetEnd(ZigZag, Date[1], Time[1], SL);
Condition2 = True;
End;
IF Condition2 Then Begin
Condition2 = False;
RP = SL;
RPDate = Date[1];
RPTime = Time[1];
End;
End;

IF Condition1 Then Begin
Condition1 = False;
ZigZag = TL_New(RPDate, RPTime, RP, RPDate[1], RPTime[1], RP[1]);
TL_SetSize(ZigZag, Thicknes);
TL_SetColor(ZigZag, Color);
TL_SetExtRight(ZigZag, False);
TL_SetExtLeft(ZigZag, False);
IF False Then Plot1[1](RP, "RP");
End;

IF Switch = 1 Then Begin
Text_SetLocation(NextZig, Date, Time, RP * (1+(WavePcnt*.01)));
Text_SetStyle(NextZig, 1, 2);
End;
IF Switch = -1 Then Begin
Text_SetLocation(NextZig, Date, Time, RP - (RP*(WavePcnt*.01)));
Text_SetStyle(NextZig, 1, 2);
End;
 
Your email address will not be publicly visible. We will only use it to contact you to confirm your post.
Сверху