Trading System - Ideas Generation

Hi all,

I am new to P123 and would like to understand from other members how you come up with Portfolio rules and ranking systems?
Not the exact rules of the trading system, but the methodology that was followed to put together and generate such system: have you tried to implement a strategy found on a book? or you implemented a strategy based on your own beliefs and tests? or…?

I think anyone could learn a a thing or two from other people’s way of thinking :smiley:

Thank you all!

Matteo

Hi and welcome!

Your best bet would be to look into the strategy class that Marc Gerstein put up for members and follow the course step by step: Support >>Courses.

Also reading old threads here in the forum will get you a good understanding of how P123 works and how to handle it.

Werner

In addition to the available P123 ranking systems and portfolios, if you click on the magnifying glass next to the search box in the right corner, you can access all the public ranking systems, ports, etc. If you want copy some of those for your own experimentation, feel free to do so.

The tutorials and courses here are excellent. The forum is a wealth of knowledge. One of the best things I did is read it from the beginning, looking for how people solved various issues.

Generally I take all my strategy inputs from a combination of books I find credible and academic research. I’d suggest a brush-up on your statistics coursework prior to engaging with any of the academic research as it certainly isn’t “user friendly”.

As with many people who engage in this kind of activity, one of my early reads was “What Works On Wall Street” by O’Shaughnessy. A little light on theory and academic rigor, but it’s an easy read. Other books I’ve found helpful are Quantitative Value by the Alpha Architect team, Expected Returns by Antti Ilmanen, and both Benjamin Graham books (Intelligent Investor and Security Analysis).

Good books to read (P123 should make this page easier to find):

https://www.portfolio123.com/doc/side_help_item.jsp?id=61

The book I found most helpful was Excess Returns by Frederik Vanhaverbeke.

In late 2015, when I first started using P123, I decided that I wanted to evaluate all the stocks I bought from a lot of different angles (factors). So I made a long list of ranking/screening factors that I thought might make a difference to a company’s performance, then tested them individually using the performance tab in the ranking systems. I then concentrated on those factors that showed the steepest curves. Sometimes I would be surprised to find a bell curve when I expected an upward or downward slope, and in those cases I would reformulate my factor to rank middling values the highest. My next step was to use the rolling backtest feature on screens. Only then did it occur to me that some factors with not-very-steep curves could, when combined with other factors, make a huge difference in backtested returns. So that’s how I arrived at the basis for my strategy. Since late 2015, all I’ve done is refine it. My ranking systems now get much higher backtested CAGR that my initial systems got, but they’re still roughly based on the same ideas.

And of course, Marc’s course was extremely helpful, especially the lessons on earnings quality.

1 Like

I second (third? fourth?) the comments above. Look at some of the public ranking systems. They’re really good examples and cover an array of quant approaches and are fully usable straight off the shelf. Alphaarchitect blog is great for exposure to ideas from academia (as well as Wes’s books). I’d put Patrick O’Shaugnessy’s podcast on for listening also as I pick up good ideas there. Meb Faber also has some good interviews. Google Talks also has some really good investors explain their process. Masters of Business podcast also has some relevant interviews if I recall. I think it’s also good to listen to and study technical traders also, to get a feel for ideas in that space and how those type of systems function.

From a design standpoint - factor effectiveness can work differently depending upon the size and liquidity of the company. Alot of the factor research you hear discussed is large investors looking at big, liquid companies, so you might want to make sure to run different tests on larger vs. smaller companies to see how advantages may differ. Setting up different universes for that makes sense to me for your studies.

One suggestion from a pure process standpoint: When running studies in the ranker, there’s a little row of numbers at the bottom of the return histogram that I use and copy into excel for comparisons between factors. I’ve found this very helpful in looking at distributional tendencies across many factors and time periods and company sizes. I don’t know if others do this, but while copying/pasting that little row gives me arthritis, I find it valuable in developing big picture view of the “shape” of the data. :wink:

best wishes,

You can download those numbers (with more accuracy, and less arthritis). Just press the arrow button to the right of “Historical Performance by Ranks.”

Thanks everyone for the inputs :slight_smile:

Does anyone else read other forums for ideas? Like Quantopian? https://www.quantopian.com/posts/replicating-private-equity-returns-with-leveraged-small-value-stocks

Any other similar forums that people still share ideas on?

Yuval, how can you tell a rank node to rank the middle numbers on the bell curve as the highest?

Absolute value of z-score should do it. That or Abs(50-FRank(“thingyouactuallywant”))

Agree. Lower is better if you use it in the Rank or do I have it backwards? Or even: -1 * ABS(Z-sccore); Higher is better?

I think this is a good solution. Remember that with z-score you have to address trim etc. The default may not give you exactly what you want. But a good solution, especially if you know what the default is doing and would be willing to change the default.

-Jim

I actually figure out what the middle number is–let’s call it X.XX–and then use Abs(Factor - X.XX), with lowest numbers ranked highest. Sometimes I use Abs(FRank(“Factor,”#all,#desc) - 50) (or - 60 or - 40–whatever). I didn’t know about z-score until now, so I might use that in the future. Abs(ZScore) will give the highest rank to the mean, Abs(FRank - 50) to the median.

There is mean, median and mode. In school I never found a use for Mode: except for the test maybe.

Bayesian Statistics uses it a lot however—and for good reason. It is the point of greatest probability (or “credibility”) for a skewed probability density function (or credibility distribution).

So, with similar reasoning, if a rank performance increase up until a rank of 90 and then decreased thereafter I would use Abs(Frank(“Factor”) - 90) lower is better. 90 being the mode or point of greatest return for the rank performance test.

This has you selecting the rank corresponding to the best performance: historically anyway.

Finally a definite answer to which is better Median or Mean? Answer: neither in this case. Mode wins for once.

-Jim

My best performing stock model out-of-sample, designed in 2012 and revised a couple of times, was inspired from an old article or white paper by Zacks. I don’t have the original any more and it has certainly been lost in the cyberspace since then.