IB details the various calculations they do here... http://www.interactivebrokers.com/en/p.php?f=margin&p=overview1 All the values in the various boxes can be obtained through updates in the API. What I want to know is does anybody do any margin pre-checking before sending orders using the API account information? One thing that springs to mind is checking that we have some amount of breathing space on the 'ExcessLiquidity' value (say as a percentage of account size). Thanks in advance. Edit: Doing some searching on TWS API group, it seems 'Cushion' may be the best indicator to check?