WebAPI provides 11 production-ready services that abstract the complexity of MetaTrader 4, MetaTrader 5, cTrader, and B2Trader into a consistent, type-safe gRPC interface.
Account Service
Full CRUD operations for trading accounts across all platforms. Create accounts, manage passwords, check margin levels, and perform batch reads. Unified Account model maps to MT4 UserRecord, MT5 User, cTrader Trader, and B2Trader Account.
Create, Read, Update, Delete
Margin Level monitoring
Batch operations
Password management
Platform-specific fields support
account_service.protogRPC
AccountService.Create("login", "group")
Balance Service
Execute balance operations with 17 distinct action types. From deposits and credits to commissions, dividends, and agent fees — all through a single, platform-agnostic API.
Manage the full order lifecycle. 9 order types from market buys to stop-limits, 10 order states from placement to execution. Batch operations for high-throughput scenarios.
9 order types (Buy, Sell, Limits, Stops, StopLimits, CloseBy)
10 order states tracking
Batch delete and read
Position and symbol filtering
order_service.protogRPC
OrderService.CreateMarket("EURUSD", 0.1)
Position Service
Open, close, and monitor trading positions. Support for close-by operations, partial closes, and batch processing. Real-time P&L tracking with rate conversion.
Open and close positions
Close-by (hedge) operations
Batch create and close
Real-time profit tracking with rate conversion
position_service.protogRPC
PositionService.Close("position_id")
Deal Service
Access complete deal history. Every executed trade is recorded with full details — price, volume, commission, swaps, profit, and conversion rates.
Complete deal history
4 deal actions (Buy, Sell, Canceled variants)
4 deal entries (In, Out, InOut, OutBy)
Batch reads and time-range queries
deal_service.protogRPC
DealService.Read("account_id", "from", "to")
Symbol Service
Retrieve symbol configurations including trade modes, schedules, margin calculation modes, swap rates, and contract specifications. Supports 6+ trade modes and 10+ calculation modes.
Access real-time and historical price data. Get the latest bid/ask for any symbol, batch queries for multiple symbols, and historical tick ranges.
Real-time last tick data
Batch last tick queries
Historical tick ranges
Subscribe to selected symbols
tick_service.protogRPC
TickService.LastTick("EURUSD")
Group Service
Manage trading groups with their associated security settings, margin requirements, and permissions. Maps to MT4 ConGroup, MT5 Group, cTrader Group, and B2Trader Group.
Group listing and details
Security settings per group
Margin call and stop-out levels
Lot min/max/step configuration
group_service.protogRPC
GroupService.List("platform_id")
Realtime Service
gRPC server-streaming for live updates. Subscribe to accounts, positions, orders, deals, ticks, symbols, groups, and balance operations. Support for durable and ephemeral consumers.
Manage authentication credentials for multiple trading platforms. A single token can resolve to MT4, MT5, cTrader, or B2Trader credentials with platform-specific connection details.
WebAPI returns strongly-typed gRPC status codes. Platform-specific errors are mapped to unified error types. Over 100 platform-specific error codes are handled.
Examples of error types: InvalidArgument, NotFound, PermissionDenied, ResourceExhausted
Error handling exampleprotobuf
// Error handling is unified across all platformsrpcCreate(CreateAccountRequest) returns (Account);
// Returns: InvalidArgument if parameters are invalid// Returns: PermissionDenied if credentials don't allow this action// Returns: Internal if the platform reports an unexpected error
Volume Normalization
WebAPI normalizes volumes to a standard format (1/100,000,000 lot) across all platforms. This eliminates discrepancies between MT4's lot system, MT5's volume units, and cTrader's volume representation, and B2Trader's format. Your application always works with the same scale.