I am trying to develop some algorithm in stock market, I want to compare two different sets of prices, please see below image to understand clearly,
If you see above image I have plotted two different sets of prices purple and black, Purple line is set of prices of example $2000, 2003, 2001, 2005$ .. etc, the black line is set of prices of example $12, 12.3, 12.1, 12.5$ etc ...
prices like 2000 are future price and $12, 12.3$ etc is option price, Option price move same like future price. Now If you see chart irrespective of difference between two numbers, prices are plotted in chart in same direction with few difference, see bigger image below
Now my question is how do I find if the purple line is above the black line or below the black line via maths? I can see it visually in chart, but how do I convert those into numbers. I am completely new to this math forum, so please ask any doubt in comments.
P.s : Real time usage of this algorithm is to find overbrought or oversold options and buy/sell option respectively.