Skip to content

ConnectorProfileTradeLock

ConnectorProfileTradeLock contains the trade lock settings per symbol which define how much slippage or price improvement is absorbed by the broker or passed on to the client. All such settings are defined in ConnectorProfileTradeLockSetting. ConnectorProfileTradeLock has the following attributes and can be accessed via the pending config or real-time config

attributes required default setting attribute type description
id Y 0 INT Uniquely identifies each TradeLock profile with a numerical value.
name Y STRING The distinctive name of the TradeLock profile.
description N STRING Optional additional details about the TradeLock profile.

ConnectorProfileTradeLockSetting

attributes required default setting attribute type description
id Y 0 INT Uniquely identifies each trade lock profile setting by a numerical value.
profile Y – INT The trade lock profile ID.
by Y – CHAR Specified as security ‘sec’ or symbol ‘sym’.
key Y – VARCHAR If ‘by’ is set to ‘sec’ the ‘key’ is either the security name or ‘*’ which acts as a wildcard.
If ‘by’ is set to ‘sym’ the ‘key’ a Symbol name.
Note : More specific rules take priority over less specific ones. For example, a setting for sym has priority over sec with a defined security, which in turn has priority over sec with * specified. Once a bucket (symbol, security or *) is selected, only its rules are considered; if none of them matches the order type and size, no rule applies and the broader buckets are not retried.
source_type Y * VARCHAR The requested trade execution type to which the settings are applied. The available order types are:

market
limit
stop
sl
tp

Note:
- Specific order_type have priority over ‘*’. For example an order_type for a ‘market’ has priority when wildcard ‘*’ is used.
- For trades originating from MT4/MT5, SL and TP-specific settings are checked first. If not defined, the system falls back to the generic order type settings.
order_size Y 0 DOUBLE The minimum order size, in symbol size units, to which the settings are applied. The full order size (after rounding to the account step) is compared, and the rule with the greatest order_size not exceeding it is selected; equal values enter the tier. Thresholds must be distinct within the same selector and source type.
target_type Y n/a VARCHAR The execution type of the trade. The available order types are:

• market
• limit
• stop
• n/a

Note: By default, ‘n/a’ keeps the original source_type unchanged.
ref_price Y tob VARCHAR Reference used for adverse and favorable price movement.

req uses a nonzero client request price; if the request price is zero, TOB handling applies.
tob uses the applicable marked-up side quote. Delayed orders may use a captured opening quote. Once a nonzero reference is established, it is retained; it does not guarantee latency-free correspondence with the market.
mode Y pass_on VARCHAR The mode which defines how ‘loss‘ or ‘gain‘ values are applied:

pass_on: the loss or gain is transferred directly to the client.
absorb: the loss or gain is absorbed by the broker.
absorb_range: absorbs the whole movement within the configured loss or gain point allowance around ref_price. Outside that allowance, the whole movement is passed to the client. Loss and gain can have different allowances.

Note: absorb_range only works with unit=point.

Example with unit=point and loss=2: an adverse movement of 5 points reaches the client as 2 points under pass_on (the rest is absorbed), as 3 points under absorb (2 points are absorbed), and in full under absorb_range because it exceeds the 2-point allowance; a 1-point movement would be absorbed entirely under absorb_range.
unit Y percent VARCHAR Defines the units for loss and gain:

percent: fractions from 0 to 1, where 0.2 means 20%.
point: multiples of the Symbol price_unit, using a nonnegative value or -1. The -1 allowance passes all movement in pass_on mode and absorbs all movement in absorb or absorb_range mode. These units are not universally FX pips.
loss Y 1 DOUBLE Loss value relative to the specified ‘unit‘, caused by execution at a worse price than the defined ref_price.

If mode is absorb, this is the amount the broker absorbs. If mode is pass_on, this is the amount passed on to the client.
gain Y 1 DOUBLE Gain value relative to the specified ‘unit‘, caused by execution at a better price than the defined ref_price.

If mode is absorb, this is the amount the broker absorbs. If mode is pass_on, this is the amount passed on to the client.
dev N 0 BOOLEAN For effective LIMIT orders with a selected TradeLock rule, allows additional execution tolerance according to the loss policy. Its effect depends on existing request deviation, the reference and the absorption allowance; point-based deviation uses whole-point handling. It is not restricted to MT4/MT5 and does not by itself guarantee a fill or preservation of the original client limit.

Configuration Examples

Consider the following TradeLock settings:

id profile by key order_type order_size mode unit loss gain
0 0 sec * * 0 pass_on percent 0.5 0.5
1 0 sec * * 100000 pass_on percent 0.7 0.7
2 0 sec * * 200000 pass_on percent 1 1
3 0 sec FX * 0 pass_on percent 0.5 0.5
4 0 sec FX * 100000 pass_on percent 0.7 0.7
5 0 sec FX * 200000 pass_on percent 1 1
6 0 sym EURUSD * 0 pass_on percent 0.5 0.5
7 0 sym EURUSD market 50000 absorb point 2 2
8 0 sym EURUSD market 100000 absorb point 4 4
9 0 sym EURUSD market 200000 absorb point -1 -1
Example 1: EURUSD Market Order

For a EURUSD Market order, the following rules will apply:

id profile by key order_type order_size mode unit loss gain
7 0 sym EURUSD market 50000 absorb point 2 2
8 0 sym EURUSD market 100000 absorb point 4 4
9 0 sym EURUSD market 200000 absorb point -1 -1

Explanation:

  • For market orders below 50,000, the populated market-specific list has no eligible tier. Rule ID 6 is not retried. No TradeLock rule is selected, so the legacy improvements fallback can still affect pricing. Add an explicit zero-size market rule if a baseline market rule is required.
  • For order_type Market trades from 50,000 to smaller than 100,000, the system will be absorbing only two points of gain and loss. (Rule ID 7)
  • For order_type Market trades from 100,000 to smaller than 200,000, the system will be absorbing four points of gain and loss. (Rule ID 8)
  • For order_type Market trades equal to or greater than 200,000, the system will be absorbing ALL of the gain and loss as '-1' is specified as a value in both 'loss' and 'gain'. (Rule ID 9)
Example 2: EURUSD Limit Order

For a EURUSD Limit order, the following rule will apply as it is covered by the more generic ‘order_type’ rule for ‘sym’ ‘EURUSD’:

id profile by key order_type order_size mode unit loss gain
6 0 sym EURUSD * 0 pass_on percent 0.5 0.5

Explanation:

  • Apply general rule for ‘sym’ EURUSD: pass on 50% gain and loss. (Rule ID 6)
Example 3: BTCUSD FOK Order

For a BTCUSD FOK order, the following rules will apply as BTCUSD is covered by the more generic rules:

id profile by key order_type order_size mode unit loss gain
0 0 sec * * 0 pass_on percent 0.5 0.5
1 0 sec * * 100000 pass_on percent 0.7 0.7
2 0 sec * * 200000 pass_on percent 1 1

Explanation:

  • For trades of any security 'sec' and which have an order_size between 0 and smaller than 100,000, the system will be passing on 50% of gain and loss. (Rule ID 0)
  • For trades of any security 'sec' and which have an order_size between 100,000 and smaller than 200,000, the system will be passing on 70% of gain and loss. (Rule ID 1)
  • For trades of any security 'sec' and which have an order_size equal to or greater than 200,000, the system will be passing on 100% of gain and loss. (Rule ID 2)