Skip to content

11 Services

Unified API Services

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.

  • 17 action types (Balance, Credit, Bonus, Commission...)
  • Single and batch operations
  • Full audit trail with ticket IDs
  • Time-range filtering
balance_service.protogRPC
BalanceService.Deposit(1000, "USD")

Order Service

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.

  • Symbol specifications and configurations
  • Trade mode management (Full, CloseOnly, LongOnly...)
  • Schedule and session data
  • Margin tier configuration
symbol_service.protogRPC
SymbolService.Read("EURUSD")

Tick Service

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.

  • 8 event subjects (Account, Order, Position, Deal...)
  • 3 selectors (Create, Update, Delete)
  • Durable consumers with sequence tracking
  • Ephemeral consumers for real-time UIs
realtime_service.protogRPC
RealtimeService.Subscribe("Position")

Credentials Service

Manage authentication credentials for multiple trading platforms. A single token can resolve to MT4, MT5, cTrader, or B2Trader credentials with platform-specific connection details.

  • Multi-platform authentication
  • MT4: address + login + password
  • MT5: address + login + password
  • cTrader: address + login + password + plant ID + environment
  • B2Trader: native API credentials
credentials_service.protogRPC
CredentialsService.Resolve("token")

Report Service

Sync trading platform data into PostgreSQL for analytics and reporting. Supports all entity types across MT4, MT5, cTrader, and B2Trader.

  • PostgreSQL credentials management
  • Sync MT4 entities (Groups, Symbols, Accounts, Trades)
  • Sync MT5 entities (Orders, Groups, Symbols, Deals, Users, Positions)
  • Sync cTrader entities (20+ entity types)
  • Sync status and statistics
report_service.protogRPC
ReportService.Sync("postgres://...")

realtimeDiagramTitle

realtimeDiagramSubtitle

Platform
MT4 / MT5 / cTrader / B2Trader

Trading events originate here

events
WebAPI
Realtime Service

Listens to platform events

AccountEventsPositionEventsOrderEventsDealEventsTickEvents
CreateUpdateDelete
DurableConsumerResume from sequence number
stream
Your App
Subscribe

Receives real-time updates

Error Handling

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 platforms
rpc Create(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.

Explore More

See supported platforms and pricing options.