Brokeret LogoDocs
Plugins / Smart Execution/API

API

REST API reference for the Smart Execution plugin.

Authentication

All endpoints require authentication via one of:

  • Header: X-API-Key: <your_api_key>
  • Header: Authorization: Bearer <your_api_key>

The default API key is default. Change it via the API_Key plugin parameter in MT5 Administrator. Leave API_Key empty to disable the API entirely.

Base URL

http://<server_ip>:<API_Port>/api/

Default port: 8444

GET/api/status

Returns plugin status and summary statistics.

{
  "plugin": "Brokeret Smart Execution",
  "version": "2.0",
  "license_active": true,
  "rules_loaded": 3,
  "whitelist": {
    "accounts": 1,
    "groups": 2
  },
  "pnl_tracking": {
    "enabled": true,
    "account": 99999
  },
  "today": {
    "total_closes": 4521,
    "fast_closes": 312,
    "slippage_applied": 287,
    "profit_captured": 8432.50
  }
}

GET/api/rules

Returns all configured slippage rules.

{
  "rules": [
    {
      "rule_id": 1,
      "scope": "group",
      "scope_value": "real\\*",
      "enabled": true,
      "threshold_seconds": 120,
      "mode": "fixed_pips",
      "slippage_value": 1.50,
      "slippage_unit": "pips",
      "apply_on": "profitable",
      "min_profit": 0.00,
      "min_volume": 0.00,
      "max_slippage_cap": 0.00,
      "symbol_filter": "*",
      "priority": 0
    }
  ],
  "total": 1
}

POST/api/rules

Create a new slippage rule.

Group Rule Example

{
  "scope": "group",
  "group_mask": "real\\retail\\*",
  "enabled": true,
  "threshold_seconds": 120,
  "mode": "fixed_pips",
  "slippage_value": 2.0,
  "slippage_unit": "pips",
  "apply_on": "profitable",
  "symbol_filter": "*",
  "priority": 10
}

Account Rule Example

{
  "scope": "account",
  "account_logins": [10005, 10006, 10007],
  "enabled": true,
  "threshold_seconds": 60,
  "mode": "percent_profit",
  "slippage_value": 20.0,
  "apply_on": "profitable",
  "symbol_filter": "BTCUSD,ADAUSD",
  "priority": 100
}

Request Fields

FieldTypeRequiredDefaultDescription
scopeStringYes"group" or "account"
group_maskStringIf scope=groupMT5 group pattern (e.g. "real\\retail\\*")
account_loginsArrayIf scope=accountArray of account login numbers
enabledBooleanNotrueEnable/disable the rule
threshold_secondsIntegerNo120Time threshold in seconds
modeStringNo"fixed_pips""fixed_pips", "percent_profit", or "scaled_time"
slippage_valueNumberNo1.5Pips/points (fixed), percentage (percent), or ignored (scaled)
slippage_unitStringNo"pips""pips" or "points"
apply_onStringNo"profitable""profitable" or "all"
min_profitNumberNo0Minimum profit filter ($)
min_volumeNumberNo0Minimum volume filter (lots)
max_slippage_capNumberNo0Max slippage cap (pips), 0 = unlimited
symbol_filterStringNo"*"Comma-separated symbols or "*"
priorityIntegerNo0Higher = checked first within same scope
time_tiersArrayIf mode=scaled_timeArray of {"max_seconds": N, "slippage_pips": N}

Response (201)

{
  "success": true,
  "rule_id": 3,
  "total": 3
}

PUT/api/rules/{id}

Update an existing rule. Only include the fields you want to change.

Request Body

{
  "slippage_value": 3.0,
  "enabled": false
}

Response (200)

{
  "success": true,
  "rule_id": 2
}

DELETE/api/rules/{id}

Remove a slippage rule.

{
  "success": true
}

GET/api/stats

Returns today's statistics (resets at midnight UTC).

{
  "date": 20260227,
  "total_closes": 4521,
  "fast_closes": 312,
  "slippage_applied": 287,
  "skipped_unprofitable": 25,
  "total_profit_captured": 8432.50,
  "avg_slippage_pips": 1.70
}

GET/api/daily_summary

Returns today's live stats plus the last 30 days of aggregated daily PNL history.

{
  "today": {
    "date": 20260227,
    "total_closes": 4521,
    "fast_closes": 312,
    "slippage_applied": 287,
    "total_profit_captured": 8432.50
  },
  "history": [
    {
      "date": 20260226,
      "total_closes": 5123,
      "fast_closes": 400,
      "slippage_applied": 370,
      "total_profit_captured": 11240.00
    }
  ]
}

GET/api/whitelist

Returns all whitelisted accounts and groups.

{
  "accounts": [50123, 50456],
  "groups": ["real\\vip\\*", "real\\institutional\\*"]
}

POST/api/whitelist/{login}

Exempt an account from all slippage rules.

{
  "success": true,
  "login": 50123
}

DELETE/api/whitelist/{login}

Remove an account from the whitelist.

{
  "success": true
}

POST/api/whitelist_group

Exempt an MT5 group (with wildcard support) from slippage.

Request Body

{
  "group_mask": "real\\vip\\*"
}

Response (201)

{
  "success": true,
  "group_mask": "real\\vip\\*"
}

DELETE/api/whitelist_group

Remove a group from the whitelist.

Request Body

{
  "group_mask": "real\\vip\\*"
}

Response

{
  "success": true
}

GET/api/pnl_tracking

Returns current PNL tracking configuration.

{
  "enabled": true,
  "account": 99999
}

PUT/api/pnl_tracking

Update the PNL tracking account. Set account to 0 to disable.

Request Body

{
  "account": 99999
}

Response

{
  "success": true,
  "enabled": true,
  "account": 99999
}

Error Responses

All errors return JSON:

{
  "error": "description of the error"
}
StatusMeaning
400Bad request (invalid JSON or missing fields)
401Unauthorized (missing or invalid API key)
404Not found (unknown endpoint or rule ID)
405Method not allowed
500Internal server error