Ok this is a bit difficult to explain so please forgive the long-winded explanation…
I am constructing a spreadsheet that gives buy and sell signals for stock exchange data, depending on the way a stock price is trending. Each row in the sheet represents the data for a given date, in chronological order; the row for each date contains price data and other calculations.
I have used logic functions to generate “buy” and “sell” signal – there is a column for “buy” and a column for “sell”, and the excel function gives a TRUE or FALSE output in these cells based on the trends. TRUE in the “buy” column for a given date means buy the stock, TRUE in the “sell” column means sell the stock, and FALSE on both columns means do neither. Typically, a “buy” signal will be followed by several days in which nothing happens – these are “in” days, where a stock is held, and then a “sell” signal will be generated, which will be followed by several “out” days, where no stock is held.
What I now want to do is to have columns for “in” and “out”, and to use some kind of logic function to generate these. So when a “buy” signal is generated, the “in” column returns a TRUE, and subsequent days also return TRUE until a “sell” signal is generated, at which time the “out” column will become TRUE and the “in” becomes FALSE.
Not really sure if this makes sense to anyone – does anyone have any ideas how to do this?
Bookmarks