Hello everyone, I am working on a strategy to backtest in NSE.
Strategy is Shorting the Straddles. Now the problem that I am facing is that whenever I use this line:

strategy_specs=OptionStrategies.ShortStraddle(self.option_symbol,contract_strikeprice, expiry)
self.Buy(strategy_specs,quantity=quantity)

I get self.Portfolio.MarginUsed value = StartingMargin-((call_price+put_price)*quantity), while it is wrong. In India there are a few measurements that are used to calculate the margin utilization for the straddle (short) but I am taking a thumb rule of call.UnderlyingLastPrice*lotsize*.12 as the margin required to short the straddle. (I know it is not precise but it is enough for my backtesting). Now the problem I am getting is that, I am not able to manage/manipulate/override the default PortfolioMarginManager. How can I do that? If my straddle needs a amrgin of 1000 then I want it to show me 1000 blocked instead of the (call_price+put_price)*quantity blocked.

Example:
I will place an order of shorting the straddle of quantity 1 and then it will more clear to you.

StratingMargin = 1,000,000
Callprice = 40
PutPrice = 30
UnderlyingPrice = 20000
lotsize = 50 
quantity = 1 #(even I am fine if i have to provide quantity with lotsize multiplied)
MarginRequired = UnderlyingPrice * lotsize * quantity * 0.12 #(The one I want it to return) 
MarginReturnedByDefault = Quantity * (CallPrice + PutPrice)

Case 1: When I place an order of Short Straddle with quantity 1 with the aforementioned values, then I will get the utilized margin as 70, and remaining Margin as 999,930. 
Case 2: And If I give it the value of quantity as multiplied the lotsize then i will get the utilized margin as 3500, and remaing as 996,500.

While utilized Margin should have been 120,000, and remaing should have been 880,000.
Please help me out.

Things I have tried:

I have Implemented my custom BuyingPowerModel and MarginModel but they seem to have no effect on the Portfolio Level.


Thanks,
Chetan K Tyagi.