Solved

Math Cross Check

Posted on 2014-03-25
8
415 Views
Last Modified: 2014-03-28
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.ZigZag Points
Thanks


<<Excel TA added--byundt, Microsoft Excel Topic Advisor>>
Math-G-V04.xlsm
0
Comment
Question by:itjockey
  • 5
  • 3
8 Comments
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 39953452
In order to suggest a "better way to accomplish Zig -Zag points" we would need to know how "better" is defined here.

What is the goal in making the zigzag points? Your algorithm appears to be working and is tunable.

One other approach would be to find the max and min and then find the local maxes and mins between those points (such that the new max point is nearer to the original min point than the new min) and just keep doing that until it stops finding points (with some threshold for min distance between points).
0
 
LVL 8

Author Comment

by:itjockey
ID: 39953553
As I run macro I see there is not matching criteria 2 in some cases. I.e. there is minimum 4 data point distance between two points.

Better way - including criteria angle of each point. So it removes side way data prices. So if angle is above x degree then ignore that point.

Do you understand what i am talking as this is may be very new to you. It is financial market language.

Pls reply and suggest - m i hunting on right direction?

Thank You
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 39954559
The "angle" could easily be computed using rise/run. i.e the change in y divided by the change in x. Just pick a value for the threshold and you should be good.
0
 
LVL 8

Author Comment

by:itjockey
ID: 39955144
may I have sample of your thought ?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 37

Accepted Solution

by:
TommySzalapski earned 500 total points
ID: 39956079
y axis is price and x axis is, what, business days? hours?
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.
0
 
LVL 8

Author Comment

by:itjockey
ID: 39959657
Mr.TommySzalapski,


Sorry for delay actually i am taking much time than usually. give me one more day. little busy on socials. generally i dont keep open question more than a one day.


Thanks
0
 
LVL 8

Author Comment

by:itjockey
ID: 39960967
Ok need to workout on your recent post, if I will need any help -  shoot new question. As of closing this question.

Thanks You Very Much Your Comment It Is Very Useful.
0
 
LVL 8

Author Closing Comment

by:itjockey
ID: 39960969
Awesome
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Moving Excel to AaaS 4 36
time format showing wrong 12 50
Merging-Splitting-Multiple-Rows 33 42
Dynamic Filter ? 4 12
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article seeks to propel the full implementation of geothermal power plants in Mexico as a renewable energy source.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now