As of 14.03.2025, access to the XTB API service via the hosts xapi.xtb.com and ws.xtb.com has been disabled.
FairTrade is a modular Java trading platform for algorithmic trading and backtesting, built with Spring Boot for Xtb Broker. It is organized into two Maven modules:
- xstore-api: Provides integration with the XStore API for streaming, synchronization, and message management.
- fairTrade: Implements trading strategies, bots, REST controllers, and uses xstore-api for broker connectivity.
FairTrade supports several trading strategies, each implemented as a separate class:
- Double SMA Strategy: Uses two Simple Moving Averages (SMA) to generate buy/sell signals based on crossovers.
- Ichimoku Strategy: Utilizes the Ichimoku Kinko Hyo indicator to identify trends, support/resistance, and momentum.
- ThreeUT Ichimoku Strategy: An advanced variant of Ichimoku, combining multiple timeframes for signal confirmation.
Each strategy can be backtested using historical data and run live via the trading bots. Strategies are extensible and can be customized or new ones added in the strategy/ package.
- Build all modules
mvn clean install
- Run the FairTrade application
java -jar fairTrade-<version>.jar
- Run via Docker
docker build --tag=trading-app:<version> . docker run -p8080:8080 trading-app:<version>
- Configuration files are located in
fairTrade/src/main/resources/:application.yaml: Spring Boot configuration
- xstore-api: Contains all classes for XStore API communication.
- fairTrade: Contains trading logic, strategies, bots, REST controllers, and uses xstore-api as a dependency.