How to find out points of intersection between two lines?
On a stock chart I have two MA1 and MA2(mean average). I need to find out points of intersection and directions of intersection (top to bottom and bottom to top). Would you please explain the code, if I am using numpy arrays and matplotlib, to draw the lines on the chart.
Thank you.
You must be logged in to post. Please login or register an account.
Generally you seek out periods where a change has occured in the > or < status. If ma1 > ma2.... then on the first time it is no longer the case, you have crossover. Modify some sort of variable each time, so you're tracking that currently the crossovers are greater...then check every time. If different from the global value, crossover occurred, and you modify the global to the new value and repeat.
-Harrison 9 years ago
You must be logged in to post. Please login or register an account.