Skip to content

SetQuotePolicy

Creates a policy when id is omitted. Updates an existing non-system policy when id is present. The complete sources array replaces the previous source list.

Access control

Allowed sessions: SESSION_MANAGER, SESSION_ADMIN. Requires scope access_backoffice and permission set_accounts.

Create request

{
  "name": "EURUSD primary and backup",
  "mode": 2,
  "failover_after_ms": 2000,
  "recovery_after_ms": 10000,
  "minimum_active_ms": 30000,
  "switch_back_mode": 1,
  "unavailable_action": 1,
  "reject_crossed_price": true,
  "max_spread_points": 50,
  "max_price_jump_points": 100,
  "max_switch_deviation_points": 30,
  "max_future_time_ms": 2000,
  "max_past_time_ms": 10000,
  "enabled": true,
  "sources": [
    {
      "provider_type": 2,
      "provider_id": 3,
      "priority": 200,
      "enabled": true,
      "stale_after_ms": 3000,
      "max_spread_points": 0,
      "max_price_jump_points": 0
    },
    {
      "provider_type": 1,
      "provider_id": 7,
      "priority": 100,
      "enabled": true,
      "stale_after_ms": 5000,
      "max_spread_points": 0,
      "max_price_jump_points": 0
    }
  ]
}

For an update, send the same complete object with its positive id.

Response

{
  "id": 3
}

Validation

  • name and sources are required;
  • non-system policies require at least one source;
  • no more than 8 sources are allowed;
  • provider_type must be 1, 2, or 3;
  • provider_id and stale_after_ms must be positive;
  • (provider_type, provider_id) must be unique in a policy;
  • system policies cannot be updated.

Setting enabled to false automatically moves all symbols using the policy to system policy 1. This has the same fail-closed behavior as deleting the policy and does not require updating each symbol separately.