Develop a portfolio margin model in Python / Cython

Job ID: 33887533

Budget: $250 – $750 USD

I need to plug in a portfolio margin estimation model (deliverable = a class in Python/cython) to my existing backtests. The objective is to estimate portfolio margin reasonably closely to the TIMS PM model. Given the extensive news of TIMS, there will be a relaxations for this module: Only 2 assets used namely:
1. options on 1 underlying only (ie no need for multi class correlation based PM calculations).
2. Single stock with same underlying as 1 above

The model shall be used in 2 ways (outputs):
1. Calculate current portfolio margin given a list of positions
2. Calculate margin impact of adding an incremental position x

The developer will be free to use any library (eg Quantlib).

If responding to this, please highlight a couple of points for me to understand your level of comfort:
- How will you stress test the underlying and volatility changes for PM calculation?
- how do you measure the PM impact of far OTM options? (Ie what method will you use to estimate the volatility surface?)