Megamannen
New Member
- Joined
- Oct 23, 2013
- Messages
- 7
Hi I’m an excel newbie. I have Mac excel 2010.
I’m trying to perform trading backtesting and calculate long and short positions.
In column A I have Google stock closing price
In column B I have “BUY” or no information at all
In column C I have “SELL” or no information at all
In D2 I have a sum of 10 000 dollars. Let’s say there is a BUY in B3 and a blank in C3. In this case I would perform this calculation =IF(B3=”BUY”,C3=””),(A4/A3)*D2,D2). If there was a blank in column B3 and a SELL in C3, I would perform this calculation =IF(B3=””,C3=”SELL”),(A3/A4)*D2,D2).
But here is my problem: Sometimes a BUY and a SELL collides on the same row level. And sometimes neither a BUY or a SELL appears.
Is there a neat way to solve this?
I’m trying to perform trading backtesting and calculate long and short positions.
In column A I have Google stock closing price
In column B I have “BUY” or no information at all
In column C I have “SELL” or no information at all
In D2 I have a sum of 10 000 dollars. Let’s say there is a BUY in B3 and a blank in C3. In this case I would perform this calculation =IF(B3=”BUY”,C3=””),(A4/A3)*D2,D2). If there was a blank in column B3 and a SELL in C3, I would perform this calculation =IF(B3=””,C3=”SELL”),(A3/A4)*D2,D2).
But here is my problem: Sometimes a BUY and a SELL collides on the same row level. And sometimes neither a BUY or a SELL appears.
Is there a neat way to solve this?