Hi Experts,

I just need to know is there any better way to accomplish Zig -Zag points. as in attached I have macro which populate points by based on formula in H2 & I2.

my logic behind this is - if price retraced or expand 38.20% from one point to other point range. then register new point.

want to create formula which include 3 criteria.

1 if price move either side 38.20% from one point to other point range then register new point.

2.there is minimum 4 data point distance between two points.

3.there is minimum 3% price change from one point to other point.

or total new logic which is I am not aware off.

Basically I want ZigZag point from data set of Open High Low Close.

Thanks

<<Excel TA added--byundt, Microsoft Excel Topic Advisor>>

Math-G-V04.xlsm
Anyway, let's say you have two points on the graph x1,y1 and x2,y2. You want is to know if the angle is above some certain value.

The slope of the line is (y2-y1)/(x2-x1). If the slope is a high positive number, it's a high upward angle (price is rising quickly). If the slope is a large negative number, the price is dropping quickly.

That formula will always give you the exact slope of the line between the two points. So if you want the angle to be above a certain amount for a zig or a zag, you can use that.

The best part is that you don't need any trig functions. If you wanted an actual angle then take the inverse tangent of the slope, but a higher slope will be a higher angle, so you don't need it.

Of course you want to use the absolute value of the slope abs((y2-y1)/(x2-x1)) when deciding if the slope is steep enough.