Automated technical analysis agent for BTC/USDT that sends Telegram alerts on high-conviction signals and optionally executes trades on Polymarket.
┌──────────────┐ ┌─────────────────┐ ┌──────────────────┐
│ Binance API │───▶│ Indicator │───▶│ Multi-TF Scorer │
│ (1h + 4h) │ │ Engine │ │ (-1.0 ... +1.0) │
└──────────────┘ └─────────────────┘ └────────┬─────────┘
│
┌────────────┴────────────┐
│ │
score ≥ 0.55 score ≥ 0.75
+ cooldown + ADX ≥ 25
│ │
▼ ▼
┌─────────────┐ ┌────────────────┐
│ Telegram │ │ Polymarket │
│ Alert │ │ CLOB Order │
└─────────────┘ └────────────────┘
| Indicator | Period | Role |
|---|---|---|
| EMA | 50/200 | Trend direction + Golden/Death cross |
| RSI | 14 | Momentum, overbought/oversold zones |
| MACD | 12/26/9 | Momentum confirmation + crossovers |
| Bollinger Bands | 20, 2σ | Volatility & mean reversion |
| ADX | 14 | Trend strength gate (filters chop) |
| OBV | smoothed | Volume confirmation / divergence |
| ATR | 14 | Volatility (used for risk sizing) |
Each indicator outputs a score in [-1, +1]. The aggregate is a weighted
average; multi-timeframe agreement adds a confirmation bonus.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# Fill in secrets
python -m pytest tests/ -v # run sanity tests
python run_once.py # one analysis cycle
python main.py # run the scheduler- Open Telegram, search for
@BotFather, send/newbot, follow prompts. - Save the bot token in
.envasTELEGRAM_BOT_TOKEN. - Send any message to your new bot, then visit
https://api.telegram.org/bot<TOKEN>/getUpdatesand copy thechat.idvalue into.envasTELEGRAM_CHAT_ID.
- Create a dedicated wallet (MetaMask or similar). Never reuse your main one.
- Fund it with a small amount of MATIC (gas) and USDC.e on the Polygon network.
- Export the private key and put it in
.envasPOLYMARKET_PRIVATE_KEY. - (Optional but recommended) Generate API credentials via the py-clob-client
create_api_key()flow and store them in.env. - Keep
polymarket.dry_run: trueinconfig.yamluntil you have observed at least 1 week of correct dry-run behavior.
A 1 vCPU / 1 GB RAM VPS is plenty (Hetzner CX11, DigitalOcean basic, etc.).
# On your laptop
rsync -av --exclude=venv --exclude=.git --exclude='__pycache__' \
./ user@your-vps:/tmp/btc_agent/
# On the VPS
ssh user@your-vps
sudo mv /tmp/btc_agent /opt/
cd /opt/btc_agent
sudo bash deploy/install.sh
# After install:
sudo nano /opt/btc_agent/.env # fill in secrets
sudo chown btcagent:btcagent /opt/btc_agent/.env
sudo chmod 600 /opt/btc_agent/.env
# Smoke test
sudo -u btcagent /opt/btc_agent/venv/bin/python /opt/btc_agent/run_once.py
# Start
sudo systemctl start btc-agent
sudo systemctl status btc-agent
sudo journalctl -u btc-agent -f| Task | Command |
|---|---|
| Tail logs | journalctl -u btc-agent -f |
| Restart | systemctl restart btc-agent |
| Stop | systemctl stop btc-agent |
| Update config | edit config/config.yaml then restart |
| Update code | rsync then systemctl restart btc-agent |
| Test alerts | python run_once.py |
- Telegram alerts received correctly for at least 48h
-
dry_run: truefor at least 1 week - Reviewed dry-run trade logs - markets matched correctly
- Risk caps in
config.yamlset conservatively - Dedicated Polymarket wallet funded with only the amount you can lose
-
.envhaschmod 600and is owned bybtcagent - Backed up the wallet recovery phrase offline
- Reviewed
max_daily_tradesandmax_trade_size_usdc - Tested
systemctl restartrecovery
Esto es software de investigación. No es asesoramiento financiero. Los mercados de criptomonedas y de predicción son altamente volátiles. Solo arriesga capital que puedas permitirte perder por completo.