glgene 616 posts msg #159923 - Ignore glgene |
12/25/2022 5:29:52 PM
Ed S. (Nibor100) -- You reported in a previous post (under 'Bouncy Ball Scan') that StockFetcher uses only one (1) calculation number for Beta (36 months).
I would like to calculate a Risk-adjusted Beta $%Return.
Question: If SF's Beta period covers exactly 36 months (3 years), but the maximum ROC period allowed by SF is 24 months (2 years), how would one calculate an "apples-to-apples, same-period" Risk-adjusted %Return?"
Below is my attempt with an SF script to accomplish the project...but as you can see, I'm using a 3-year Beta with a 2-year ROC. Houston, we have a problem! Any way, the sort is the final column (a higher score would be better, I think).
Any suggestions to solve my scripting concern? Thanks in advance.
|
nibor100 1,051 posts msg #159924 - Ignore nibor100 |
12/26/2022 12:52:39 PM
Hey Gene,
Try this rough version and note the SF anomaly in the custom roc calc
Ed S.
|
glgene 616 posts msg #159925 - Ignore glgene |
12/26/2022 11:04:45 PM
Ed,
I didn’t know SF had 3+ years of price data. I thought the limitation was 2 years. Once again you came thru with a scripting solution … this time, to my “Beta-adjusted ROC” project (matching 3 years of price to 3 years of Beta calculation. (Apples-to-Apples.)
I’ll merge your 3 years of price data solution into my final script … and post it here for your (and others) 2nd review and constructive comment. I have already added 3 or 4 other columns of useful info.
Gene in FL
|
glgene 616 posts msg #159950 - Ignore glgene |
1/2/2023 12:31:20 PM
Ed S (Nibor) --- SOS! When I run your additional lines added to my original script, I can't match the sales price 3 years ago. Your heading (3 yrs. ago price) references "741." We spoke about that briefly, but I still can't tie it to any matching price (around 3 years ago).
I tried it with a dividend-paying stock and a non-dividend-paying stock. Still couldn't match 3 yrs. ago price.
I don't know what else to do. Any suggestions?
Gene in FL
|
SAFeTRADE 646 posts msg #159951 - Ignore SAFeTRADE |
1/3/2023 9:04:53 AM
stockfetcher only has 2 years of data.
|
nibor100 1,051 posts msg #159952 - Ignore nibor100 |
1/3/2023 10:06:30 AM
@Safetrade,
SF has lots of years of data if you know the odd techniques of getting to it.
a. Xarlor has been able to get all time stock highs more than 10 years ago on SF.
b. If you drag any Sf 2 year chart in a browser window to the right you will see an additional year of chart data to the left. But to go beyond 3 years in history there are only a few ways to get to that older data.
Ed S.
|
nibor100 1,051 posts msg #159953 - Ignore nibor100 |
1/3/2023 10:13:42 AM
@glgene,
Unfortunately, SF data sometimes has data errors, which seems to be the case for MRK. but if you check Apple you'll find exact matches for 1 year back, 2 years back, and 3 years back running my script. Remember the math, 1 year = 252, in SF its more like 247, 2 yrs 504 in SF 494, 3 yrs 756 in SF 741, starting at this point in time. I don't know why SF eliminates some extra trading days in the year.
Also, since it less days in a trading year the values will be later in January the further back in time you look.
Hope this helps,
Ed S.
|
fotchstecker 304 posts msg #159957 - Ignore fotchstecker |
1/4/2023 11:28:48 AM
"Unfortunately, SF data sometimes has data errors"
To start. These data have survivor bias issues, too.
The lack of real backtesting with scrubbed historical data make SF a pretty big guessing game. Good for validating certain kinds of ideas. Can't really properly size positions, or even construct a portfolio size, without being able to get even the most basic stats.
|