Difference in Margin in code VS margin-calculator Page

str
Today i see some issue with the Margin Calculator:
For OrientBank Symbol, when i calculate the Margin it came to 6.363. But in Margin Calculator page it is showing as 4.
https://zerodha.com/margin-calculator/BracketCover/

Symbol: OrientBank
Price: 75.75
SL: 0.85 = 74.9
CO LOWER: 4
CO UPPER: 7
Margin in Code: 6.363
Margin in Margin Cal Page: 4
Call: Buy
Type: BO

I didn't observe any difference for other scripts. The same code i'm using it for long time.
    co_lower = co_lower/100
co_upper = co_upper/100

trigger = price - (co_upper * price)

if sl < trigger:
sl = trigger
else:
trigger = sl

x = 0
if transaction_type == 'Buy':
x = (price - trigger) * quantity
else:
x = (trigger - price) * quantity

y = co_lower * price * quantity
margin = x if x > y else y
margin = margin + (margin * 0.2)
Sign In or Register to comment.