Margin is calculated as a ratio from the full cost of the line item in dependence on the chosen leverage. As an instance, for a leverage of 1:100, the margin will equaled to 1% of the full size of your situation.