{"id":44313488,"url":"https://github.com/madmartigan1/tradebot","last_synced_at":"2026-06-04T01:00:43.495Z","repository":{"id":315280667,"uuid":"1058848718","full_name":"Madmartigan1/tradebot","owner":"Madmartigan1","description":"Autonomous Coinbase trading bot with adaptive EMA, RSI, and MACD strategy — commanded by the Captain (EMA), guided by the Navigator (AutoTune), and advised by the Skipper (RSI) and Commodore (MACD).","archived":false,"fork":false,"pushed_at":"2025-12-31T17:32:24.000Z","size":24287,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-11T06:58:14.679Z","etag":null,"topics":["algorithmic-trading","automated-trading","coinbase","crypto","ema","macd","python","rsi","trading","trading-bot","websocket"],"latest_commit_sha":null,"homepage":"https://github.com/Madmartigan1/tradebot#usage","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Madmartigan1.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-17T16:21:48.000Z","updated_at":"2025-12-31T17:32:28.000Z","dependencies_parsed_at":"2025-10-26T17:12:00.527Z","dependency_job_id":null,"html_url":"https://github.com/Madmartigan1/tradebot","commit_stats":null,"previous_names":["madmartigan1/tradebot"],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/Madmartigan1/tradebot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Madmartigan1%2Ftradebot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Madmartigan1%2Ftradebot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Madmartigan1%2Ftradebot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Madmartigan1%2Ftradebot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Madmartigan1","download_url":"https://codeload.github.com/Madmartigan1/tradebot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Madmartigan1%2Ftradebot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33886153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithmic-trading","automated-trading","coinbase","crypto","ema","macd","python","rsi","trading","trading-bot","websocket"],"created_at":"2026-02-11T04:33:02.232Z","updated_at":"2026-06-04T01:00:43.490Z","avatar_url":"https://github.com/Madmartigan1.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tradebot v1.1.7\n\n[![Latest version](https://img.shields.io/github/v/release/Madmartigan1/tradebot?sort=semver\u0026include_prereleases)](https://github.com/Madmartigan1/tradebot/releases)\n[![License](https://img.shields.io/github/license/Madmartigan1/tradebot)](LICENSE)\n[![Python](https://img.shields.io/badge/python-3.13%2B-blue)](requirements.txt)\n![Code size](https://img.shields.io/github/languages/code-size/Madmartigan1/tradebot)\n[![Last commit](https://img.shields.io/github/last-commit/Madmartigan1/tradebot)](https://github.com/Madmartigan1/tradebot/commits/main)\n[![Open issues](https://img.shields.io/github/issues/Madmartigan1/tradebot)](https://github.com/Madmartigan1/tradebot/issues)\n[![Open PRs](https://img.shields.io/github/issues-pr/Madmartigan1/tradebot)](https://github.com/Madmartigan1/tradebot/pulls)\n[![Stars](https://img.shields.io/github/stars/Madmartigan1/tradebot?style=social)](https://github.com/Madmartigan1/tradebot/stargazers)\n\n---\n\n⚙️ Full CLI Control, AutoTune Transparency and Runtime Flexibility\n\n---\n\n## ⚓ The Fleet Metaphor\nTo make the strategy easier to visualize:\n\n- **EMA → Captain**  \n  The EMA crossover is the leader and core signal engine. When the short EMA crosses the long EMA, the Captain gives the order.\n\n- **AutoTune → Navigator**  \n  The Navigator studies recent tides — analyzing market “weather” to recalibrate course.  \n  When the seas are calm (choppy), it tightens risk controls; when trending, it opens the sails for broader moves.  \n  AutoTune dynamically adjusts parameters like EMA confirmation count, RSI thresholds, and MACD bands based on regime votes (uptrend, downtrend, choppy, or blend).\n\n- **MACD → Commodore**  \n  The Commodore confirms momentum and trend direction. If the histogram disagrees, the Captain’s signal can be overridden.\n\n- **RSI → Skipper**  \n  The Skipper keeps things safe in the short term. If RSI shows overbought/oversold, trades are vetoed even if the Captain/Commodore want action.\n  \n- **Quartermaster → Take-Profit \u0026 Stagnation Officer**  \n  The Quartermaster safeguards the fleet’s earnings and tidiness.  \n  - **Take-Profit (8%+)**: When profits reach a safe margin, the Quartermaster locks the cargo and sends the ship home — a quick market exit.  \n\n- **Deckhand (36h, ±2%)**: The “broom” that sweeps idle trades off the deck when they drift aimlessly without momentum, keeping the decks lean and ready for action.\n  This ensures capital is recycled efficiently while the Captain (EMA) and Advisors (RSI/MACD) focus on live opportunities.\n\n- **Swab → Deck Maintenance \u0026 Logkeeper** The newest crew member in v1.0.8 — responsible for keeping the decks spotless and logs consistent. Handles processed fill pruning and record hygiene to prevent bloat.\n(*Fun fact:* The term “Swab” was inspired by *Captain Ron* — because every good ship needs a swab.)\n\n- **Watchdog → Connection Officer**  \n  The newest recruit in v1.1.1 — a loyal sentry who keeps the fleet online and alert.  \n  - **Duties:** Monitors the WebSocket line for silence, issues pings, reconnects when idle, and even switches to local candle tracking if the exchange link grows unstable.    \n  The Watchdog ensures the Captain (EMA) never sails blind, keeping communication alive through calm and storm alike.\n\n\nTogether they form a chain of command:\n**EMA (Captain)** gives orders -\u003e **AutoTune (Navigator)** continuously adjusts the fleet’s heading based on market weather -\u003e **MACD (Commodore)** ensures strategy aligns with the broader trend -\u003e **RSI (Skipper)** vetoes reckless moves -\u003e **Quartermaster** secures profits and clears stagnation -\u003e **Deckhand** keeps the decks clear of idle trades, ensuring the fleet stays agile and battle-ready -\u003e **Swab** ensures no duplicate fills, stale positions, or misaligned logs remain aboard -\u003e **Watchdog** keeps watch over the horizon, ensuring communication lines stay open and the ship never drifts alone. \n\n---\n\n## 📖 Documentation\n- **Full User Guide (PDF):** [docs/OpsManual.pdf](docs/OpsManual.pdf)\n- More docs:\n  - [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)\n  - [docs/RUNBOOK.md](docs/RUNBOOK.md)\n  - [USAGE.md](USAGE.md)\n  - [CHANGELOG.md](CHANGELOG.md)\n\n---\n\n## ✨ v1.1.7 Highlights\n- **RSI initialization corrected** — The RSI indicator now properly seeds itself using a\n  simple average of the first `rsi_period` gains/losses before switching to Wilder's\n  smoothing. Previously it exited the seed phase after a single delta, producing inaccurate\n  RSI values throughout the warmup window and potentially causing the Skipper (RSI advisor)\n  to veto valid signals on bad data.\n- **AutoTune BLEND mode now moves non-BPS knobs meaningfully** — The per-vote delta cap\n  is now knob-specific. `per_coin_cooldown_s` was previously capped at 2 seconds per\n  AutoTune cycle (against a 300–1800s range), making the Navigator's cooldown adjustments\n  effectively inert in BLEND mode. It is now capped at 60s per cycle, allowing convergence\n  in 3–5 cycles.\n- **Quartermaster dust suppression no longer silences the Captain** — When QM detects a\n  dust position too small to sell, it no longer exits `_on_candle_close` entirely. The EMA\n  captain now continues to evaluate signals normally; only a successfully placed QM sell\n  triggers the early exit.\n\n---\n\n### 🔧 Upgrade notes\n- Pure bug fixes — no new config keys, no CSV header changes.\n- Fully backward-compatible with v1.1.6 state files.\n- RSI warmup behavior changes only during the first `rsi_period` candles after startup or\n  reset. Post-warmup RSI is unaffected.\n\n---\n\n### 🧑‍💻 Developer Notes\n- `_MAX_DELTA_PER_VOTE_BPS` in `autotune.py` replaced with per-knob `_MAX_DELTA_PER_VOTE`\n  dict. Any future knobs not explicitly listed fall back to `2.0`.\n- QM block in `_on_candle_close` restructured from early-`return` guards to `if/elif/else`\n  chain. Only the `else` branch (real QM sell placed) returns early.\n  \n---\n\n## ⚖️ Risk controls\n\n- **Daily BUY cap**: limits the number of BUYs per day to curb overtrading during chop. Logged as  \n  `**********Daily BUY cap reached (N). Skipping further BUYs.**********`\n- **Quartermaster**: take-profit and stagnation exits; respects `base_increment` and `min_market_base_size`.\n- **Exits**: `MARKET_ONLY` by default for deterministic fills under stress.\n\n---\n\n## 🔐 Secrets\nCopy `APIkeys.env.example` -\u003e `APIkeys.env` and fill your Coinbase credentials.  \nNever commit real keys.\n\n---\n\n## 🛠️ Quickstart\n```powershell\npython -m venv .venv\n.\\.venv\\Scripts\\Activate.ps1\npip install -r requirements.txt\ncopy APIkeys.env.example APIkeys.env   # fill your keys\npython .\\main.py\n```\n\n---\n\n## ⚠️ Disclaimer:\nThis bot is intended for educational and experimental purposes only. It is not financial advice and will not guarantee profit. Use it at your own risk.\nAlways do your own research, monitor your trades, and configure the system to match your risk tolerance.\nPast performance is not indicative of future results. Trade responsibly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadmartigan1%2Ftradebot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadmartigan1%2Ftradebot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadmartigan1%2Ftradebot/lists"}