Ok, thanks Jcl.
So the IB formula for writing a put or call is below, and my translation to Zorro script at the bottom.
Not sure if is correct to multiply for the multiplier.
Please help if anyone see any issue.
Thanks
https://www.interactivebrokers.com.au/en/index.php?f=marginnew&p=opt//Call Price + Maximum ((20% ^ 2 * Underlying Price - Out of the Money Amount), (10% * Underlying Price))
MarginCost= contractPrice(Call)* Multiplier + max( pow(0.20,2) * (Close[0]* Multiplier) - contractIntrinsic(put,Close[0]) , 0.10* (Close[0]* Multiplier));