Index | Recent Threads | Who's Online | Search

Posts: 116    Pages: 12    Prev 1 2 3 4 5 6 7 8 9 10 Next
Last Post
This topic has been viewed 4830 times and has 115 replies
Jrinne
Re: Factor and data series importing

Jrinne, where did you get those tickers from? They are not valid today . Perhaps they are point in time tickers? I think the import only looks at the current ticker, which means you need to find the latest ticker (arexq for example) or find the ticker for dead ones (that uses the ^ notation).

We're thinking of several ways to support old tickers, like

- Allow you to choose "use point in time tickers"
- Support CUSIPs
- Support our own internal numeric id which never changes

Thanks

Marco,

Thank you!

I would appreciate support for old tickers if this is a reasonable priority.

It is a great feature that I would like to use to its fullest!!!!

In the meantime, I am glad to know the cause for this—so I can stop looking (naively) for date-format issues with Mac/Excel;-)

Do you know of a web site or reference for old -> new ticker names? I could conceivably work through the Excel spreadsheet alphabetically (changing the tickers) now that I know the cause.

Very much appreciated!!!!

-Jim

From time to time you will encounter Luddites, who are beyond redemption.
--de Prado, Marcos López on the topic of machine learning for financial applications

Dec 31, 2019 11:07:44 AM       
jmh
Re: Factor and data series importing

Do you know of a web site or reference for old -> new ticker names? I could conceivably work through the Excel spreadsheet alphabetically (changing the tickers) now that I know the cause.


I had to do that for a bunch of inlist() in the past.

I recommend using the P123 advanced stock search. In particular, use the company (old or new) name rather than the ticker is very helpful.
My experience is that it will get you 90-95% of what you need.
For the remaining tickers, I had to use google and try to read through the history of possibly matching companies

Good luck

Jerome

Dec 31, 2019 12:35:15 PM       
Jrinne
Re: Factor and data series importing

Thank you Jerome! -Jim

From time to time you will encounter Luddites, who are beyond redemption.
--de Prado, Marcos López on the topic of machine learning for financial applications

Dec 31, 2019 12:55:49 PM       
yuvaltaylor
Re: Factor and data series importing

The stock factor tool allows you to import outside data about tickers (both stock and ETF). You can use this, for example, to import an ETF’s historical holdings, .....

I have historic holdings of ETF USMV for longer than 5 years, taken every 3 months. How do I get this into a Stock Factor database, and how can this be used to run a simulation?

USMV holds over 200 positions. I have about 24 "inlists" of them, but not historic prices.


Create a CSV file with the date, the ticker, and the value "1"

Upload that as a stock factor. Call it $$USMV.

You can now use $$USMV in a screener. $$USMV = 1 will get you only stocks that were held in USMV on a particular date.

Yuval, my "inlists" of historic holdings are spaced 3 months apart. Does the CVS file have to repeat the same holdings list for each day in the 3-month segment?

If so then for daily data, 22 x 3-month periods, and 200 holdings:
Days in a 3-month period = 63
Number of 3-month periods = 22
Number of holdings = 200

Total Number of lines in the input CVS file for 5.5 years of historic data = 63 x 22 x 200 = 277,200. Does this not exceed the upload limitation which Chris found?

No, there's no need to repeat the data for each day. The data "sticks" until there's a new date for that ticker.

Yuval Taylor
Product Manager, Portfolio123
invest(igations)
Any opinions or recommendations in this message are not opinions or recommendations of Portfolio123 Securities LLC.

Dec 31, 2019 2:08:13 PM       
Jrinne
Re: Factor and data series importing

Thanks Yuval and P123 staff,

Everyone put a lot of work into this and great explanations Yuval. Let me understand if I can do what I want, please.

Suppose I would , somehow, select 25 stocks each week that I expect to be (on average) the best performers using whatever method. Maybe they come from a newsletter.

I load those stocks with a simple RankPos from the newsletter that ranks the stocks best to worse eg,

2013-08-05, AAPL, 1

2013-08-05, IBM, 2 ….

...2013-08-05, FB, 25 Using "lower values" in the rank

Next week (2013-08-12) I load 25 new stocks but AAPL, IBM and FB are not in the list of the 25 stocks expected to be best performers this week.

If I have a buy rule: RankPos <= 25, sell RankPos > 25 will AAPL, IBM and FB "stick?" Will the sim (or port) continue to hold AAPL, FB and IBM as well as the 25 new stocks that I loaded for that week?

Would I have to make NA (or 100) the stocks that are no longer present (as the top 25) the next week? Seems like I might have to upload the entire universe (with current factors) every week for this to work flawlessly.

Seems like I might need a satellite image for every stock in the universe to continue your example, Yuval. Or put NA for every stock that does not have a satellite image for that week in the universe—remembering which stocks had factors (satellite images) last week. Perhaps, workable as part of a weekly routine for a port. A lot of work for a spreadsheet to use in a sim. Not simple data wrangling for Python either (for me).

Not a problem if this is not a perfect solution for everyone. Just trying to make it work for me (if it can work).

Maybe consider a "no stick" option of some sort if I have this right (e.g., 1 defaults to NA next rebalance).

Thank you in advance.

-Jim

From time to time you will encounter Luddites, who are beyond redemption.
--de Prado, Marcos López on the topic of machine learning for financial applications

Dec 31, 2019 3:09:08 PM       
Edit 24 times, last edit by Jrinne at Dec 31, 2019 4:41:53 PM
geov
Re: Factor and data series importing

Thanks Yuval and P123 staff, this is a great addition to P123.

It was a pain in the neck to construct the CSV file from the historic data of USMV which I have downloaded every 3 months for a number of years now. Problem is that only currently recognized ticker symbols are accepted. This required a lot of editing to get rid of the errors. But in the end it worked well.

Below you can see the performance from 10/1/2012 to 12/31/2019 with all historic positions equal weight, which is virtually identical to benchmark USMV, showing an annualized return of 13.8%.

The second attachment is a screen with the (Greenblatt) highest ranked 25 stocks, rebalanced weekly. Annualized return is 19.2%. That is a huge improvement over the performance of USMV, and is similar to the performance of the live 12-position model which we publish weekly at iMarketSignals.

Also this proves conclusively what I proposed more than 5 years ago. Just "piggy-back" on a good ETF and select the highest ranked stocks from it. It is difficult to under-perform the ETF with this strategy.

Attachment USMV from 10-1-2012 to 12-31-2019 all holdings.png (242129 bytes) (Download count: 122)


Attachment USMV from 10-1-2012 to 12-31-2019 top 25.png (263239 bytes) (Download count: 117)


Jan 1, 2020 3:09:12 PM       
Edit 2 times, last edit by geov at Jan 1, 2020 3:12:48 PM
wwasilev
Re: Factor and data series importing

That's great work, Georg! I may have to try https://masterdatareports.com soon.

Jan 1, 2020 3:40:55 PM       
Chipper6
Re: Factor and data series importing

Georg, was that the only test you tried? What were the results for the other tests?

Jan 2, 2020 9:30:17 AM       
geov
Re: Factor and data series importing

I have only got the holdings from 10/1/2012 of USMV in the CSV input file for Stock Factor $$USMV.

First I ran the screen.
Second I ran a sim to verify the screen.

You can never underperform USMV, if there are at least 3 positions you hold in the sim.

Only one buy rule: $$USMV=1
Only one sell rule: rank<95 & NoDays>12
Universe is All Fundamentals
Ranking= Greenblatt
Slippage = variable
Reconst. and Rebal.= weekly
Max Position Drift= 10

Below are screenshots for 5 and 50 positions. Note the low turnover.

What else should I try?

Attachment USMV Top 5.png (181512 bytes) (Download count: 101)


Attachment USMV Top 100.png (174218 bytes) (Download count: 100)


Jan 2, 2020 12:30:48 PM       
Edit 3 times, last edit by geov at Jan 2, 2020 12:36:29 PM
InmanRoshi
Re: Factor and data series importing

I'm trying to wrap my head around data series. So for example, I could export the portfolio performance of a live P123 portfolio with just the daily dates and amount of the portfolio, and then import it into a time series and construct buy/sell timing rules based on 50 and 200 SMA trends of the portfolio? I do a lot of this on my own using excel, but it would be nice to be able to run P123 basktests with it.

Jan 2, 2020 12:50:26 PM       
Edit 2 times, last edit by InmanRoshi at Jan 2, 2020 12:56:29 PM
Posts: 116    Pages: 12    Prev 1 2 3 4 5 6 7 8 9 10 Next
 Last Post