Class SynchronizationListener

    • Constructor Detail

      • SynchronizationListener

        public SynchronizationListener()
    • Method Detail

      • onConnected

        public CompletableFuture<Void> onConnected()
        Invoked when connection to MetaTrader terminal established
        Returns:
        completable future which resolves when the asynchronous event is processed
      • onDisconnected

        public CompletableFuture<Void> onDisconnected()
        Invoked when connection to MetaTrader terminal terminated
        Returns:
        completable future which resolves when the asynchronous event is processed
      • onBrokerConnectionStatusChanged

        public CompletableFuture<Void> onBrokerConnectionStatusChanged​(boolean connected)
        Invoked when broker connection satus have changed
        Parameters:
        connected - is MetaTrader terminal is connected to broker
        Returns:
        completable future which resolves when the asynchronous event is processed
      • onAccountInformationUpdated

        public CompletableFuture<Void> onAccountInformationUpdated​(MetatraderAccountInformation accountInformation)
        Invoked when MetaTrader account information is updated
        Parameters:
        accountInformation - updated MetaTrader account information
        Returns:
        completable future which resolves when the asynchronous event is processed
      • onPositionUpdated

        public CompletableFuture<Void> onPositionUpdated​(MetatraderPosition position)
        Invoked when MetaTrader position is updated
        Parameters:
        position - updated MetaTrader position
        Returns:
        completable future which resolves when the asynchronous event is processed
      • onPositionRemoved

        public CompletableFuture<Void> onPositionRemoved​(String positionId)
        Invoked when MetaTrader position is removed
        Parameters:
        positionId - removed MetaTrader position id
        Returns:
        completable future which resolves when the asynchronous event is processed
      • onOrderUpdated

        public CompletableFuture<Void> onOrderUpdated​(MetatraderOrder order)
        Invoked when MetaTrader order is updated
        Parameters:
        order - updated MetaTrader order
        Returns:
        completable future which resolves when the asynchronous event is processed
      • onOrderCompleted

        public CompletableFuture<Void> onOrderCompleted​(String orderId)
        Invoked when MetaTrader order is completed (executed or canceled)
        Parameters:
        orderId - completed MetaTrader order id
        Returns:
        completable future which resolves when the asynchronous event is processed
      • onHistoryOrderAdded

        public CompletableFuture<Void> onHistoryOrderAdded​(MetatraderOrder historyOrder)
        Invoked when a new MetaTrader history order is added
        Parameters:
        historyOrder - new MetaTrader history order
        Returns:
        completable future which resolves when the asynchronous event is processed
      • onDealAdded

        public CompletableFuture<Void> onDealAdded​(MetatraderDeal deal)
        Invoked when a new MetaTrader history deal is added
        Parameters:
        deal - new MetaTrader history deal
        Returns:
        completable future which resolves when the asynchronous event is processed
      • onDealSynchronizationFinished

        public CompletableFuture<Void> onDealSynchronizationFinished​(String synchronizationId)
        Invoked when a synchronization of history deals on a MetaTrader account have finished
        Parameters:
        synchronizationId - synchronization request id
        Returns:
        completable future which resolves when the asynchronous event is processed
      • onOrderSynchronizationFinished

        public CompletableFuture<Void> onOrderSynchronizationFinished​(String synchronizationId)
        Invoked when a synchronization of history orders on a MetaTrader account have finished
        Parameters:
        synchronizationId - synchronization request id
        Returns:
        completable future which resolves when the asynchronous event is processed
      • onSymbolSpecificationUpdated

        public CompletableFuture<Void> onSymbolSpecificationUpdated​(MetatraderSymbolSpecification specification)
        Invoked when a symbol specification was updated
        Parameters:
        specification - updated MetaTrader symbol specification
        Returns:
        completable future which resolves when the asynchronous event is processed
      • onSymbolPriceUpdated

        public CompletableFuture<Void> onSymbolPriceUpdated​(MetatraderSymbolPrice price)
        Invoked when a symbol price was updated
        Parameters:
        price - updated MetaTrader symbol price
        Returns:
        completable future which resolves when the asynchronous event is processed