I provide this content from P123 syntax: Entire Portfolio123 Syntax in ONE FILE + more examples + my prompt.
This would be unsupervised way of writing formulas.
You can also provide historical data so Claude can perform backtest internally, and then decide which formulas are the best and provide weights, etc..