When you SQR
The most common SQR context is intraday trading. You buy OGDC at 10:30 AM intending to sell before the close; the sell order that closes the position is your SQR. If you fail to SQR by the end of session, the position auto-converts to a delivery trade and settles T+1 like any other DTS trade.
Brokers may auto-SQR your intraday positions if margin falls below required levels. That is not optional — it is a risk-management action to protect you (and them) from a mark-to-market move that your account cannot cover.
SQR vs rolling over
On MTS (margin trading), you have a third option — rolling the position overnight by paying a financing fee. That is different from an SQR; the position stays open, just at a cost. SQR closes it entirely.
On the DTS segment, SQR is simpler: it is just the matching trade that offsets your opening trade. No financing, no overnight exposure, no mark-to-market risk once SQR'd.