This repository contains two projects:
- Crypto Tracker Bot – a Node.js service that fetches prices and news and sends alerts via Slack, Discord, or Telegram. An optional server exposes sentiment and technical analysis endpoints.
- Trading Dashboard – a Python/Streamlit application found in
trading_bot/
that offers charts, backtesting, and basic machine-learning signals.
Install Node modules:
cd crypto-tracker-bot
npm install
Install Python packages (a virtual environment is recommended):
pip install -r requirements.txt
npm start
– start the crypto tracker botnpm run server
– launch the optional analysis serverauto_install_and_run.sh
– install Node modules and run both the bot and serverstreamlit run trading_bot/app.py
– start the trading dashboardstreamlit run trading_bot/strategy_explorer.py
– explore ML models and view cross-validated performance
- Start the bot:
npm start # from crypto-tracker-bot/
- Launch the HTTP server:
npm run server # from crypto-tracker-bot/
- Run the trading dashboard:
streamlit run trading_bot/app.py
- Run the strategy explorer:
streamlit run trading_bot/strategy_explorer.py
This page supports hyperparameter tuning, cross‑validated accuracy, feature-importance charts, and persists evaluation results for later review.
- Quick start both bot and server:
./auto_install_and_run.sh
The dashboard includes a simple Telegram bot. Configure a bot token and the allowed user ID then run the script:
Install dependencies in the bot directory, then run the test suite:
export TELEGRAM_BOT_TOKEN=YOUR_TOKEN
export TELEGRAM_USER_ID=123456789
python trading_bot/telegram_bot.py
Within Telegram you can issue /buy
, /sell
, and /simulate_backtest
commands
to trigger actions.
To execute trades from Telegram, use the separate telegram_exec.py
script with
a comma-separated list of authorised IDs:
export TELEGRAM_BOT_TOKEN=YOUR_TOKEN
export TELEGRAM_USER_IDS=123456789,987654321
python trading_bot/telegram_exec.py
Provide BINANCE_API_KEY
and BINANCE_API_SECRET
to send orders to Binance; otherwise trades are only simulated.
Install dependencies in the bot directory then run the Jest suite:
cd crypto-tracker-bot
npm install
npm test
Create a virtual environment, install the requirements, and execute the tests:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pytest
Install the Python requirements (a virtual environment is recommended) and run the dashboard tests from the repository root:
```bash
pip install -r requirements.txt
PYTHONPATH=. pytest trading_bot/tests
Both suites should pass once their dependencies are installed.
crypto-tracker-bot/ # Node.js bot, server, and tests
trading_bot/ # Streamlit dashboard and Python tests
auto_install_and_run.sh
requirements.txt # Python dependencies
The backtester accepts any strategy class located in trading_bot/strategies/
.
Create a module in that folder and subclass :class:Strategy
:
from trading_bot.strategies.base import Strategy
import pandas as pd
class MyStrategy(Strategy):
def generate_signals(self, df: pd.DataFrame) -> pd.Series:
"""Generate an equity curve from ``df``."""
return pd.Series([1.0] * len(df), index=df.index)
Run the backtest with your strategy:
from trading_bot.backtester import backtest
from trading_bot.strategies.my_strategy import MyStrategy
result = backtest(df, strategy=MyStrategy())
For more feature ideas, see PROPOSALS.md
.