[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ZigZag color can't be changed



PureBytes Links

Trading Reference Links


The following Zig-Zag percentage change indicator was posted on this list a 
few days ago.  The trend line plots fine except that no matter what I do to 
"properties", The trend line insists on being red and thick.  I even tried 
TL_SetColor() function to change color but no deal.  How do I set color and 
line property?

Also, note that the plot command is preceded by "IF FALSE THEN".  If what is 
false?  It must not be CONDITION1 because it is always false.  
TL_SetExtLeft() is the statement right above this, so is a returned value 
from it being evaluated?

Inputs: Strength(1), WavePcnt(5);
Vars: SH(0), SL(0), SHB(0), SLB(0), RP(0), RPDate(0),
      RPTime(0), ZigZag(0), Switch(0);

IF CurrentBar = 1 Then Begin
  RP = MedianPrice;
  RPDate = Date;
  RPTime = Time;
End;

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

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

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

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