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.

Hello @106543399587699480542, you can calculate margin for hedged position with the Spam Calculator. Please find the links below.

Spam Calculator: https://fyers.in/calculator/margin/span/

API Spam Calculator: https://myapi.fyers.in/docsv3#tag/Margin-Calculator/paths/~1MarginCalculator/post

Hey Abhiraj, thanks for the response.
I was looking for a method without the API as a backtest may require millions of requests.