MarRiskControl
MarRiskControl records are used to establish risk controls within SpiderRock execution engines. These records are only viewable and editable by users belonging to the same riskFirm as the control records.
METADATA
| Attribute | Value |
|---|---|
| Topic | 4535-risk-control |
| MLink Token | MARRisk |
| Product | SRControl |
| accessType | SELECT,UPDATE,INSERT,DELETE |
| MLink Endpoint | MLink-Live |
Table Definition
| Field | Type | Key | Default Value | Comment |
|---|---|---|---|---|
| riskFirm | VARCHAR(16) | PRI | '' | If exists a client firm imposing risk controls should be an existing SR client ID |
| riskGroup | VARCHAR(16) | PRI | '' | The ID of the risk group these rules will apply to |
| isTestAccnt | enum - YesNo | PRI | 'None' | If Yes this control applies only to risk for test accounts |
| stkEnabled | enum - MarState | 'None' | Enabled or not for equities Nonedisabled | |
| futEnabled | enum - MarState | 'None' | Enabled or not for futures Nonedisabled | |
| optEnabled | enum - MarState | 'None' | Enabled or not for options Nonedisabled | |
| marginLimitAcc | FLOAT | 0 | Maximum net per symbol total portfolio startofday positions day trades margin can include external sources | |
| marginLimitDay | FLOAT | 0 | Maximum net per symbolday day portfolio day trades only margin can include external sources | |
| openExposureLimit | FLOAT | 0 | Maximum abs open child order Delta no netting open child orders only | |
| maxAccFutCnAbs | INT | 0 | Maximum absolute net account future contracts | |
| maxDayFutCnBot | INT | 0 | Day future contracts bot | |
| maxDayFutCnSld | INT | 0 | Day future contracts sld | |
| maxDayFutCnAbs | INT | 0 | Maximum absolute net day future contracts | |
| orderMaxStkQty | INT | 0 | Number of equity shares that can be bought or sold by a single parent order Has a maximum value of 10M | |
| orderMaxFutQty | INT | 0 | Number of futures contracts that can be bought or sold by a single parent order | |
| orderMaxOptQty | INT | 0 | Number of option contracts that can be bought or sold by a single parent order | |
| orderMaxStkDDelta | FLOAT | 0 | Maximum abs mny per stock parent order ddelta shares pointValue midPrc | |
| orderMaxFutDDelta | FLOAT | 0 | Maximum abs mny per future parent order ddelta contracts pointValue midPrc | |
| orderMaxOptDDelta | FLOAT | 0 | Maximum abs mny per option parent order ddelta contracts pointValue ABSde uMidPrc | |
| stkCollarPct | FLOAT | 0 | Maximum user limit vs bidask price control percentage as a number between 0 and 1 in decimals | |
| futCollarPct | FLOAT | 0 | Maximum user limit vs bidask price control percentage as a number between 0 and 1 in decimals | |
| optCollarPct | FLOAT | 0 | Maximum user limit vs bidask price control percentage as a number between 0 and 1 in decimals | |
| allowStkOddLots | enum - YesNo | 'None' | Allow parent stock orders with an order size below 100 | |
| allowLimitOnClose | enum - YesNo | 'None' | Allow limit on close orders similar to MOC order with the addition of a price limit | |
| allowMarketOnClose | enum - YesNo | 'None' | Allow market on close orders special order type which is executed as close to the close of trading as possible | |
| allowInterMarketSweep | enum - YesNo | 'None' | Allow intermarket sweep orders | |
| blockShortSales | enum - YesNo | 'None' | Block all short sales | |
| modifiedBy | VARCHAR(24) | '' | User that last modified this record | |
| modifiedIn | enum - SysEnvironment | 'None' | Environment this record was last updated in | |
| timestamp | DATETIME(6) | '1900-01-01 00:00:00.000000' | Timestamp of this record |
PRIMARY KEY DEFINITION (Unique)
| Field | Sequence |
|---|---|
| riskFirm | 1 |
| riskGroup | 2 |
| isTestAccnt | 3 |
SELECT TABLE EXAMPLE QUERY
SELECT *
FROM `SRControl`.`MsgMarRiskControl`
WHERE
/* Replace with a VARCHAR(16) */
`riskFirm` = 'Example_riskFirm'
AND
/* Replace with a VARCHAR(16) */
`riskGroup` = 'Example_riskGroup'
AND
/* Replace with a ENUM('None','Yes','No') */
`isTestAccnt` = 'None';
UPDATE TABLE EXAMPLE QUERY
UPDATE `SRControl`.`MsgMarRiskControl`
SET
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`stkEnabled` = 'None',
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`futEnabled` = 'None',
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`optEnabled` = 'None',
/* Replace with a FLOAT */
`marginLimitAcc` = 1.23,
/* Replace with a FLOAT */
`marginLimitDay` = 1.23,
/* Replace with a FLOAT */
`openExposureLimit` = 1.23,
/* Replace with a INT */
`maxAccFutCnAbs` = 5,
/* Replace with a INT */
`maxDayFutCnBot` = 5,
/* Replace with a INT */
`maxDayFutCnSld` = 5,
/* Replace with a INT */
`maxDayFutCnAbs` = 5,
/* Replace with a INT */
`orderMaxStkQty` = 5,
/* Replace with a INT */
`orderMaxFutQty` = 5,
/* Replace with a INT */
`orderMaxOptQty` = 5,
/* Replace with a FLOAT */
`orderMaxStkDDelta` = 1.23,
/* Replace with a FLOAT */
`orderMaxFutDDelta` = 1.23,
/* Replace with a FLOAT */
`orderMaxOptDDelta` = 1.23,
/* Replace with a FLOAT */
`stkCollarPct` = 1.23,
/* Replace with a FLOAT */
`futCollarPct` = 1.23,
/* Replace with a FLOAT */
`optCollarPct` = 1.23,
/* Replace with a ENUM('None','Yes','No') */
`allowStkOddLots` = 'None',
/* Replace with a ENUM('None','Yes','No') */
`allowLimitOnClose` = 'None',
/* Replace with a ENUM('None','Yes','No') */
`allowMarketOnClose` = 'None',
/* Replace with a ENUM('None','Yes','No') */
`allowInterMarketSweep` = 'None',
/* Replace with a ENUM('None','Yes','No') */
`blockShortSales` = 'None',
/* Replace with a DATETIME(6) */
`timestamp` = '2022-01-01 12:34:56.000000'
WHERE
/* Replace with a VARCHAR(16) */
`riskFirm` = 'Example_riskFirm'
AND
/* Replace with a VARCHAR(16) */
`riskGroup` = 'Example_riskGroup'
AND
/* Replace with a ENUM('None','Yes','No') */
`isTestAccnt` = 'None';
INSERT TABLE EXAMPLE QUERY
INSERT INTO `SRControl`.`MsgMarRiskControl`(
/* Replace with a VARCHAR(16) */
`riskFirm`,
/* Replace with a VARCHAR(16) */
`riskGroup`,
/* Replace with a ENUM('None','Yes','No') */
`isTestAccnt`,
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`stkEnabled`,
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`futEnabled`,
/* Replace with a ENUM('None','Enable','Disabled','CloseOnly') */
`optEnabled`,
/* Replace with a FLOAT */
`marginLimitAcc`,
/* Replace with a FLOAT */
`marginLimitDay`,
/* Replace with a FLOAT */
`openExposureLimit`,
/* Replace with a INT */
`maxAccFutCnAbs`,
/* Replace with a INT */
`maxDayFutCnBot`,
/* Replace with a INT */
`maxDayFutCnSld`,
/* Replace with a INT */
`maxDayFutCnAbs`,
/* Replace with a INT */
`orderMaxStkQty`,
/* Replace with a INT */
`orderMaxFutQty`,
/* Replace with a INT */
`orderMaxOptQty`,
/* Replace with a FLOAT */
`orderMaxStkDDelta`,
/* Replace with a FLOAT */
`orderMaxFutDDelta`,
/* Replace with a FLOAT */
`orderMaxOptDDelta`,
/* Replace with a FLOAT */
`stkCollarPct`,
/* Replace with a FLOAT */
`futCollarPct`,
/* Replace with a FLOAT */
`optCollarPct`,
/* Replace with a ENUM('None','Yes','No') */
`allowStkOddLots`,
/* Replace with a ENUM('None','Yes','No') */
`allowLimitOnClose`,
/* Replace with a ENUM('None','Yes','No') */
`allowMarketOnClose`,
/* Replace with a ENUM('None','Yes','No') */
`allowInterMarketSweep`,
/* Replace with a ENUM('None','Yes','No') */
`blockShortSales`,
/* Replace with a DATETIME(6) */
`timestamp`
)
VALUES(
'Example_riskFirm',
'Example_riskGroup',
'None',
'None',
'None',
'None',
1.23,
1.23,
1.23,
5,
5,
5,
5,
5,
5,
5,
1.23,
1.23,
1.23,
1.23,
1.23,
1.23,
'None',
'None',
'None',
'None',
'None',
'2022-01-01 12:34:56.000000'
);
DELETE TABLE EXAMPLE QUERY
DELETE FROM `SRControl`.`MsgMarRiskControl`
WHERE
/* Replace with a VARCHAR(16) */
`riskFirm` = 'Example_riskFirm'
AND
/* Replace with a VARCHAR(16) */
`riskGroup` = 'Example_riskGroup'
AND
/* Replace with a ENUM('None','Yes','No') */
`isTestAccnt` = 'None';
Doc Columns Query
SELECT * FROM SRControl.doccolumns WHERE TABLE_NAME='MarRiskControl' ORDER BY ordinal_position ASC;