public int dir; // direction of current zigzag trend, 1=up, -1=down
public int lasthibar; // bar number of last swing high (bars ago = CurrentBar-lasthibar)
public int lastlobar; // bar number of last swing low
public double lasthi; // value of last swing high
if (hi[0] < hi[1]) dir = -1;
val1 =
ZigZagUTC(BarsArray[BarsInProgress],
0,zigSpan,useHiLo,Color.Transparent).dir;
Only adding a property :
[Browsable(false)]
[XmlIgnore()]
public int Dir1
{
// We need to call the Update() method to ensure our exposed variable is in up-to-date.
get { Update(); return dir ; }
}
val1 =
ZigZagUTC(BarsArray[BarsInProgress], 0,zigSpan,
useHiLo,Color.Transparent).Dir1;

Comment