Trading Engine Integration

Trading Engine Integration gRPC API

Messages and Data Structures

EngineActivePositionGrpcModel

Represents an active position with all its details.

message EngineActivePositionGrpcModel {
    string TraderId = 1;
    string AccountId = 2;
    string Id = 3;
    string AssetPair = 4;
    EnginePositionSideGrpcModel Side = 5;
    double ContractSize = 6;
    double LotsAmount = 7;
    uint64 Created = 8;
    string ProcessIdCreate = 9;
    uint64 LastUpdateDate = 10;
    string LastUpdateProcessId = 11;
    string Base = 12;
    string Quote = 13;
    string Collateral = 14;

    optional double TpInProfit = 15;
    optional double SlInProfit = 16;
    optional double TpInAssetPrice = 17;
    optional double SlInAssetPrice = 18;
    map<string, string> Metadata = 19;

    string OpenProcessId = 20;
    uint64 OpenDate = 21;
    EngineBidAsk OpenBidAsk = 22;
    double OpenPrice = 23;
    EngineBidAsk ActiveBidAsk = 24;
    double ActivePrice = 25;
    EngineBidAsk MarginBidAsk = 26;
    double MarginPrice = 27;
    EngineBidAsk ProfitBidAsk = 28;
    double ProfitPrice = 29;
    double Profit = 30;
    double Commissions = 31;
    double Swaps = 32;
}

EngineClosedPositionGrpcModel

Represents a closed position with all its details.


EnginePendingOrderGrpcModel

Represents a pending order.


EngineBidAsk

Represents the bid/ask prices for an instrument.


EngineOperationCode

Defines possible operation statuses.


EngineClosePositionReason

Defines reasons for closing a position.


EnginePositionSideGrpcModel

Defines the position side (buy/sell).


EnginePendingOrderType

Defines the type of pending order.


Contracts

OpenPendingOrderGrpcRequest

Used to place a pending order.


OpenPendingGrpcResponse

Response message for placing a pending order.


CancelPendingOrderGrpcRequest

Used to cancel a pending order.


CancelPendingGrpcResponse

Response message for canceling a pending order.


UpdatePendingOrderSlTpGrpcRequest

Used to update the Stop Loss and Take Profit levels for a pending order.


UpdatePendingOrderTpSlResponse

Response message for updating Stop Loss and Take Profit for a pending order.


GetPendingOrdersGrpcRequest

Used to retrieve all pending orders.


OpenPositionGrpcRequest

Used to open a new active position.


OpenPositionGrpcResponse

Response message for opening a position.


ClosePositionGrpcRequest

Used to close an active position.


ClosePositionGrpcResponse

Response message for closing a position.


UpdateActiveSlTpGrpcRequest

Used to update the Stop Loss and Take Profit levels for an active position.


UpdateActiveSlTpGrpcResponse

Response message for updating Stop Loss and Take Profit for an active position.


GetActivePositionsGrpcRequest

Used to retrieve all active positions.


gRPC Service: EngineIntegrationGrpcService

This service manages all trading operations, including pending orders, active positions, and position updates.

Last updated