Enter a symbol:
For Toronto: TSX:TD

You are here :  Home > Forum
April 17, 2024, 09:22:27 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Please, write to us so we can activate your new account!
   Home   Help Search Login Register  
Pages: [1]   Go Down
Author Topic: Weighting the stocks to sell  (Read 20119 times)
Hero Member

Karma: 2
Posts: 410

« on: February 23, 2015, 03:07:38 AM »

Hi dear SSPs,

After so many years, I come to you with the last dark point in my understanding of your re balancing strategy.

As you know, years ago, I had made a spreadsheet (as a matter of fact 5, for Portfolio UPM v1 to v5), applying your allocation strategy.
Even if I have used it more or less all those years, I keep updating the data every evening.
And every evening (almost), my theoretical results match yours exactly, so I really thing that I have well implanted the formulas.
The exceptions are Monday, (and sometimes Tuesday), if there were stocks to sell.

I have tried to re-read so many posts, but I couldn't find the answer:

If a stock is to be sold, what weight does it have in the total weight before Monday's open?
Does it keep it performance weighting?

I now refer in particular to your post in reply to Victor (I miss all them when this forum was so active, but I guess life goes on).

(Reply # 6, Dec 2 2007)

In principle:
a) we are fully invested,
b) we re balance only when there are new orders.

This implies that all buy and sell transactions will be made the same day, and then nothing will be changed until the next orders will come in.

So let us assume we are Sunday Feb. 22, we prepare our next day transactions for Portfolio UPMv1.
Even if your performance will be calculated with the Monday's closing prices, in practice, the idea is that we will sell and buy during the market hours.

2 stocks to buy: no problem: weight is 1

Now what about 2 stocks to sell:
If CXR was not to be sold, its weight would be 1.0396.
If RIC was not to be sold, its weight would be 1.2118

For sure, I can't sell more then I own, but if apply to them the weighting formula, these 2 stocks receive a weighting that could (should?) have been added to the stocks that are already own but will be readjusted.
(Not talking of the new ones that each receive a weighting of 1)

My  spreadsheets used to keep the stocks weighting value.
But, logically those stocks weights should be zero.
Is this what your program does? Or do these stocks keep their full weights in the calculation if the total weight?

This week-end, I have done many tries.
My goal was to find weight values so that, assuming that all transaction were made at Friday's close, I'd come to a acceptably close match to the total value of my portfolio as on Friday night.

And I get this only by giving the stocks to sell a weight of zero.
So my new (pseudo) code is:

IF stock(x).order = "SELL" then
stock(x).weight = 0,
IF stock(x).order = "BUY" then
stock(x).weight = 1
stock(x).weight  = 1 + stock(1).performance

For sure I am talking pure theory, I'll never change....

Thanks again,

Hero Member

Karma: 2
Posts: 410

« Reply #1 on: February 24, 2015, 05:27:08 AM »

Hi again,

I really wish that you will be able to reply to the questions I asked in my previous post.

This is the follow up, from Sunday(or Friday) to Monday Feb 23.
Today, I had 2 calculations systems for todays's results, after the sale of CXR and RIC and the buy of the new stocks: CXI and CRH.
The first one gave me exactly the same performance as yours: +2.4%
(Sure you could tell me that if it gave the exact same performance, then those were the right calculations, except that I assumed that CSR and RIC would be sold at the closing price of FRIDAY)
Because CSR went up about as much as RIC went down, my portfolio could approximately be OK, but if both had gone down by 3%, my portfolio would be in the red!

On the other hand, my new system gave me a performance MUCH lower then your: -0.18%, so it was clearly wrong.

Tonight (Monday), I have tried a few other ways to calculate, but I still never come to the performance that you show.

I really wish that you could give me a practical example, based on a value of a real portfolio that gold have had a balance of let's say $50000.00 on Friday.
1. How many shares of each of the old stocks would I have had?
2. How many of the other stocks (new buys and adjusted holds), should I have bought or sold.

All this assuming that at the end of the day (Monday), I would still be fully invested, which would mean no reallocation on Tuesday.

I accept the restriction, that is not very realist, that all transactions would have been done at the closing price.
How and when do you spread the product of the sales between the other stocks?

Super Stock Picker
Hero Member

Karma: 1
Posts: 476

« Reply #2 on: February 24, 2015, 12:37:18 PM »

Hello Louise,

You can check the thread about the Virtual $50,000 portfolio to see an example of sells and buys the same day. See the second post for the detailed calculations:

I think your difference is in the timing of those sells and buys.

Here is what happens:
- we do our calculation on Fridays, using close prices, but only to determine what we keep, what we WILL sell and what we WILL buy (on Monday).
- The portfolios are untouched for the next day (I think that the day when you have different results than us) and all transactions take place at the close of this session, using the close price
- Monday evening, the portfolios content is updated. New stocks are in with a 0% performance (bought at the close price) and of course a weight of 1.

I summarize the timing:
- we generate the new orders based on Friday's close prices
- we buy and sell at Monday's session close

Practically, you would sell the stocks first during Monday's session and buy new shares accordingly based on market prices. If you can do this process very close from the end of the session, you will get prices (and performances) very close from what we show on the site.

And of course, you can also get better prices during the session than what we get at the close...
Pages: [1]   Go Up
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Copyright ©2004-2023 Agnosoft