Skip to main content

πŸ“Š MTM Template​

MTM Template

  • MTM Template is used to set the MTM parameters through multiple widgets available in the template. User can add/delete groups and can create multiple groups under a single template name. All the group data will be saved on created template name.

🎯 Template Structure​

There are five widgets available under every group:

  1. Position to Consider
  2. Position to Square Off
  3. MTM Limit
  4. MTM Utilization
  5. Square Off Rules

πŸ“¦ Widget Overview​

WidgetPurposeOptionsDescription
Position to Considerall positions that need to be considered for MTM computationSegment / Instrument / Product / Position typeselect market segment e.g., all F&O, all EQ, etc. Instrument and Product are dynamic based on segment selection. Position type: Long, Short or All positions.
Position to Square Offall positions to be squared off based on trigger of MTM conditionsSegment / Instrument / Product / Position typeselect market segment e.g., all F&O, all EQ, etc. Instrument and Product are dynamic based on segment selection.
MTM Limitset the MTM Limit with the use of Multiplier against each HoldingDisplays list of Dynamic Deposits available in Deposit Master + Collateral and CFS DepositsExample: Available Cash Deposit = 10000, Multiplier = 1.50 β†’ Available MTM Limit in Cash Deposit = 15000
MTM Utilizationselect what all values to consider for MTM computationMTM Profit, MTM Loss, Booked Profit, Booked Loss, MTM Profit - Option, MTM Loss - Option, Booked Profit - Option, Booked Loss - Option, Brokerage and Charges (order/trade based), Option CFS limitUsed to compute total MTM utilized value
Square Off RulesPre and Post trigger percentages and eventsPre MTM Square off %, MTM Square off %, Pre Trigger Event, Post Trigger Event, Revert MTM Trigger Restriction Percentage, Reserve Amount Percentage, Max MTM Trigger AttemptsConfigure alert and square-off triggers based on MTM utilization percentages

βš™οΈ Template Creation​

Template Controls​

Template

  • Control Type: Entry Field + Drop-Down
  • Allow alphanumeric and allowable special characters
  • Template name length per API
  • Duplicate MTM template name creation should not be allowed
  • Display list of template names on search
  • Display list of groups created under the selected template
  • Multiple MTM templates allowed

Save

  • Control Type: Button
  • On click of SAVE button, system should validate:
    • Minimum one group should be available in an MTM Template
    • Minimum one record should be available on each widget under the group
  • Popup message when saving without template name: β€œTemplate Name should not be blank”

Save As

  • Control Type: Button
  • Create copy of existing template with a new template name (with or without modifications)
  • Enabled after selecting a template
  • On click, popup child window to enter new template name with OK and CANCEL
  • OK saves new MTM template with all parameters; CANCEL closes without saving
  • Validate new template name against existing templates; if duplicate, show β€œTemplate Name Already Exists”

πŸ‘₯ Group Creation​

Group Controls​

Group

  • Allow alphanumeric and allowable special characters
  • Group name length per API
  • Display on keyword search
  • Show groups under selected template in dropdown
  • Multiple groups allowed per template
  • Duplicate group name should not be allowed

Add

  • On click Add β€” system should create the group
  • If Group Name blank, popup: "GROUP-NAME should not be blank"

Rename

  • Control Type: Button
  • Allows rename; validate duplicates; if duplicate show "Group Name Already Exist"

Delete

  • On click Delete β€” popup confirmation "Do you want to Delete the Group" (Yes/No)
    • Yes: Delete selected group
    • No: No changes

πŸ“Š Widget 1 & 2: Position to Consider / Position to Square Off​

Both widgets share the same columns and behavior.

Configuration Fields​

FieldBusiness Logic
Market SegmentDisplay list of Market Segment (Base Segment + Combined Segment). 'OTHERS' (value -1) option available.
InstrumentDisplay list of applicable instruments per selected segment. For FO segments show FUTURE and OPTION.
ProductDisplay list of applicable product per selected segment.
Position TypeDisplays Long Position / Short Position. Applicable for segments other than "Others" and not for certain holding types.
AddAdds selected combination to widget grid; prevent duplicate combination.
EditEdit option available per record; allow modifying position type.
DeleteDelete option per record with confirmation (Yes/No).

Frontend Validations​

  • Front-end validation to prevent same combination of Market Segment + Product Type across multiple groups.
    • Example: Group 1 - All FNO + Future + Carryforward + All Position; Group 2 - All FNO + Option + Carryforward + All Position β†’ system should restrict on save.
  • "Position to Square-off" must contain records that are present in "Position to Consider" (Segment + Instrument + Product must match; Position Type may differ).
  • Restrict MTM Square-off Percentage to be greater than Pre MTM Square-off Percentage; show popup on save if invalid.

πŸ’° Widget 3: MTM Limit​

Deposit head grid with following fields:

FieldBusiness Logic
Deposit HeadList of deposit heads as received from API
MultiplierAllowed range 0.0001 to 999.9999; only non-zero multipliers should be sent to API

Validation:

  • Members may modify multiplier values.
  • While sending records to API, system should send only records with multiplier other than zero.

πŸ“Š Widget 4: MTM Utilization​

List of items available in MTM Utilization widget:

ItemControl Type
MTM ProfitToggle
MTM LossToggle
Booked ProfitToggle
Booked LossToggle
Option MTM ProfitToggle
Option MTM LossToggle
Option Booked ProfitToggle
Option Booked LossToggle
BrokerageDrop-down: Order Based / Trade Based (default) / None
Option CFS LimitToggle

Option CFS Limit logic:

  • If Option CFS Limit toggle is ON, respective segment Option CFS amount shall be taken into consideration in MTM limit for the SIPs available in "Position to Consider".
  • If OFF, Option CFS amount shall not be considered.
  • Option CFS amount is derived based on Market Segment (irrespective of Instrument/Product).

🎯 Widget 5: Square-off Rules​

Fields and business logic:

FieldBusiness Logic
VariablesPre-Trigger %, Post-Trigger %, Pre-Trigger Events, Post-Trigger Events, Revert MTM Trigger Restriction Percentage, Reserve Amount Percentage, Max MTM Trigger Attempts
ValueAllow to define the value against each variable

Variable Field validation:

  • Pre-Trigger % and Post-Trigger %: allowed range 0.0000 to 100.0000
  • Pre-Trigger Event and Post-Trigger Event: Multi-select dropdown (refer to API for list)
  • Revert MTM Trigger Restriction Percentage: 0.0000 to 100.0000
  • Reserve Amount Percentage: 0.0000 to 100.0000
  • Max MTM Attempts: range 1 to 99. Default: 1

πŸ”— Template Mapping​

MTM Template created here will be allowed to map to entities like Client, Dealer, Branch and Member as well as for users through the "Template Mapping" window.

βš™οΈ Master Configuration Validation​

MTM Profit/Loss shall be computed based on master configuration variables for respective product types, including:

  • Enable MTM Calculation - Cash
  • Enable MTM Calculation - Future
  • Enable MTM Calculation on Long Position
  • Enable MTM Calculation on Short Position
  • Price to Consider for Uploaded Long/Short Position for Option, Future, CASH - MTM

Based on the enable/disable and price configuration (LCP, Uploaded Price, or Zero), the system shall compute MTM P/L.

πŸ“‹ Validation and Rejection Logic​

  • Based on Pre-Trigger % and Post-Trigger % defined in Widget 5, system shall validate MTM P/L Utilization with respect to MTM Limit.
  • Once MTM utilization hits Pre-Trigger %, system shall trigger events selected in Pre-Trigger Event list (e.g., Restrict Fresh Order, Cancel Pending Order, Square-off Open Position, Restrict Position Conversion).
  • Once MTM utilization hits Post-Trigger %, system shall trigger events selected in Post-Trigger Event list.

πŸ’‘ Example​

Consider the Scenarios for MTM Computation as per the MTM Template Configuration

3 groups are created under an MTM Template - MTMTemp1

GroupConfiguration TypeParameters
Group 1Position to ConsiderAll Equity - Margin - All Position
Group 1Position to SquareoffAll Equity - Margin - All Position
Group 1MTM LimitCash -2, Adhoc -1
Group 1Limit SetCash - 10000, Adhoc - 20000
Group 1MTM UtilizationMTM Profit - Tick, MTM Loss - Tick, Booked Profit - Tick, Booked Loss -Tick
Group 1Trigger%Pre-trigger % -70, Post Trigger% -80
Group 1Trigger EventPre Trigger - Restrict Fresh Order - Tick, Post Trigger - Restrict fresh Order -Tick
Group 2Position to ConsiderAll Equity - Delivery - Long Position
Group 2Position to SquareoffAll Equity - Delivery - Long Position
Group 2MTM LimitCash -0.5, Adhoc -1
Group 2Limit SetCash - 10000, Adhoc - 20000
Group 2MTM UtilizationMTM Profit - Un-Tick, MTM Loss - Tick, Booked Profit - Un-Tick, Booked Loss -Tick
Group 2Trigger%Pre-trigger % -75, Post Trigger% -85
Group 2Trigger EventPre Trigger - Restrict Fresh Order - Un-Tick, Post Trigger - Restrict fresh Order -Tick
Group 2Position to ConsiderAll FNO - Future - Carryforward - Short Position
Group 2Position to SquareoffAll FNO - Future - Carryforward - Short Position
Group 2MTM LimitCash - 1, Adhoc -1
Group 2Limit SetCash - 10000, Adhoc - 20000
Group 2MTM UtilizationMTM Profit - Tick, MTM Loss - Tick, Booked Profit - Tick, Booked Loss -Tick
Group 2Trigger%Pre-trigger % -60, Post Trigger% -65
Group 2Trigger EventPre Trigger - Restrict Fresh Order - Un-Tick, Post Trigger - Restrict fresh Order+Cancel Pending Order+Square off Open Position -Tick

Case 1:

  • Trade Buy Order in NSEEQ-ACC-Margin-Qty: 400, Price: 100
  • Trade Buy Order in NSEEQ-TCS-Margin-Qty: 100, Price: 100
  • Consider LTP of ACC is: 40, LTP of TCS is 60
  • In this case, MTM P/L should be ( 400 * (40-100) ) = 400 * -60 = -24000 ( i.e. MTM Loss) for ACC and MTM P/L should be ( 100 * (60-100) ) = 100 * -40 = -4000 ( i.e. MTM Loss)
  • Cumulative MTM P/L should be (-24000 - 4000) = -28000
  • MTM Set Limit = (10000 * 2 + 20000 * 1 = 40000)
  • As per Pre- Trigger % (i.e. 70 %), system reaches 70% Loss of 40000 (i.e. -28000). Accordingly Pre-Trigger Should get Hit and system should not allow to place further Fresh Order in any of the scrip.

Case 2:

  • Trade Buy Order in NSEEQ-ACC-Margin-Qty: 400, Price: 100
  • Trade Buy Order in NSEEQ-TCS-Margin-Qty: 100, Price: 100
  • Consider LTP of ACC is: 40, LTP of TCS is 20
  • In this case, MTM P/L should be ( 400 * (40-100) ) = 400 * -60 = -24000 ( i.e. MTM Loss) for ACC and MTM P/L should be ( 100 * (20-100) ) = 100 * - 80 = -8000 ( i.e. MTM Loss)
  • Cumulative MTM P/L should be (-24000 - 8000) = -32000
  • MTM Set Limit = (10000 * 2 + 20000 * 1 = 40000)
  • As per Post- Trigger % (i.e. 80 %), system reaches 80% Loss of 40000 (i.e. -32000). Accordingly Post-Trigger Should get Hit and system should not allow to place further Fresh Order in any of the scrip.

Case 3:

  • Trade Buy Order in NSEEQ-ACC-Delivery-Qty: 400, Price: 100
  • Consider LTP of ACC is: 53
  • In this case, MTM P/L should be ( 400 * (53-100) ) = 400 * -47 = -18800 ( i.e. MTM Loss)
  • MTM P/L should be =-18800
  • MTM Set Limit = (10000 * 0.5 + 20000 * 1 = 25000)
  • As per Pre- Trigger % (i.e. 75 %), system reaches 75% Loss of 25000 (i.e. -18800). Accordingly Pre-Trigger Should get Hit and but in this case, system should allow to place further Fresh Order in any of the scrip where Restrict Fresh Order is Un-Tick for Delivery Product Type in Group 2.
  • Consider LTP of ACC is: 45, accordingly MTM P/L should be ( 400 * (45 - 100 ) = 400 * -55 = - 22000 which is above 85% Utilization of MTM Set Limit and Post trigger got hit. In this case, system should not allow to place fresh order in any of the scrip where Restrict Fresh Order is Ticked in Post Trigger Event for Delivery Product type in Group 2.

Case 4:

  • Trade Sell Order in NSEFNO-ACC-Carry forward-Qty: 400, Price: 100
  • Consider LTP of ACC is: 147
  • In this case, MTM P/L should be ( 400 * (100 -147) ) = 400 * -47 = -18800 ( i.e. MTM Loss)
  • MTM P/L should be =-18800
  • MTM Set Limit = (10000 * 1 + 20000 * 1 = 30000)
  • As per Pre- Trigger % (i.e. 60 %), system reaches above 60% Loss of 30000 (i.e. -18800).
  • Consider LTP of ACC is: 160, accordingly MTM P/L should be ( 400 * (160 - 100 ) = 400 * 60 = -24000 which is above 80% Utilization of MTM Set Limit and Post trigger got hit. In this case, system should not allow to place fresh order in any of the scrip where Restrict Fresh Order is Ticked in Post Trigger Event for Delivery Product type in Group 2 and Square off the Open position trade Sell Order in NSEFNO-ACC-Carry forward.