Skip to content

elithaxxor/army-bots

Repository files navigation

Crypto Tracker Bot and Trading Dashboard

This repository contains two projects:

  1. 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.
  2. Trading Dashboard – a Python/Streamlit application found in trading_bot/ that offers charts, backtesting, and basic machine-learning signals.

Installing Dependencies

Install Node modules:

cd crypto-tracker-bot
npm install

Install Python packages (a virtual environment is recommended):

pip install -r requirements.txt

Available Scripts

  • npm start – start the crypto tracker bot
  • npm run server – launch the optional analysis server
  • auto_install_and_run.sh – install Node modules and run both the bot and server
  • streamlit run trading_bot/app.py – start the trading dashboard
  • streamlit run trading_bot/strategy_explorer.py – explore ML models and view cross-validated performance

Running

  • 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

Telegram Bot

The dashboard includes a simple Telegram bot. Configure a bot token and the allowed user ID then run the script:

Node

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.

Running Tests

Node

Install dependencies in the bot directory then run the Jest suite:

cd crypto-tracker-bot
npm install
npm test

Python

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.

Directory Overview

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

Custom Strategies

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.

About

army bots

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •