I am tired of seeing people asking margin questions. It is so complicated. Why TWS just display a break-down margin on each position by adding a column in the sheets? But always remember, don't trust margin numbers displayed in TWS. If markets move big time, it is very likely that the IB margins will just blow up. You positions liquidated in the worse case possible. This is especially true for options, when the underlying markets are available but options not. It can also be caused by trades far out of bid/ask.