📊 Margin Square Off Template
Functionality Description: Add Group – New Window Behavior
When the user clicks the “Add Group” button, a new pop-up window will be displayed.
This window allows the user to define the type of group they want to create.
Pop-Up Window Details
The pop-up window contains the following elements:
Radio Buttons (Selection Options)
- MTM Square-off (Default selection)
- Margin Square-off
Action Buttons
- Add – Confirms the selected option and proceeds with group creation.
- Cancel – Closes the window without making any changes.
Default Behavior
The “MTM Square-off” option will be selected by default when the pop-up window appears.
UI Validations
1. Selection Behavior (Radio Buttons)
- Only one option can be selected at a time.
- If the user selects “Margin Square-off”, the “MTM Square-off” option will automatically be unselected.
- If the user selects “MTM Square-off”, the “Margin Square-off” option will automatically be unselected.
This ensures that only one trigger type is chosen for each group.
2. Validation for Duplicate Segment + Product Combination
The system validates combinations of Segment + Product across different groups, based on the selected trigger type.
A toaster message will appear only when the same Segment + Product combination is used in multiple groups with the same trigger type.
Scenario 1: Different Trigger Types → Allowed
Group 1: MTM Square-off
Group 2: Margin Square-off
Segment + Product: Same in both groups
→ System will allow saving the template (No error)
Scenario 2: Same Trigger Type → Not Allowed
Group 1: MTM Square-off
Group 2: MTM Square-off
Segment + Product: Same in both groups
→ System will restrict saving and display the toaster message:
“Same Combination of Segment + Product is available in Multiple Group.”
Template Mapping
User can Map the respective Margin/MTM Square off Template through Entity wise/Entity Profile wise/Entity Type wise in Template Mapping.
Widget Name
| Margin Square-off Widget Name | Applicable Fields |
|---|---|
| "Position to consider & Square-off" | • "Market Segment" - List of Market Segments i.e., ALL EQ, ALL FNO, ALL CURR, MCX, NCDEX, NSE COMM • "Product" - List of Products as per the Market Segment selected |
| "Margin Limit" ("MTM Limit" widget shall be renamed as "Margin Limit") | • The list of editable and non-editable deposits shall be displayed with the multiplier, as per existing workflow. |
| "Margin MTM Utilization" ("MTM Utilization" shall be renamed as "Margin MTM Utilization") | • Net MTM Loss • Booked Profit • Booked Loss • Booked Profit - Option • Booked Loss - Option • Brokerage and Charges • Option CFS limit • Net Premium Payable |
SquareOff Rules
| Field Name | Field Type | Range / Value | Default Value |
|---|---|---|---|
| Pre Margin Square off Percentage | PERCENTAGE | 0 to 999.9999 | 0 |
| Post Margin Square off Percentage | PERCENTAGE | 0 to 999.9999 | 0 |
| Revert Pre Margin Trigger Restriction Percentage | PERCENTAGE | 0 to 999.9999 | 0 |
| Pre Trigger Event | Dropdown | • Restrict Fresh Order • Restrict Position Conversion | Restrict Fresh Order |
| Post Trigger Event | Dropdown | • Restrict Fresh Order • Restrict Fresh + Cancel Pending Order • Restrict Fresh + Cancel Pending Order + Square-off Open Position • Restrict Position Conversion | Restrict Fresh Order |
| Margin trigger Time | Time | — | 09:30:00 |
Margin Square-off Calculation Logic
Trigger Logic
The margin square-off triggers based on the configured Pre and Post threshold percentages.
When triggered, the system will:
- Restrict fresh orders / position conversion
- Cancel pending orders (based on selected rule)
- Square-off open positions (based on selected rule)
All actions are governed by the selections made in Position to Consider & Square-off.
Margin Utilization Calculation
Margin Utilization = Computed based on:
Margin Limit
→ Derived from the value configured in Margin Limit widget.
Margin Considered
Includes all types of margin:
- Exposure , SPAN , Physical Delivery Margin , Scrip Basket Margin , Holding Selling Margin , Buyback Margin , etc.
Items Included from Widget
- Booked Profit, Booked Loss, Booked Profit - Option, Booked Loss - Option, Brokerage and Charges and Option CFS limit shall be considered from the Margin utilization widget.
Items Excluded
- The brokerage toggle from the RRT template shall not be consider to calculate the margin utilization.
- The OI template from the RRT template shall not be consider to calculate the margin utilization.
Premium Handling
- If FNO segment is selected and premium payable exists → considered as part of margin utilization.
- If Net Premium Payable toggle is ON: Premium receivable will only be adjusted against premium payable of the same segment (not against margin)
Timing Rules
Margin trigger event will only execute if:
Current Time ≥ Configured “Margin Trigger Time”
Position Consideration Policy
The system considers:
- Uploaded positions
- Daily traded positions
Pending orders are not considered (aligned with exchange peak margin policy).
Margin for uploaded positions is calculated as per existing Master Config logic.
Square-off Order Placement
- Orders are placed through ALGO & Default Dealer
- Configuration source:
Config UI → rms-adaptor → SQOFF_ALGO - Square-off price derivation:
Master Config → General Tab → Square Off Price Method
T2T Scrip Handling
If a square-off order is generated for a T2T scrip:
- The order will be rejected
Scenarios That Can Trigger Margin Square‑off (Due to Increase in Margin Utilization)
The Margin Square‑off mechanism can be triggered when margin utilization increases and breaches the configured Pre/Post thresholds. Below are scenarios that may cause such an increase:
-
Intraday SPAN File Upload
- Updated exchange risk files (SPAN/Exposure) increase margin requirements for existing positions.
-
Hedge/Spread Break Scenario
- A hedge/spread relationship breaks (e.g., one leg squared‑off or expires), removing the benefit and increasing margin.
-
Change in RRT / Master Configuration
- Changes to risk parameters or calculation logic (e.g., utilization inclusions/exclusions) raise the required margin or lower available limits.
-
Physical Delivery Margin Application
- Positions moving into delivery (e.g., equity/F&O nearing expiry) attract additional physical delivery margins.
-
Calendar Spread Benefit Adjustment
- Reduction/removal of calendar spread benefit (due to time/eligibility changes) increases margin.
-
Pending Order Traded → Position Becomes Delivery
- Pending orders get executed and result in positions moving into physical delivery, increasing margin requirements.
-
Position Upload
- Uploaded positions (intraday or start‑of‑day load) increase the exposure and thereby utilization.
-
Change in Mapped Template
- Switching to a different risk template (RRT/config mapping) alters applicable rules/limits and increases utilization.
-
Position Conversion
- Converting positions (e.g., MIS → NRML / Intraday → Carry Forward) increases margin requirement.
Trigger Rule (Applies to All Scenarios)
If Margin Utilization exceeds the configured Pre or Post threshold and the current time is on/after the Margin Trigger Time, the corresponding actions shall execute based on Square-off Rules:
-
Pre Trigger Event
- Restrict Fresh Order
- Restrict Position Conversion
-
Post Trigger Event
- Restrict Fresh orders
- Cancel Pending Orders
- Square-off Open Positions
Alert Message
- Alert message shall be displayed in the right-side collapse panel
- Example:1
- System should display the following alert message in Side Panel as follows:
- Time: 14:25 Pre Margin Triggered. Set Limit:1000, Utilization: 750 for Entity ID: CLI1 Template Name: MARGIN_Delivery
- Time: 14:25 Post Margin Triggered. Set Limit:1000, Utilization: 850 for Entity ID: CLI1 Template Name: MARGIN_Delivery
- Event History
- System should display the following alert message in Side Panel as follows:
| Alert Time | Event Type | Entity Id | Trigger Type | Template Name | MTM/Margin Set Limit | MTM/Margin Utilization |
|---|---|---|---|---|---|---|
| 14:25 | Margin | CLI1 | Pre Margin Triggered | MARGIN_Delivery | 1000 | 750 |
| 14:30 | Margin | CLI1 | Post Margin Triggered | MARGIN_Delivery | 1000 | 850 |
- Example:2
- Rejection: Restrict Fresh Order Based on Margin
- MARGIN_TRIGGER_TYPE = PRE Margin Trigger/Post Margin Trigger
- MARGIN_SETLIMIT = 10000
- MARGIN_TRIGGER_VALUE = 5000
- MARGIN_TRIGGER_PER = 50%
- MARGIN_UTILIZATION = 5000
- TEMPMAP_VALID_ENTY_ID = RET1
- TEMPMAP_TEMPLATE_TYPE = MTM TEMPLATE
- TEMPMAP_TEMPLATE_NAME = MTM_TEMP1
- PRE Margin trigger Rejection: Fresh Order Restricted due to Pre Margin Trigger Set Limit: 10000, Trigger Value:5000, Trigger%: 50%, Utilization: 5000 for RET1 in MTMT - MTM_TEMP1.
- Rejection: Restrict Fresh Order Based on Margin
Note:
- In "Margin MTM Utilization" in Margin Square off Template"
- Net Premium Payable
- If the Net Premium Payable toggle is ON in Margin utilization widget, then system shall adjust the receivable with the payable of same segment and consider the net payable in the utilization.
- If the Net Premium Payable toggle is OFF, then system shall not adjust the receivable with the payable of same segment.
- Net MTM Loss:
- If "Net MTM Loss" toggle is enabled, then the system shall consider the Unrealized Net MTM Loss as a utilization.
- Net MTM Loss shall be calculated and considered for all the segments added in the "Position to consider & Square-off"
- Example 3:
- Case:1
- Position to consider & Square-off = Segment: ALL EQ Product: Margin
- Margin Limit = Cash: 30000 & Adhoc: 2000
- Margin MTM Utilization = Booked Profit: Tick, Booked Loss: Tick, Booked Profit - Option: Tick, Booked Loss - Option: Tick, Brokerage and Charges - Order Based, Option CFS limit - Tick
- Pre Margin Square off Percentage = 90% and Margin Square off Percentage = 95%
- Revert Margin Trigger Restriction Percentage - 10%
- Pre Trigger Event - Restrict Fresh Order & Restrict Position Conversion
- Post Trigger Event - Restrict Fresh + Cancel Pending + Square-off open position & Restrict Position Conversion
- Margin trigger Timer - 09:30
- Consider Buy margin set as 20% in the RRT.
- Case:1
| Action/Event | Details | Remarks/System Response |
|---|---|---|
| Order1: Trade Buy | - Consider current time is 11:00 - NSEEQ-ACC-Margin-Qty: 100, Price: 1200 - Total Margin Utilized: 24,000 | No Trigger, because Margin utilized = 75% only. |
| Order2: Trade Buy | - NSEEQ-TCS-Margin-Qty: 13, Price: 2000 - Current order Margin: 5200 - New Margin utilized: 29200 (24000 + 5200) | - Margin Utilized% = 91.25%, so Pre Margin Triggered Restrict Fresh Order & Restrict Position Conversion shall be activated as per the Pre Trigger Event. |
| Order3: Buy Order | - NSEEQ-TCS-Margin-Qty: 13, Price: 2000 | - The order shall be rejected and shall display the following error. Fresh Order Restricted due to Pre Margin Trigger. Set Limit:32000, Trigger Value:28800, Trigger %:90, Utilization: 29200 for RET1 in MTMT - MTMTemp1 |
| Client square off the TCS position at same price | - The client square off the position in TCS | - Margin Utilized = 24000, so system shall revert the Pre Margin square-off trigger. - Set Limit: 32000 and 10% of that is 3200. - Revert Margin Trigger value is 25600 = 28800-3200 Now the Margin utilized reduced to 24000 it is less than Revert Margin Trigger value so the revert trigger shall trigger. |
| Order4: Pending Buy | - NSEEQ-TCS-Margin-Qty: 16, Price: 2000 - Current Order Margin: 6400 - New Margin Utilized: 30,400 | Here since its pending order system will not post trigger even if set % limit of 95% is breached. |
| Order 5: Pending Buy order gets traded | - NSEEQ-TCS-Margin-Qty: 16, Price: 2000 - Current Trade Margin: 6400 - New Margin Utilized: 30,400 | - Margin Utilized% = 95%, so Post Triggered. - Restrict Fresh + Cancel Pending + Square-off open position & Restrict Position Conversion shall be activated as per the Post Trigger Event. - NSEEQ-TCS-Margin - 16 qty must get square off - NSEEQ-ACC-Margin-Qty: 100 - Square-off order shall be placed. (Consider Square-off Traded with Booked Loss "1000"rs) - After Square-off trade utilization shall be: - Set Limit:32000, Post Trigger Value:30400, Trigger %95, Utilization: 1000 |
-
- Case:2
- Position to consider & Square-off = Segment: ALL FNO, Product: Carryforward
- Margin Limit = Cash: 1,50,000
- Margin MTM Utilization = Booked Profit: Tick, Booked Loss: Tick, Booked Profit - Option: Tick, Booked Loss - Option: Tick, Brokerage and Charges - Order Based, Option CFS limit - Tick
- Pre Margin Square off Percentage = 80% and Margin Square off Percentage = 90%
- Pre Trigger Event - Restrict Fresh Order & Restrict Position Conversion
- Post Trigger Event - Restrict Fresh + Cancel Pending + Square-off open position & Restrict Position Conversion
- Margin trigger Timer - 15:00
- Case:2
| Action/Event | Details | Remarks/System Response |
|---|---|---|
| Upload: Option Buy Position Upload price set as "zero price" in Master config |
|
|
| Order1: Option Buy Trade |
|
|
| Order2: Option Sell Trade (Square-off) |
|
|
| Time changed |
|
|
-
- Case:3
- Position to consider & Square-off = Segment: ALL FNO, Product: Carryforward
- Margin Limit = Cash: 2,00,000
- Margin MTM Utilization = Booked Profit: Tick, Booked Loss: Tick, Booked Profit - Option: Tick, Booked Loss - Option: Tick, Brokerage and Charges - Order Based, Option CFS limit - UnTick, Net Premium Payable-Tick
- Pre Margin Square off Percentage = 80% and Margin Square off Percentage = 85%
- Pre Trigger Event - Restrict Fresh Order & Restrict Position Conversion
- Post Trigger Event - Restrict Fresh + Cancel Pending + Square-off open position & Restrict Position Conversion
- Consider "Restrict Square Off on Margin Increase & Shortfall" rule is un-selected in the RRT.
- Case:3
| Action/Event | Details | Remarks/System Response |
|---|---|---|
| Order1: Hedge Order Through Multi leg order book |
|
|
| Order2: Future sell (Square-off Traded) |
|
|
-
- Case:4
- Position to consider & Square-off = Segment: ALL FNO, Product: Carryforward, Segment: ALL EQ Product: Delivery
- Margin Square-off Limit = Cash: 200000
- Pre Margin Square off Percentage = 95% and Margin Square off Percentage = 100%
- Margin MTM Utilization = Net Booked Loss: Tick, Booked Profit: Tick, Booked Loss: Tick, Booked Profit - Option: Tick, Booked Loss - Option: Tick, Brokerage and Charges - Order Based, Option CFS limit - Tick, Net MTM Loss- Tick
- Pre Trigger Event - Restrict Fresh Order & Restrict Position Conversion
- Post Trigger Event - Restrict Fresh + Cancel Pending + Square-off open position & Restrict Position Conversion
- Pre Trigger: Set Limit: 200000, Pre Trigger Value: 190000, Trigger %: 95%
- Post Trigger: Set Limit: 200000, Post Trigger Value: 200000, Trigger %: 100%
- Consider Buy margin set as 100% in the RRT for Delivery product type.
- Case:4
| Action/Event | Details | Remarks/System Response |
|---|---|---|
| Order 1 Traded: Future Buy |
|
|
| Order 2 Traded: EQ Buy |
|
|
| Consider there is an LTP change in TCS |
|
|
-
- Case 5
- Position to consider & Square-off = Segment: ALL FNO, Product: Carryforward and MCX, Product Carryforward
- Margin Limit = Cash: 3,00,000
- Margin MTM Utilization = Booked Profit: Tick, Booked Loss: Tick, Booked Profit - Option: Tick, Booked Loss - Option: Tick, Brokerage and Charges - Order Based, Option CFS limit - UnTick, Net Premium Payable-Tick
- Pre Margin Square off Percentage = 80% and Margin Square off Percentage = 85%
- Pre Trigger Event - Restrict Fresh Order & Restrict Position Conversion
- Post Trigger Event - Restrict Fresh + Cancel Pending + Square-off open position & Restrict Position Conversion
- Case 5
| Action/Event | Details | Remarks/System Response |
|---|---|---|
| Order1: Option Sell Daily Traded |
|
|
| Order2: Option Buy Traded(But different segment) |
|
|
-
- Case 6
- Position to consider & Square-off = Segment: ALL FNO, Product: Carryforward
- Margin Limit = Cash: 4,00,000
- Margin MTM Utilization = Booked Profit: Tick, Booked Loss: Tick, Booked Profit - Option: Tick, Booked Loss - Option: Tick, Brokerage and Charges - Order Based, Option CFS limit - UnTick, Net Premium Payable-Tick
- Pre Margin Square off Percentage = 80% and Margin Square off Percentage = 85%
- Pre Trigger Event - Restrict Fresh Order & Restrict Position Conversion
- Post Trigger Event - Restrict Fresh + Cancel Pending + Square-off open position & Restrict Position Conversion
- Case 6
| Action/Event | Details | Remarks/System Response |
|---|---|---|
| Order1: Option Sell Daily Traded |
|
|
| Order2: Option Buy(Another scrip) Traded but same segment |
|
|