
Distilling market chaos into alchemical insight.
Read the market's cryptic runes. Turn loss to foresight, or fade into whispered legend. Master the signals.
Trading Alchemist: Clarity from chaos, since Bitcoin was myth.
Trading Alchemist is a comprehensive trading analysis platform built with Elixir and Phoenix, leveraging TimescaleDB for efficient time-series data storage. The platform offers a robust backtesting system for cryptocurrency trading strategies with advanced analytics capabilities.
- Strategy Builder: Create, test, and refine trading strategies with flexible entry/exit rule configurations
- Backtesting Engine: Evaluate strategy performance against historical market data
- Market Data Management: Synchronization with Binance API for real-time and historical data
- Performance Analytics: Comprehensive metrics including win rate, profit factor, drawdown, Sharpe ratio
- Transaction History: Import and replay your actual trading history
- Risk Management: Configure position sizing, stop-loss, and take-profit settings
For detailed feature documentation, explore the features_docs directory, especially the backtest section containing system diagrams, API designs, and implementation guidelines.
Trading Alchemist is built with:
- Phoenix Framework: Web application and LiveView for real-time UI interactions
- Elixir: Core business logic with functional programming patterns
- PostgreSQL with TimescaleDB: Efficient storage for time-series market data
- Redis and ETS: Caching for performance optimization
- Binance API Integration: For market data retrieval
The system follows a modular architecture with contexts for:
- Strategy management
- Backtest execution
- Market data handling
- Performance analysis
- DevBox installed
- Docker and Docker Compose
- Clone the repository
- Enter the DevBox shell:
devbox shell
- Start the development environment:
devbox run dev
This will start the PostgreSQL container, migrate the database, and start the Phoenix server.
All commands are available through DevBox:
# Show all available commands
devbox run help
# Start just the database in Docker
devbox run docker.up
# Stop all Docker containers
devbox run docker.down
# Setup the database (create and migrate)
devbox run db.setup
# Reset the database (drop, create, and migrate)
devbox run db.reset
# Run database migrations
devbox run db.migrate
# Seed the database
devbox run db.seed
# Start the Phoenix server
devbox run start
# Stop the Phoenix server
devbox run stop
# Clean compiled artifacts
devbox run clean
# Setup full development environment (db + server)
devbox run dev
If you prefer not to use DevBox, you can use the Makefile directly:
# Show all available commands
make help
# Start the PostgreSQL container
make docker.up
# Start the full development environment
make dev
The application is configured to use the following environment variables for database connection:
POSTGRES_HOST
(default: "localhost")POSTGRES_USER
(default: "postgres")POSTGRES_PASSWORD
(default: "postgres")POSTGRES_DB
(default: "central_dev")POSTGRES_PORT
(default: "5433")
These are automatically set when using DevBox.
The platform provides RESTful API endpoints for:
- Authentication and session management
- Strategy CRUD operations
- Backtest execution and analysis
- Market data retrieval
For detailed API documentation, refer to the API Design docs.
This project uses TimescaleDB for efficient time-series data storage. The database is configured with hypertables for market data to optimize time-series queries.