Skip to content

Calculate Commission

Returns the commission amount for the requested account, symbol, volume, order side, and opening price. It resolves the same commission settings used by trade processing.

GET

https://{some_domain}/calc/commission

Access

This action declares no command-specific session-type restriction or manager permission and does not require a token. If a token is supplied, the common HTTP pipeline rejects it when invalid. The handler does not verify that the requesting identity owns the login being calculated.

Request

Query Parameters

Field Type Required Description
login integer Yes Trading account login.
open_price number Yes Trade opening price used for the preview.
volume integer Yes Volume in the server's integer trading-volume units (100 units = 1.00 lot).
cmd integer No Trade side: 0 = BUY, 1 = SELL. Defaults to 0 (BUY).
symbol string Yes Exact symbol name.

Request Example

GET https://{some_domain}/calc/commission?login=100001&open_price=1.105&volume=100&cmd=0&symbol=EURUSD

Commission resolution and calculation

The complete commission triplet is selected in this order: Security (matched directly by symbol.sec_index) → enabled Symbol override → enabled Group Security override for that sec_index → enabled Group Symbol override for the exact symbol name. Parent Security records are not traversed. Each enabled override replaces all three values; commission_enable: 1 with a zero rate means explicitly zero commission.

The fields are comm_base (finite, signed rate/value), comm_type (0 money, 1 points, 2 percent), and comm_lots (0 per lot, 1 per deal). The integer volume is converted to lots by dividing by 100. For per-deal mode, quantity is 1; otherwise it is the converted lot quantity. The returned amount is in account currency and is normally negative for a charge:

Type Calculation
Money (0) -comm_base × quantity
Percent (2) -quantity × open_price × contract_size × comm_base / 100
Points (1) -comm_base × quantity × contract_size × point × quote_to_account_rate

Money is already in account currency. Percent uses the nominal formula shown; it does not apply FX conversion. Points use the BUY/SELL side to resolve the quote-to-account conversion. If that conversion is unavailable, the current calculation returns 0.

In trade processing, commission is charged when the position opens or a pending order activates. The stored commission is included when the position closes; a partial close prorates that stored amount and does not add a second close-only commission. This endpoint is a preview and does not create a trade.

Success Response (200)

Field Type Description
commission number Calculated amount in account currency.
{
  "commission": -2.5
}

Errors

HTTP Error Description
400 INVALID_DATA A required parameter is absent or malformed, or cmd is outside 0–1. The response includes a message describing validation failure.
401 — A supplied token is invalid and rejected by the common HTTP token check. A token is not required by this action.

Account, symbol, or group lookup failures use the handler's legacy raw-return path. The handler does not construct a structured error response for these failures, so this page does not assign them HTTP statuses or error codes.

Example validation response:

{
  "error": "INVALID_DATA",
  "message": "Field 'cmd' must be less than or equal to 1"
}