Running simulations in API

Is there a possibility that the API will be able to run simulations in the future?

Thanks
Tony

1 Like

It would be really helpful to have this

1 Like

Yes, having this functionality would be great!

1 Like

It’s a big project!

There are a many ways to run sim permutations. You can change the period, the universe rules, the ranking system, the buy/sell rules, tons of settings.

Then there are tons of outputs: time series, stats, transactions, etc

What’s the minimum useful initial version? Tell us your use cases.

For an initial version, I would say:

Inputs:
RankingSystem XML
Number of Positions
Buy/Sell Rules
SimulationID (to get all the remaining settings)

Output:
Stats in Risk Measurements
Performance/Excess per Year

Among many things, I would use that to automate robustness tests.

1 Like

I would second that. I think that would be a good start.

This feature would save me an enormous amount of time, @azouz110 input/output matches what I need.

Have you tried using the Optimizer for this? I use it all the time for testing robustness of parameter values, doing parameter scans, varying ranking systems for a strategy, etc. Works great.

That said, the optimizer does not yet work with formula weighted portfolios or with books, both of which would be very much welcomed.

When I first started using P123, I used the optimizer all the time. Strangely I could not find much info about it and none of the old timers used it much. I could not understand why it was shunned. More importantly I don’t think it is accessible via the API.

It’s not accessible via the API, but for the basic use cases presented, the optimizer may be more than sufficient. Set up the combinations of parameter values you want to test in the optimizer, click run, and then look at the stats for each strategy iteration.

The primary use case is to test thousands of ranking system variations with a click of a button while counting sheep.

The optimizer is useful but the API would allow far more optimization or robustness possibilities.
One of these is simply changing the ranking factors.