We've been working on modernizing our aging, ugly P123 syntax reference. The first order of business was to see what we have, all in one shot. Below is a link for a single file pdf. It's still a work in progress. It took me all weekend to create code to generate this so that it's somewhat presentable. Some functions may be missing, and some are incomplete, with inconsistent styles that have been used through the years. But it's not a bad start. With the help of AI tools, the modernization of our reference suddenly does not seem so scary.
Of course, one of the motivation for this, was to generate data for our AI P123 Syntax Agent to ingest. It's doing surprisingly well with very little. Hopefully this will help it create more accurate answers. We hope to launch the agent very, very soon in the screener.
The next steps will be to also incorporate the new reference UI/UX on the site, as well as reviewing and rewriting lots of content. If this is the kind of work you love let me know.
This single-file approach is working very well so far.
Previously, I used several different files with strict rules, for example:
CRITICAL: DO NOT combine parts of factor names to create new ones (e.g., if SalesTTM and
SharesTTM exist, do not assume SalesPSTTM or SalesPerShareTTM exists unless it's explicitly listed as a factor_name).
Under that setup, Gemini usually hit about 99% syntax accuracy while creating relatively good, complex formulas. Claude, however, hovered around 80% accuracy and occasionally generated some pretty nonsensical formulas.
I decided to remove these strict rules ( with single-file approach), and now both Gemini and Claude have had so far 100% accuracy. It seems the new, consolidated file provides more interconnected examples, which gives the AI much better context to learn from.
So just to confirm what Pitmaster has said, I find Claude and Gemini useful. In fact, I am probably MUCH more dependent on Claude and Gemini for coding than many. Claude Cowork says this PDF will be helpful and the old Syntax.csv file from Google Sheets is helpful as well.
You probably now this already know this (and much more that I am not aware of), but if you think some insight into what Claude Cowork is doing with these files is helpful:
“Good — keeping both. Syntax.csv for programmatic scanning, p123reference-v2.html.pdf for detailed syntax lookup. They complement each other well for the feature discovery workflow.”
Also for the future, making it possible for some downloads from you new FactorMiner app into Claude of Gemini, with or without the API, might be useful for some of us.
If FactorMIner cannot do this yet, Claude Cowork can probably do it through the API. Generally, with appropriate downloads, apps can essentially be customized or become part of a chain of programs using Claude Cowork:
This may be helpful to know: Claude can read ZIP files (which is useful when you want to bypass the 31 MB limit).
Not directly related to this topic, but I found it interesting that Claude can run advanced statistical analyses to perform feature selection when you provide fundamental/market data along with a factors dictionary. I’m not sure how useful this is in practice, but it looks cool!
It seems like I shouldn’t have done my MSc in CS after all
I have regenerated the files again. If you click on the links again you will get a better version of the reference. Most of our keywords, functions, factors should be in the doc. There's are still sections repeated multiple times, so it's still not a good version for a human (who's going to read a 500+page reference anyway), but should be better for an LLM.
I just uploaded v1.0. Use the same link from the first post to download. Several more changes since the last upload this morning. This will be it for at least a week as we go though it in more detail. Let us know any issues you find.
Thanks.
PS. If you see this you are looking at the latest version.
Great job so far. Claude now is smarter
Another idea would be to include metadata about sectors taxonomy, how to create different types of ranking systems, simulations, etc. including conditional nodes. Currently I feed AI agents with bunch of RS examples.
Marco, can you or a P123 team member create a Claude Skill Repository on GitHub for the community contribute to a master P123 skill. I'm sure there a many users now that has a P123 skill setup in their Claude and keep editing them in their own vacuum with edge cases and such... we are all trying to reach the same goal, why not collaborate? Would make sense if a P123 team member would be admin for the Repository.