Mark to market loss is calculated by marking each transaction in security to the closing price of the security at the end of trading. In case the security has not been traded on a particular day, the latest available closing price at the NSE is considered as the closing price. In case the net outstanding position in any security is nil, the difference between the buy and sell values is considered as a notional loss for the purpose of calculating the mark to market margin payable. For example, we can understand this in very elementary terms. If you are holding one lot of RIL (1000 shares) in long futures then a fall of Rs.6 in the stock price will result in an MTM loss of Rs.6,000.
The mark to market margin (MTM) is collected from the member before the start of the trading for the next day. The MTM margin is also collected/adjusted from/against the cash/cash equivalent component of the liquid net worth deposited with the Exchange. The MTM margin so collected is be released on completion of pay-in of the settlement.