Skip to content

Configure rick limits#

Overview#

In CopyFactory you can optionally configure risk limits to be observed on subscriber accounts.

In this feature, if drawdown for a time period exceeds specified limit, then trading will be stopped and you can optionally close existing trades.

By default CopyFactory will not apply any risk limits. If you want to enable this feature then you can specify an optional riskLimits setting. This setting can be specified on any of the following entities:

  • strategy
  • member of a portfolio strategy
  • portfolio strategy
  • subscription
  • account

The schema for this setting is described in StrategyRiskLimit document.

This setting is additive. This means that CopyFactory will apply the setting to each of the contexts in which the setting is specified.

Clearing stopout#

When the risk limit is hit a temporary stopout is triggered.

If you wish to clear stopout you first need to update the context which triggered a stopout with startTime setting set to a current time. This means that drawdown will be calculated starting from this moment in time only. Then you need to invoke Reset stop outs API.

Example (strategy)#

{
  "name": "Strategy",
  ...
  "riskLimits": [
    {
      "type": "daily",
      "applyTo": "balance",
      "maxRisk": 0.4,
      "closePositions": true,
      "startTime": "2021-05-01T00:00:00.000Z"
    }
  ],
  ...
}

Example (member of a portfolio strategy)#

{
  "name": "Portfolio strategy",
  ...
  "members": [
    {
      ...
      "riskLimits": [
        {
          "type": "daily",
          "applyTo": "balance",
          "maxRisk": 0.4,
          "closePositions": true,
          "startTime": "2021-05-01T00:00:00.000Z"
        }
      ],
      ...
    },
    ...
  ],
  ...
}

Example (portfolio strategy)#

{
  "name": "Portfolio strategy",
  ...
  "riskLimits": [
    {
      "type": "daily",
      "applyTo": "balance",
      "maxRisk": 0.4,
      "closePositions": true,
      "startTime": "2021-05-01T00:00:00.000Z"
    }
  ],
  ...
}

Example (subscription)#

{
  "name": "Account",
  ...
  "subscriptions": [
    {
      ...
      "riskLimits": [
        {
          "type": "daily",
          "applyTo": "balance",
          "maxRisk": 0.4,
          "closePositions": true,
          "startTime": "2021-05-01T00:00:00.000Z"
        }
      ],
      ...
    },
    ...
  ],
  ...
}

Example (account)#

{
  "name": "Account",
  ...
  "riskLimits": [
    {
      "type": "daily",
      "applyTo": "balance",
      "maxRisk": 0.4,
      "closePositions": true,
      "startTime": "2021-05-01T00:00:00.000Z"
    }
  ],
  ...
}