- Joined
- 20 May 2008
- Posts
- 1,158
- Reactions
- 8
Hi Excel gurus,
I'm not even sure how to do this at all, let alone trying to get Excel to do it for me...
Calculating my portfolio open equity profit/loss, MaxDD, etc. is simple enough. But what is the best way to calculate these figures when I've added extra capital along the way?
I'm not very good at explaining this, so I will try to illustrate with an example:
Let's say I start with $20K and after 12 months I'm up 20% (but after 10 months I was up 30%, so 20% is not my equity high). Then I add an extra $10K to my account. I now have $34K (20K+20%)+$10K. Then 6 months later (18 month mark) I am down to $26K. My first thought is that my drawdown would be 23.5% ($27K/34K).
But this doesn't seem accurate to me as it does not reflect that $34K is only my equity high due to me adding extra capital. It also doesn't take into consideration that that before I added the extra $10K, my profit had already fallen from 30% (10 month mark) to 20% (12 month mark).
What is the best way to:
1. Calculate my drawdown in the example above
2. Continue to calculate my open equity % +/- when I add extra capital along the way (eg. adding extra capital every 12 months or so)
3. What formula/s can I use to do this in Excel?
The best way to account for additions or subtractions to your portfolio is by treating yourself like a mutual fund and calculating your time weighted internal rate of return (TWIRR). Although it is a mouthful it is not very complicated once you get the hang of it. Motley Fool wrote an article explaining how to configure it in excel much better than I could: see http://www.fool.co.uk/stockideas/2005/si050720.htm. Not too sure how to adapt to your specific request of drawdown however...
Motley Fool wrote an article explaining how to configure it in excel much better than I could: see http://www.fool.co.uk/stockideas/2005/si050720.htm. Not too sure how to adapt to your specific request of drawdown however...
I'd like some help with excel please.
How do I create a cell with a function that does the following:
If A1>10 and B1<5 and c1>20, then make the cell (D1) read "BUY"?
Some sort of nested If function?
Pixel, you there/??
I'd like some help with excel please.
How do I create a cell with a function that does the following:
If A1>10 and B1<5 and c1>20, then make the cell (D1) read "BUY"?
Some sort of nested If function?
Pixel, you there/??
I'd like some help with excel please.
How do I create a cell with a function that does the following:
If A1>10 and B1<5 and c1>20, then make the cell (D1) read "BUY"?
Some sort of nested If function?
Pixel, you there/??
I would think a nested IF is the way to go. I use Apple's iNumbers instead of Excel, but I think the IF syntax is the same in both.
Basically IF(test, true, false) where true and false represents the actions to be taken if test is true or false respectively.
So you could build up your nested IF in 3 stages. First start with the last test and put the following IF in cell D1....
IF(C1>20,"BUY"," ")
this puts the text BUY in D1 if C1>20, otherwise it puts a blank there.
Then nest that IF within another IF using the middle test, where it is the true action and again a blank as the false action.
IF(B1<5, IF(C1>20,"BUY"," "), " ")
So both tests have to be true for "BUY" to be placed in D1, otherwise blank.
Finally nest this IF within another IF that uses the first test, again it being the action to take if true and blank if false.
=IF(A1>10, IF(B1<5, IF(C1>20,"BUY"," "), " "), " ")
You don't have to build D1 up this way, but it helps to structure it properly in your mind.
I have tested this in iNumbers and it works, so it should probably work the same in Excel.
You could just do
IF(AND(A1>10,B1<5,C1>20),D1="BUY",D1="DON'T BUY")
It's a bit neater.
Depending on your Excel version, you can find all functions by simply clicking on the fx symbol at the head of the formula bar.Yes that's neater. AND is a function I wasn't familiar with. Thanks. In iNumbers, I must leave out the two "D1=" to get it to work. I must put the formula in cell D1 though.
IF(AND(A1>10,B1<5,C1>20),"BUY","DON'T BUY")
That will be tricky, if you want to run that Excel macro continuously.This is great! Thanks everyone for the help.
Anyone know how I would go about using a macro to identify any instance of 'BUY' in column D and copy/paste that into notepad? I would like the macro to run continuously so that by end of day my notepad has a list of all stocks that appeared as buys during the day. Could be tricky?
This is great! Thanks everyone for the help.
Anyone know how I would go about using a macro to identify any instance of 'BUY' in column D and copy/paste that into notepad? I would like the macro to run continuously so that by end of day my notepad has a list of all stocks that appeared as buys during the day. Could be tricky?
Hi McLovin. Feed is from WebIRESS and I have no VBA knowledge. It doesn't have to go to notepad, it's just that if I can get it to notepad, then I know how to use another macro to get it from there to my broker (see paragraph above). I've found a function called VLOOKUP which is sort of the right thing except it only finds one instance of the BUY signal, and then only gives one column result, instead of three. It's possible I'm creating difficulties for myself.
I'm very pleased you can have a shot at this McLovin.
'BUY' has just been worked out to be true when certain columns meet certain requirements. That part of it is fine.
BHP, BUY, 35.24, -.58, -1.6, 1000,...
ANZ, NOACTION, 20.45, -.29, -1.4, 1000...
WOR, BUY, 26.28, -.14, -.5, 1000...
Then with the copied data, automatically form fill it to my broker's order page and click submit. I can PM you my user name and password if you get to this stage. There's no money in this particular account.
Thanks for your offer.
Is column "B" present in the raw data or is it added (I'm assuming it is added per the previous posts). If it is added does it need to be there?
Unless you want to pay for my solicitor to draft a disclaimer then I won't be doing anything that involves orders. And anything I do give you should not be used to trade on etc etc...
I'm more interested in showing you how to use VBA than anything else. And I'm certainly not trying to build a trading program/system (or any components) for you.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?