hedged position margin calculation

I am trying to backtest for some options strategy, for this I need functions to calculate margin required for hedged position. Can you provide the calculations.

I understand some parameters may be dynamic for example volatility, which I can use a rough value of (or a dynamic estimation). I just need a rough estimation for the backtest.

2 replies