How to do this

#1
I was wondering if any coding wizards can help me do the following.
I want to take the price of a stock and divide it by the closing price of s&p and plot it on a chart. can some one help please
 
#2
Hey adheer you are awsome thanks for the formula. I havnt been to the site for a few days so just saw it. I have 2 questions about the formula
1. Is there a way to use it in an exploration so we get a column with how each stock in awatch list has done compared to gspc as a percentage.

2. I was looking at pattern explorer and in some of their formulas you can go to parameters and change settings. Is there a way to modify this code so you can just go to parameters and change symbol from gspc to some other stock. thanks