Skip to content

Configure risk limits#

Overview#

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

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
  • subscriber

The schema for this setting is described in StrategyRiskLimit document.

This setting is additive and overridable. This means that CopyFactory will apply the setting to each of the contexts in which the setting is specified. However, the risk limits using the same applyTo, type and closePositions setting down the subscription configuration chain override the corresponding previous risk limit in the subscription configuration chain.

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 strategy stop outs API or Reset subscriber stop outs API depending on the level where the risk limit is located.

Example (strategy)#

{
  "name": "Strategy",
  ...
  "riskLimits": [
    {
      "type": "day",
      "applyTo": "balance-difference",
      "maxAbsoluteRisk": 0.05,
      "maxRelativeRisk": 0.4,
      "closePositions": true,
      "startTime": "2021-05-01T00:00:00.000Z"
    }
  ],
  ...
}

Example (member of a portfolio strategy)#

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

Example (portfolio strategy)#

{
  "name": "Portfolio strategy",
  ...
  "riskLimits": [
    {
      "type": "day",
      "applyTo": "balance-difference",
      "maxAbsoluteRisk": 0.05,
      "maxRelativeRisk": 0.4,
      "closePositions": true,
      "startTime": "2021-05-01T00:00:00.000Z"
    }
  ],
  ...
}

Example (subscription)#

{
  "name": "Subscriber",
  ...
  "subscriptions": [
    {
      ...
      "riskLimits": [
        {
          "type": "day",
          "applyTo": "balance-difference",
          "maxAbsoluteRisk": 0.05,
          "maxRelativeRisk": 0.4,
          "closePositions": true,
          "startTime": "2021-05-01T00:00:00.000Z"
        }
      ],
      ...
    },
    ...
  ],
  ...
}

Example (subscriber)#

{
  "name": "Subscriber",
  ...
  "riskLimits": [
    {
      "type": "day",
      "applyTo": "balance-difference",
      "maxAbsoluteRisk": 0.05,
      "maxRelativeRisk": 0.4,
      "closePositions": true,
      "startTime": "2021-05-01T00:00:00.000Z"
    }
  ],
  ...
}