Margin = real-time price * coefficient * margin ratio * number of positions.
Outside trading hours
Margin = settlement price * coefficient * margin ratio * number of positions.
Take the stock index as an example
If the current price is 2500 and the margin ratio is 10%, hold 5 lots.
Gross profit =2500*300* 10%*5
If the current settlement price is 3000, the margin ratio of 5 lots is 10%.
Gross profit =3000*300* 10%*5