Introduction
An overview of the Bonus Manager plugin for automated credit bonus management.
What is Bonus Manager?
Brokeret Bonus Manager is a native C++ MT5 Server Plugin that automatically manages credit bonuses on client deposits. It handles bonus granting, withdrawal clawback, convertible credit-to-balance bonuses, and equity-based drawdown protection — all running inside the MT5 Trade Server process.
How It Works
- Client makes a qualifying deposit
- Plugin matches the deposit against active campaigns (group mask, min/max deposit)
- Credit is automatically granted via
DEAL_CREDIT - On withdrawal: credit is removed (full) or reduced (proportional) based on campaign settings
- For convertible bonuses: credit converts to real balance as the client trades
- Drawdown protection monitors equity and intervenes when thresholds are breached
- All activity is logged to the MT5 server journal and accessible via the REST API
Bonus Types
Credit (Standard)
Standard non-withdrawable credit bonus. Applied as DEAL_CREDIT on the MT5 account. Cannot be withdrawn by the client — only removed by the plugin based on withdrawal rules, expiry, or manual revocation.
Convertible
Credit that progressively converts to real withdrawable balance as the client trades. The initial grant is non-withdrawable credit. As the client closes trades, a portion of the credit is removed and the same amount is added as withdrawable balance.
Conversion formula:
per_lot = bonus_amount / lots_required- Each qualifying trade close:
convert = deal_lots × per_lot(capped at remaining credit) - Fully converted when all required lots are traded
Lot Tracking Scopes:
| Scope | Behavior |
|---|---|
| All | Every closed trade counts toward conversion |
| Post-Bonus | Only trades executed after the bonus was granted |
| Symbol Filtered | Only trades on symbols matching the campaign's symbol_filter |
| Per-Trade Threshold | Only trades where volume meets the per_trade_min_lots minimum |
Campaign System
Campaigns define the rules for automatic bonus grants. Each campaign specifies:
- Group targeting — MT5 group wildcard to target specific account groups (e.g.
real\*) - Bonus percentage — Percentage of the deposit to grant as credit
- Deposit range — Min/max qualifying deposit amounts
- Withdrawal mode — Remove all credit on withdrawal, or reduce proportionally
- Limits — One-per-account, max concurrent bonuses per account
- Expiry — Automatically expire bonuses after N days
- Drawdown protection — Equity-based protection mode
Withdrawal Handling
Remove All Mode
Any withdrawal triggers complete removal of all active bonus credit for that account.
Proportional Mode
Bonus credit is reduced in proportion to the withdrawal amount. For example, if a client withdraws 40% of their balance, each active bonus is reduced by 40%.
Convertible on Withdrawal
For convertible bonuses, all unconverted credit is removed immediately on any withdrawal. Already-converted amounts remain as the client's real balance.
Drawdown Protection
Tradeable Mode
Lenient — the bonus credit acts as extra equity/margin. The client can freely trade using the bonus as a buffer.
- Trigger: Equity drops to $0 (client has lost everything including bonus)
- Action: Close all open positions, remove all bonus credit
Non-Tradeable Mode
Strict — prevents clients from trading purely on bonus funds.
- Trigger: Equity falls below credit (client's own funds are exhausted)
- Action: Close all open positions, remove all bonus credit
Key Features
- Automated Deposit Triggers — Bonuses granted automatically when clients deposit
- Two Bonus Types — Standard credit or convertible credit-to-balance
- Flexible Withdrawal Rules — Full removal or proportional reduction
- Equity Protection — Tradeable and non-tradeable drawdown modes
- Campaign Management — Full CRUD via REST API with group targeting
- Expiry System — Auto-expire bonuses after configurable days
- Orphaned Credit Cleanup — Automatically detects and removes stale credit
- Manual Grant & Revoke — Grant or revoke bonuses via the API at any time
- Activity Log — Last 500 actions with filtering by login
- Daily Statistics — Grants, removals, conversions, expirations, and amounts
Next Steps
- Installation — Get the plugin running on your MT5 server
- Parameters — Configure campaigns and plugin settings
- API Reference — Manage campaigns, bonuses, and stats via REST