Upload Restrictions, Rules and Associations via .csv File

Upload a .csv file to quickly add, modify and delete restrictions, add and delete rules from restrictions, add and remove associations between restrictions and entities and add, modify and delete lists.

File size is limited to 512 KB and 10,000 lines.

Requirements:

  • All lines must begin with an ACTION followed by NAME, with each entry separated by a comma.
  • All restrictions must include at least one rule.

Supported Actions:

 

RESTR_ADD - Add a new restriction.

Prerequisite: The restriction name must be unique (not exist).

Parameters:

  • Required: Restriction name, e.g. Disallow IBM and BRK A,
  • Optional: Description, e.g. Description="descriptive text",
  • Optional: Message for traders, e.g. Message="message for traders when restriction is triggered",
  • Optional: Allow_Restrict valid values include: Allow|Restrict, e.g. Allow_Restrict="Allow",
  • Optional: RuleMatch valid values include: Any|All, e.g. RuleMatch="Any",
  • Required: At least one rule. Rule syntax is:

RULE_BEGIN,

  • Required: Rule_type e.g. rule_type="valid rule type", (see Rule Types below).
  • As needed: Parameters for rule type.
  • Required: TIF valid values include GTC | GTD e.g. TIF="GTC"
    • GTD requires START=YYYYMMDD, END=YYYYMMDD

RULE_END

See an example of RESTR_ADD

 

RESTR_MODIFY - Modify a restriction.

Prerequisites:

  • The restriction must exist.
  • The restriction name you use must exactly match the current restriction name in all aspects.

Parameters:

Required: Restriction name, which must exactly match name of restriction you are modifying, e.g. Disallow IBM and BRK A,

If included, the below will either be added to the restriction, or replace the current values:

  • Name="new name", will replace existing restriction name.
  • Description, e.g. Description="descriptive text",
  • Message for traders, e.g. Message="message for traders when restriction is triggered",
  • Allow_Restrict valid values include: Allow|Restrict, e.g. Allow_Restrict="Allow",
  • RuleMatch valid values include: Any|All, e.g. RuleMatch="Any",


See an example of RESTR_MODIFY


RULE_ADD - Add a rule to a restriction.

Prerequisites:

  • The restriction to which you are adding the rule must exist.
  • The restriction name you use must exactly match the current restriction name in all aspects.

Parameters:

  • Required: Restriction name, e.g. Disallow IBM and BRK A,
  • Required: At least one rule using the syntax:

RULE_BEGIN,

  • Required: Rule_type e.g. rule_type="valid rule type", (see Rule Types below).
  • As needed: Parameters for rule type.
  • Required: TIF valid values include GTC | GTD e.g. TIF="GTC"

    • GTD requires START=YYYYMMDD, END=YYYYMMDD

RULE_END

See an example of RULE_ADD

 

RULE_DELETE - Delete a rule from an existing restriction.

Prerequisites:

  • The restriction and rule must exist.
  • The restriction name, rule type and rule parameters must exactly match the current restriction name in all aspects.
    NOTE: If the restriction includes only one rule, deleting the rule will result in deleting the restriction.

Required: At least one rule using the syntax:

RULE_BEGIN,

  • Required: Rule_type e.g. rule_type="valid rule type", (see Rule Types below).
  • As needed: Parameters for rule type.
  • Required: TIF valid values include GTC | GTD e.g. TIF="GTC"

    • GTD requires START=YYYYMMDD, END=YYYYMMDD

RULE_END

See an example of RULE_DELETE

 

RESTR_DELETE - Delete an existing restriction. This action will also delete all assocations.

Prerequisites:

  • The restriction must exist.
  • The restriction name you use must exactly match the current restriction name in all aspects.

Parameters:

  • Required: Restriction name, e.g. Disallow IBM and BRK A,

See an example of RESTR_DELETE

 

ASSOC_ADD - Associate a restriction with entities.

Prerequisites:

  • The restriction must exist.
  • Entities used must be accessible to you when logged in for setting trading permissions.
  • The restriction name you use must exactly match the current restriction name in all aspects.

Parameters:

  • Required: Restriction name, e.g. Disallow IBM and BRK A,
  • Required: AssocType, valid values include: All | Accounts e.g. AssocType="accounts", U1244, U1766


See an example of ASSOC_ADD

 

ASSOC_DELETE - Remove the association between a restriction and entities.

Prerequisites:

  • The restriction must exist.
  • Entities used must be accessible to you when logged in for setting trading permissions.
  • The restriction name you use must exactly match the current restriction name in all aspects.

Parameters:

  • Required: Restriction name, e.g. Disallow IBM and BRK A,
  • Required: AssocType, valid values include: All | Accounts e.g. AssocType="accounts", U1244, U1766


See an example of ASSOC_DELETE

 

LIST_ADD - Create a new list.

Prerequisite: The list name must be unique (not exist).

Parameters:

  • Required: ListName, e.g. South American Countries,
  • Optional: Description, e.g. Description="descriptive text",
  • Required: List_Type, e.g. list_type =country
  • Required: List_Type must contain at least one list entry. List entry syntax is:

ENTRY_BEGIN,

  • Required: entry_type e.g. entry_type=country, country_code=BG,
  • As needed: Parameters for entry type, e.g. country requires country_code=

ENTRY_END

See an example of LIST_ADD

 

LIST_MODIFY

Prerequisites:

  • The list must exist.
  • The list name you use must exactly match the current name in all aspects.

Parameters:

Required: List name, which must exactly match name of the list you are modifying, e.g. Restricted Stock Countries

If included, the below will either be added to the list, or replace the current values:

  • Name="new name", will replace existing list name.
  • Description, e.g. Description="descriptive text",


See an example of RESTR_MODIFY

 

LIST_DELETE - Delete a list that is not used in any rule.

Prerequisites:

  • The list must exist.
  • The list cannot currently be used in any rule. To find out whether a list is in use, click Lists in the menu and check the "In use" column.
  • The list name you use must exactly match the current name in all aspects.

See an example of LIST_DELETE

 

LISTENTRY_ADD - Add one or more entries to an existing list.

Prerequisites:

  • The list to which you are adding the entry must exist.
  • The list name you use must exactly match the current list name in all aspects.

Parameters:

  • Required: List name, e.g. Restricted US Stock Countries

ENTRY_BEGIN,

  • Required: entry_type e.g. entry_type=country, country_code=BG,
  • As needed: Parameters for entry type, e.g. country requires country_code=

ENTRY_END

See an example of LISTENTRY_ADD

 

LISTENTRY_DELETE - Delete one or more entries from an existing list.

Prerequisites:

  • The list from which you are deleting the entries must exist.
  • The list name you use must exactly match the current list name in all aspects.
  • The entry you are deleting must exactly match the current entry.

Parameters:

  • Required: List name, e.g. Restricted US Stock Countries

ENTRY_BEGIN,

  • Required: entry_type e.g. entry_type=country, country_code=BG,
  • As needed: Parameters for entry type, e.g. country requires country_code=

ENTRY_END

See an example of LISTENTRY_DELETE

 

Supported Rules

Restrictions require at least one rule. Some rules included required parameters. Indicate rules using RULE_BEGIN, and RULE_End tags.

  • ClosingOnly - Block or Allow orders except closing/liquidating orders.
    Required parameters: None
  • NoNegCash - Block or Allow orders that would require margin (that would result in a negative cash balance).
    Required parameters: None
  • Issuer - Block or Allow orders from specific issuers of symbols.
    Required parameters: One of: isin=ISIN or cusip=CUSIP
  • RestrictAllOrders - Block or Allow orders on the specified side (All|Buy|Sell|Sellshort).
    Required parameters: orderside="ALL|BUY|SELL|SELLSHORT
  • DaysToExpiration - Block or Allow orders on options that expire within 30 calendar days, unless the underlying is an index, ETF or ETN.
    Required parameters: relation= le (less than or equal to)| lt (less than)| eq (equal to)| gt (greater than)| ge (greater than or equal to)| ne (not equal to)
    numdays=integer greater than zero

    Example: RULE_BEGIN,rule_type=daystoexpiration,tif=gtc,relation=le,numdays=5,RULE_END
    This example translates to: matches orders where days to traded contract's expiration are less than or equal to 5 days
  • ProductCategory - Block or Allow orders on specified products or security types.
    Required parameters: productcategory=see allowed product categories. Note that categories that require their own parameters have them listed next to their name.
  • Exclusion - This is a special rule that allows you to specify exceptions for certain rules.
    Required parameters: TIF=GTC
    exclusion_type=AllowClosingExistingPos | AllowExistingSymbol | ExcludeCashEquivFromCalc

Sample .csv lines:

Example 1: Add a restriction
Add a restriction called "Disallow IBM and BRK A" Add a description "Restrict some trading." Include two rules: the first is ISSUER using the isin to identify IBM. The second is another ISSUER that uses the isin to identify BRK A, and use a time-in force of good till date, starting August 1, 2017 and ending January 1, 2018.

RESTR_ADD, "Disallow IBM and BRK A", Description="Restrict some trading", RULE_BEGIN, rule_type=ISSUER, isin=US4592001014, tif=gtc, RULE_END, RULE_BEGIN, rule_type=ISSUER, TIF=GTD,START=20170801,END=20180101,isin=US0846701086, RULE_END

Example 2: Modify a restriction
Modify the restriction, "Disallow IBM and BRK A" to also include AMZN. Also, make the description more helpful and change the name of the restriction.

RESTR_MODIFY,"Disallow IBM and BRK A", message="Trade is rejected as IBM, AMZN and BRK A are not allowed.", description="Restrict trading for IBM, AMZN and BRK A", name="Disallow IBM, AMZN and BRK A"

Example 3: Add a rule
Add a rule to the above restriction that will actually include AMZN.

RULE_ADD, "Disallow IBM, AMZN and BRK A", RULE_BEGIN, rule_type=issuer, isin=US0231351067, tif=GTC, RULE_END

Example 4: Delete a rule

On second thought, delete the rule for amazon. Note that if you delete a rule and it's the only rule in a restriction, you have also deleted the restriction.

RULE_DELETE, "Disallow IBM, AMZN and BRK A", RULE_BEGIN, rule_type=issuer, isin=US0231351067, tif=GTC, RULE_END

Example 5: Delete a restriction

Delete the restriction that rejects orders for short sells, called "No short sells."

RESTR_DELETE, "No short sells"

Example 6: Add an association

Apply the restriction to disallow IBM, AMZN and BRK A to all or specific accounts.

ASSOC_ADD, "Disallow IBM, AMZN and BRK A", ALL

Example 7: Delete an association

Delete the restriction to disallow IBM, AMZN and BRK A from all accounts.

ASSOC_DELETE, "Disallow IBM, AMZN and BRK A", ALL

Example 8: Create a list

I want to include a list of many countries in a rule for two of my restrictions.

LIST_ADD, "Restricted Stock Countries", description="List of countries in which we restrict trading of certain stocks", list_type=country, ENTRY_BEGIN, entry_type=country, country_code=BG, ENTRY_END, ENTRY_BEGIN, entry_type=country, country_code=AU, ENTRY_END, ENTRY_BEGIN, entry_type=country, country_code=BE, ENTRY_END

Example 9: Modify a list

You can change the name or description of a list. I want to change the name of my list from Restricted Stock Countries to Restricted US Stock Countries.

LIST_MODIFY, "Restricted Stock Countries", name="Restricted US Stock Countries"

Example 10: Delete a list

LIST_DELETE, "Restricted US Stock Countries"

Example 11: Add an entry to a list

LISTENTRY_ADD, "Restricted US Stock Countries", ENTRY_BEGIN, entry_type=country, country_code=DE, ENTRY_END

Example 12: Delete an entry from a list

LISTENTRY_DELETE, "Restricted US Stock Countries", ENTRY_BEGIN, entry_type=country, country_code=BE, ENTRY_END

 

Allowed Product Categories:

  • STK
  • OPT
  • FUT
  • CASH
  • BOND
  • FOP
  • CMDTY
  • FUND
  • FWD
  • BILL
  • IOPT
  • WAR
  • ADR
  • CMDTYFUT
  • CORPBOND
  • ETF
  • FXCFD
  • INDOPT
  • INDUSTRY sector|indgroup|indsubgroup="industry"
  • ISSUERCOUNTRY country_code="US"
  • LISTCOUNTRY country_code="US"
  • JUNKBOND
  • INVETF
  • LEVETF
  • LEVFX
  • MKTCAP currency="JPY" mktcap="100" // in millions
  • MUNIBOND
  • NONUS
  • PREFERRED
  • STKOPT
  • UNCOVOPT
  • USOTCSTK