Formula

Free margin = equity − used margin

Free margin goes up when open trades are in profit and down when they are losing. When free margin reaches zero you cannot open new trades, and your existing positions are at risk of a margin call.