An open API service indexing awesome lists of open source software.

https://github.com/nguyennhukhanh/predict


https://github.com/nguyennhukhanh/predict

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# Crypto Quant Trading Prediction API

Advanced quantitative cryptocurrency trading signal generator with machine learning enhancements.

## Features

- **Multiple Trading Strategies**:
- Trend Following Strategy (ideal for trending markets)
- Mean Reversion Strategy (ideal for ranging markets)
- ML-Enhanced Strategy (combines both with machine learning)

- **High Precision Calculations**:
- Uses BigDecimal for precise calculations
- Advanced technical indicators
- Market sentiment analysis

- **Data Enhancement**:
- Order flow analysis
- Market sentiment integration
- On-chain metrics for crypto assets

- **Backtesting Capabilities**:
- Test strategies against historical data
- Calculate win rates, profit factors, and drawdowns
- Evaluate strategy performance

## Quick Start

1. Install dependencies:
```bash
bun install
```

2. Start the server:
```bash
bun start
```

3. Open in your browser:
```
http://localhost:1505
```

## API Endpoints

### Get Available Strategies
```
GET /api/strategies
```

Returns all available trading strategies with their details.

### Generate Trading Prediction
```
GET /api/predict?symbol=BTCUSDT&timeframe=1h&strategy=trend-following&enhance=true
```

Parameters:
- `symbol`: Trading pair (e.g., BTCUSDT)
- `timeframe`: Candle timeframe (1m, 5m, 15m, 30m, 1h, 4h, 1d)
- `strategy`: Strategy ID (trend-following, mean-reversion, ml-enhanced)
- `enhance`: Whether to enhance data with additional metrics (true/false)

### Run Backtest
```
GET /api/backtest?symbol=BTCUSDT&timeframe=1h&strategy=trend-following&limit=1000
```

Parameters:
- `symbol`: Trading pair (e.g., BTCUSDT)
- `timeframe`: Candle timeframe (5m, 15m, 30m, 1h, 4h, 1d)
- `strategy`: Strategy ID (trend-following, mean-reversion, ml-enhanced)
- `limit`: Number of candles to backtest (default: 1000)

## Strategy Comparison

| Strategy | Best For | Win Rate | Profit Factor | Max Drawdown |
|----------|----------|----------|---------------|--------------|
| Trend Following | Strong trends | ~76% | ~2.1 | ~15% |
| Mean Reversion | Range-bound markets | ~72% | ~1.8 | ~12% |
| ML-Enhanced | Mixed market conditions | ~79% | ~2.3 | ~14% |

*Note: Actual results may vary based on market conditions.*

## Technical Indicators Used

- **Trend Following**:
- Moving Average Convergence Divergence (MACD)
- Exponential Moving Averages (EMA20, EMA50, EMA100, EMA200)
- Relative Strength Index (RSI)
- Average Directional Index (ADX)
- On-Balance Volume (OBV)
- Average True Range (ATR)

- **Mean Reversion**:
- Bollinger Bands
- Stochastic RSI
- Percent B
- Rate of Change (ROC)
- Support/Resistance Levels
- Volume Profile

## Enhancement

For optimal results:
- Use the 1h or 4h timeframe for most reliable signals
- The ML-Enhanced strategy works best in mixed or uncertain markets
- Enable data enhancement for more accurate predictions
- Use the backtest API to evaluate strategy performance on specific pairs

## License

Copyright (c) 2025. All rights reserved.