Hi,
I have pricing data on a company's stock price in column C ordered with oldest pricing history at the top and newest at bottom.
In column F, I have trading signals based on the prices in Column C, 1 denotes a buy and -1 denote a sell.
I need to work out the profit/loss I would make buying and selling 200 shares/units based on the corresponding buy and sell prices in column C.
I would buy every time a cell in column F generates a 1 and continue to hold the stock until a cell column F generates the next -1. And then I would buy agian on on the next occurrence of 1 in coloum F and sell on the next occurrence of -1.
So for example,
The first 1 occurs in F8, so I would to buy at the corresponding price in c8, all subsequent cells continue to have 1 until F13 (i.e. F8 to F12 all have 1 (buy signals in them so I hold the stock), a -1 appears in F13, I want to sell at the corresponding price in C13. Then I want to buy at the nest buy signal F15 and sell at the next occurring -1 (F16).
My pricing data runs from D8: D2948, I want to calculate the returns from all these separate trades and sum the results in say G2 so I can work out what that trading strategy over the entire period would yield in terms of loss or profit.
I know how I could do this for any given single trade but know all trades. I'm assuming it's likely I need some kind of continous formula in say column G to work out profit/loss for each trade and then I could simply sum that range in G2 but I'm juist guessing.
Hope someone can help!
Thanks,
Elvis
I have pricing data on a company's stock price in column C ordered with oldest pricing history at the top and newest at bottom.
In column F, I have trading signals based on the prices in Column C, 1 denotes a buy and -1 denote a sell.
I need to work out the profit/loss I would make buying and selling 200 shares/units based on the corresponding buy and sell prices in column C.
I would buy every time a cell in column F generates a 1 and continue to hold the stock until a cell column F generates the next -1. And then I would buy agian on on the next occurrence of 1 in coloum F and sell on the next occurrence of -1.
So for example,
The first 1 occurs in F8, so I would to buy at the corresponding price in c8, all subsequent cells continue to have 1 until F13 (i.e. F8 to F12 all have 1 (buy signals in them so I hold the stock), a -1 appears in F13, I want to sell at the corresponding price in C13. Then I want to buy at the nest buy signal F15 and sell at the next occurring -1 (F16).
My pricing data runs from D8: D2948, I want to calculate the returns from all these separate trades and sum the results in say G2 so I can work out what that trading strategy over the entire period would yield in terms of loss or profit.
I know how I could do this for any given single trade but know all trades. I'm assuming it's likely I need some kind of continous formula in say column G to work out profit/loss for each trade and then I could simply sum that range in G2 but I'm juist guessing.
Hope someone can help!
Thanks,
Elvis