| Requirement | Details |
|---|---|
| Python 3.11+ | Check with python --version. |
| Broker account | Alpaca (free, paper auto-created) for stocks, or Binance/Binance Demo for crypto. |
| API keys | Generated from your broker dashboard. You need both the key ID and the secret. |
| Broker | Asset Class | Paper Trading |
|---|---|---|
| Alpaca | US Stocks & ETFs | Yes — separate paper API keys (start with PK) |
| Tradier | US Stocks & ETFs | Yes — sandbox API at sandbox.tradier.com |
| Binance | Crypto Spot (USDT pairs) | Yes — demo keys from demo.binance.com (separate from live) |
| Strategy | How it works | Best for |
|---|---|---|
| Momentum | Scans top actives/gainers. Enters when price is above 20-day SMA and RSI is 40–70. | Trending markets, high-volume days |
| RSI Mean Reversion | Buys when RSI drops below 30 (oversold). Exits when RSI crosses 50. | Range-bound stocks, post-selloff rebounds |
| MACD + Volume | Enters on bullish MACD crossover confirmed by above-average volume. | Momentum with volume confirmation |
| Bollinger Bands | Buys when price touches lower band with oversold RSI; exits at middle band. | Mean-reverting, low-volatility stocks |
| Golden Cross | Enters when 50-day SMA crosses above 200-day SMA. | Long-term trend following |
| SMA Crossover | Fast SMA crosses above slow SMA. Configurable fast/slow periods. | Short-term trend detection |
| 52-Week Breakout | Buys when price closes above its 52-week high on strong volume surge. | Breakout trading, momentum stocks |
| EMA Confluence stocks + crypto | Requires multiple EMAs (8/21/50/200) to be aligned in the same direction. Scaled sizing by confluence count. | High-conviction trend entries |
| Classic Chart Patterns stocks + crypto | Detects candlestick, reversal, and continuation patterns. EMA-200 trend filter guards entries; bear patterns trigger exits. | Pattern-based swing trading |
| Strategy | How it works |
|---|---|
| Crypto Trend | EMA crossover (fast vs. slow). Buys on bullish crossover, sells on bearish crossover. Configurable fast/slow EMA periods. |
| Crypto RSI Bounce | Buys when RSI drops below the oversold threshold. Sells when RSI rises above the overbought threshold. Good for ranging crypto markets. |
| Crypto Mean Reversion | Buys when price touches the lower Bollinger Band with oversold RSI (< 35). Exits when price returns to the SMA (middle band), or cuts the loss if price falls past the stop. |
| Crypto Grid | Divides a price range into levels. Buys near band bottoms, sells near band tops. Auto-detects range from recent price history. Trend SMA filter prevents buying in downtrends. |
| Column | What it means |
|---|---|
| Symbol | Ticker of the asset. Crypto shows the full pair (e.g., BTC/USDT). |
| Side | Long = you own it. Short positions shown as negative qty. |
| Qty | Shares or crypto units held (can be fractional). |
| Avg Entry | Your average purchase price. |
| Market Value | Current worth: Qty × Current Price. |
| P&L | Unrealized profit or loss. Green = gain, red = loss. |
| Status | Meaning |
|---|---|
| Filled | Order fully executed. |
| Open | Submitted but not yet filled. |
| Partial | Partially filled; remainder still working. |
| Cancelled | Cancelled by you or expired. |
| Blocked | Signal generated but blocked by a risk guard. |
| Field | Type | Description |
|---|---|---|
| symbol | string | Ticker symbol (e.g., AAPL or BTC/USDT) |
| side | string | buy or sell |
| qty | number | Shares or units (use this OR notional) |
| notional | number | Dollar amount to trade (use this OR qty) |
| account_id | integer | Optional. Target a specific broker account by ID. |
| Guard | What it does |
|---|---|
| Kill Switch | Master emergency stop. All automated trading halts immediately. Manual orders still work. |
| Daily Loss Limit | Halts trading when today's P&L drops below N% of starting equity. |
| Weekly Loss Limit | Same as daily but over a rolling 7-day window. |
| Consecutive Losses | Blocks new trades after N losses in a row. Reset manually or automatically when a trade wins. |
| PDT Protection | Prevents a 4th day-trade in a 5-day rolling window on accounts under $25,000 (stocks only). |
| Max Positions | Caps total open positions. Separate limits for stocks and crypto. |
| Symbol Exposure | Prevents allocating more than N% of portfolio to a single symbol. |
| Max Orders/Day | Limits total orders submitted in one trading day. |
| Trading Hours | Only allows orders between configured start/end times (ET). Crypto strategies are exempt — they run 24/7. |
| No-Trade List | Symbols on the blacklist are never traded regardless of signals. |
The global kill switch on the Risk page stops all accounts at once. Each broker account card also has its own per-account kill switch — useful when you want to pause one account while others continue trading.
The kill switch card is at the top of the Risk page. Click the red Activate Kill Switch button. A red banner appears across all pages. Click Deactivate to resume trading.
After every engine tick, TradeBot scans all open positions. Any position whose unrealized gain equals or exceeds the take-profit threshold triggers an immediate market sell. Stock and crypto accounts each have their own configurable take-profit percentage.
Go to Risk → scroll to the Take-Profit section. Set Stock Take-Profit % and Crypto Take-Profit % separately. Set to 0 to disable.
| Widget | Description |
|---|---|
| Equity Curve | Portfolio value over time. Toggle between 1W, 1M, 3M, 1Y views. |
| Strategy Stats | Per-strategy: total signals, fills, blocks, win rate, and Sharpe ratio. |
| Attribution by Account | Breakdown of signals and fills per strategy × account combination. |
| Top Symbols | Most-traded symbols by signal count and fill rate. |
| Daily Activity | Bar chart of signals per day over the last 30 days. |
Fill rate = filled signals ÷ total signals. Below 50% usually means risk guards are blocking most signals. Check Logs and filter by "Blocked" to see which guard triggers most.
| Status | Meaning |
|---|---|
| No Drift | Live win rate is within normal range of the backtest benchmark. |
| Minor Drift | Live performance is below backtest by a noticeable margin. Monitor closely. |
| Major Drift | Live performance significantly underperforms the backtest. Consider pausing the strategy and re-tuning. |
| No Benchmark | No backtest has been run for this strategy yet. Run one to enable drift monitoring. |
| Metric | Meaning |
|---|---|
| Total Return | Net profit as a % of starting capital over the test period. |
| Win Rate | % of trades that closed with a profit. |
| Max Drawdown | Largest peak-to-trough decline. Over 20% is a warning sign. |
| Sharpe Ratio | Risk-adjusted return. Above 1.0 is acceptable; above 2.0 is excellent. |
| Avg Trade P&L | Average dollar profit/loss per completed trade. |
Every time a trade executes, TradeBot queues an AI explanation job. The AI reads the signal's reason (indicator values, crossover details, pattern names) and writes a 2–3 sentence explanation in plain English. Explanations appear in the Logs page next to each signal.
TradeBot supports two AI providers: Claude (Anthropic API) and Ollama (local, free, requires Ollama running on your machine). To use Claude, go to AI Tuning → AI Provider Settings, select the Claude (Anthropic) tab, and paste your API key (from console.anthropic.com) into the Anthropic API Key field. The key is encrypted and stored securely — you do not put it in .env.
Every Sunday at 11 PM ET, the auto-tuner analyzes each strategy's live win rate and compares it to the backtest benchmark. It then proposes adjusted parameters (RSI thresholds, EMA periods, notional sizes, etc.) to improve performance. Results are logged in the AI Tuning page.
| Status | Meaning |
|---|---|
| Filled | Order was submitted and executed by the broker. |
| Blocked | A risk guard prevented the order. The reason column shows which guard triggered. |
| Pending | Signal generated but order not yet confirmed. Usually resolves in seconds. |
| Error | Something went wrong placing the order. Check the reason column for details. |
Use the filter tabs to show All, Filled, Blocked, or Error signals. A strategy producing signals that are all "Blocked" indicates a risk configuration issue. A strategy producing no signals at all means the market conditions don't match the strategy criteria.
Both use incoming webhooks. In Slack: Apps → Incoming Webhooks → Add to Slack → copy the webhook URL. In Discord: Server Settings → Integrations → Webhooks → New Webhook → copy URL. Paste into Settings → Notifications.
Check these in order: (1) Is the strategy enabled for a broker account on the Bots page? (2) Is a risk guard blocking it? Check Logs for "blocked" signals. (3) For stock strategies — is the market open? (4) For crypto strategies — is the Binance account decrypting correctly? Make sure your .env file has DB_SECRET_KEY set. (5) Does the symbol meet the strategy criteria? Use backtesting to verify.
The most common causes: (1) DB_SECRET_KEY not loaded — the app couldn't decrypt your stored API keys. Make sure the key is in your .env file. (2) Demo vs. live key mismatch — paper accounts need keys from demo.binance.com, not live keys. (3) Insufficient balance — Binance requires a minimum of $10 per order. (4) Price in neutral zone — check Logs to confirm the strategy is actually generating signals.
The Pattern Day Trader (PDT) rule limits accounts under $25,000 to 3 day-trades in any rolling 5-business-day period. TradeBot's PDT guard blocks a 4th day-trade automatically. PDT does not apply to crypto (Binance) accounts.
Yes — the server runs continuously. Stock strategies skip order placement outside configured trading hours. Crypto strategies run 24/7 with no market hours restriction.
All data is stored locally in trading.db (SQLite). Nothing is sent to external servers except to your configured broker APIs. Backtest history, signals, settings, and encrypted credentials all live in this single file. Never delete or overwrite this file.
Go to Risk and click Reset next to the Consecutive Losses field. This manually clears the counter so strategies can trade again.
Yes — keys are encrypted with AES-256 (Fernet) before storage. The secret is never returned by any API endpoint. Use Alpaca's "Trading only" scope and disable Binance withdrawal permissions for added safety.
Your API keys are encrypted with the DB_SECRET_KEY stored in your .env file. If that key changes — for example, if .env is replaced, regenerated, or you re-run setup — the app can no longer decrypt your saved credentials, and they show as invalid even though the broker side is fine.
The fix depends on whether you still have the original key:
• If you backed up the original DB_SECRET_KEY: restore that exact value into .env and restart. Your keys decrypt instantly — nothing to re-enter.
• If the original key is lost: go to Broker Accounts and re-enter your API key/secret for each account. They re-encrypt under the current key and work again. Your accounts, settings, and history are all preserved — only the key/secret fields need re-pasting.