[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1123":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":14,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},1123,"claude-tradingview-mcp-trading","jackson-video-resources\u002Fclaude-tradingview-mcp-trading","jackson-video-resources","Connect Claude Code to TradingView and execute trades automatically via BitGet",null,"JavaScript",469,275,24,4,0,14,119,12,69.32,false,"main",true,[],"2026-06-12 04:00:07","# Claude + TradingView MCP — Automated Trading\n\n> **New to this?** Watch the previous video first — it sets up the TradingView MCP connection this builds on.\n\n[![How To Connect Claude to TradingView (Insanely Cool)](https:\u002F\u002Fimg.youtube.com\u002Fvi\u002FvIX6ztULs4U\u002Fmaxresdefault.jpg)](https:\u002F\u002Fyoutu.be\u002FvIX6ztULs4U)\n\n[![Claude Code + TradingView Now Actually Executes Real Trades](https:\u002F\u002Fimg.youtube.com\u002Fvi\u002FaDWJ6lLemJU\u002Fmaxresdefault.jpg)](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=aDWJ6lLemJU)\n\n---\n\n## What This Does\n\n**Five things you get from this setup:**\n\n1. **Claude connected to your exchange** — reads your TradingView chart and executes trades on BitGet automatically\n2. **A safety check** — every condition in your strategy must pass before a single trade goes through\n3. **24\u002F7 cloud execution** — deploy to Railway and it runs on a schedule, even when your laptop is closed\n4. **Automatic tax accounting** — every trade logged to `trades.csv` with date, price, fees, and net amount, ready for your accountant\n5. **Free** — no email, no course, no upsell. Everything is in this repo.\n\n---\n\n## The One-Shot Prompt\n\n> **This is the thing you paste.** Open Claude Code in this directory, paste the entire contents of [`prompts\u002F02-one-shot-trade.md`](prompts\u002F02-one-shot-trade.md), and Claude will do the rest.\n\nHere's what it does when you run it:\n\n| Step | What Claude does |\n|------|-----------------|\n| 1 | Reads your `rules.json` strategy |\n| 2 | Pulls live price + indicator data from TradingView |\n| 3 | Calculates MACD from raw candle data |\n| 4 | Evaluates market bias (bullish \u002F bearish \u002F neutral) |\n| 4b | Checks trade limits — daily cap and max trade size |\n| 5 | Runs the safety check — every entry condition checked |\n| 6 | Executes the trade via BitGet if all conditions pass |\n| 7 | Logs the trade to `trades.csv` — date, price, fees, net amount (tax-ready) |\n| 8 | Saves full decision log to `safety-check-log.json` |\n\nIf anything fails the safety check, it stops and tells you exactly which condition failed and the actual values. No trade goes through unless everything lines up.\n\n---\n\n## Getting Started\n\n### Step 1 — Paste the one-shot prompt into Claude Code\n\nCopy the entire contents of [`prompts\u002F02-one-shot-trade.md`](prompts\u002F02-one-shot-trade.md) and paste it into your Claude Code terminal.\n\nThat's it. Claude acts as your onboarding agent — it clones the repo, walks you through connecting BitGet, sets your trading preferences, connects TradingView, optionally builds a strategy from a YouTube channel, deploys to Railway, and runs the bot for the first time. Every step is interactive. It pauses when it needs something from you and handles everything else automatically.\n\n---\n\n## What's Happening Under the Hood\n\nFor anyone who wants to understand the steps manually, or troubleshoot a specific part:\n\n### Prerequisites\n\n- **TradingView MCP** must already be set up — built in the [first video](https:\u002F\u002Fyoutu.be\u002FvIX6ztULs4U)\n- **Claude Code** installed and running\n- **A BitGet account** — [sign up here]([https:\u002F\u002Fpartner.bitget.com\u002Fbg\u002FLewisJackson](https:\u002F\u002Fbonus.bitget.com\u002FLewisJackson)) for a $1,000 bonus on your first deposit\n- **Node.js 18+** — check with `node --version`\n\n---\n\n### Clone the repo\n\n**Mac \u002F Linux:**\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fjackson-video-resources\u002Fclaude-tradingview-mcp-trading\ncd claude-tradingview-mcp-trading\n```\n\n**Windows:**\n```powershell\ngit clone https:\u002F\u002Fgithub.com\u002Fjackson-video-resources\u002Fclaude-tradingview-mcp-trading\ncd claude-tradingview-mcp-trading\n```\n\n---\n\n### Add your BitGet API credentials\n\n**Mac \u002F Linux:**\n```bash\ncp .env.example .env\n```\n\n**Windows:**\n```powershell\nCopy-Item .env.example .env\n```\n\nOpen `.env` and fill in:\n\n```\nBITGET_API_KEY=your_api_key_here\nBITGET_SECRET_KEY=your_secret_key_here\nBITGET_PASSPHRASE=your_passphrase_here\nPORTFOLIO_VALUE_USD=1000\nMAX_TRADE_SIZE_USD=100\nMAX_TRADES_PER_DAY=3\n```\n\n**Getting your API key:**\n\nStep-by-step guides for all supported exchanges:\n\n| Exchange | Guide |\n|----------|-------|\n| BitGet *(used in the video)* | [docs\u002Fexchanges\u002Fbitget.md](docs\u002Fexchanges\u002Fbitget.md) |\n| Binance | [docs\u002Fexchanges\u002Fbinance.md](docs\u002Fexchanges\u002Fbinance.md) |\n| Bybit | [docs\u002Fexchanges\u002Fbybit.md](docs\u002Fexchanges\u002Fbybit.md) |\n| OKX | [docs\u002Fexchanges\u002Fokx.md](docs\u002Fexchanges\u002Fokx.md) |\n| Coinbase Advanced | [docs\u002Fexchanges\u002Fcoinbase.md](docs\u002Fexchanges\u002Fcoinbase.md) |\n| Kraken | [docs\u002Fexchanges\u002Fkraken.md](docs\u002Fexchanges\u002Fkraken.md) |\n| KuCoin | [docs\u002Fexchanges\u002Fkucoin.md](docs\u002Fexchanges\u002Fkucoin.md) |\n| Gate.io | [docs\u002Fexchanges\u002Fgateio.md](docs\u002Fexchanges\u002Fgateio.md) |\n| MEXC | [docs\u002Fexchanges\u002Fmexc.md](docs\u002Fexchanges\u002Fmexc.md) |\n| Bitfinex | [docs\u002Fexchanges\u002Fbitfinex.md](docs\u002Fexchanges\u002Fbitfinex.md) |\n\nTwo rules that apply to every exchange — **withdrawals OFF, IP whitelist ON**.\n\n---\n\n### Launch TradingView and connect the MCP\n\n**Mac:**\n```bash\ntv_launch\ntv_health_check\n```\n\n**Windows:** See [docs\u002Fsetup-windows.md](docs\u002Fsetup-windows.md)\n\n**Linux:** See [docs\u002Fsetup-linux.md](docs\u002Fsetup-linux.md)\n\nVerify with `tv_health_check` — should return `cdp_connected: true`.\n\n---\n\n### Run the bot manually\n\n```bash\nnode bot.js\n```\n\n---\n\n## Deploy to Railway (Run in the Cloud 24\u002F7)\n\nThe local setup runs when your laptop is open. Railway lets the bot check for setups around the clock — even while you sleep.\n\n> **Note:** Cloud mode pulls candle data directly from Binance's free market API instead of TradingView. No TradingView Desktop needed in the cloud. The strategy logic and safety check are identical.\n\n### 1. Deploy\n\n```bash\nnpm install -g @railway\u002Fcli\nrailway login\nrailway init\nrailway up\n```\n\n### 2. Set your environment variables in Railway\n\nGo to your Railway project → Variables and add everything from `.env.example`:\n\n| Variable | Example |\n|----------|---------|\n| `BITGET_API_KEY` | your key |\n| `BITGET_SECRET_KEY` | your secret |\n| `BITGET_PASSPHRASE` | your passphrase |\n| `PORTFOLIO_VALUE_USD` | 1000 |\n| `MAX_TRADE_SIZE_USD` | 100 |\n| `MAX_TRADES_PER_DAY` | 3 |\n| `PAPER_TRADING` | true (set to false when ready) |\n| `SYMBOL` | BTCUSDT |\n| `TIMEFRAME` | 4H |\n\n### 3. Set a cron schedule\n\nIn Railway → Settings → Cron Schedule, set how often the bot runs. Recommended:\n\n| Timeframe | Schedule | What it means |\n|-----------|----------|----------------|\n| 4H chart | `0 *\u002F4 * * *` | Every 4 hours |\n| 1D chart | `0 9 * * *` | Once a day at 9am UTC |\n| 1H chart | `0 * * * *` | Every hour |\n\n### 4. Start in paper trading mode\n\n`PAPER_TRADING=true` logs every decision but never places real orders. Watch a few days of paper trades, confirm the logic matches what you expect, then flip it to `false`.\n\n---\n\n## Build Your Own Strategy (Optional)\n\nThe example `rules.json` uses the van de Poppe + Tone Vays BTC strategy. To build one from any trader's public videos:\n\n1. Go to [Apify](https:\u002F\u002Fapify.com?fpr=3ly3yd) and search the actor store for **YouTube Transcript Scraper** — takes about 30 seconds per channel\n2. Paste the output into `prompts\u002F01-extract-strategy.md`\n3. Run that prompt in Claude Code — it generates a `rules.json` tailored to that trader's methodology\n\n---\n\n## Files\n\n| File | What it does |\n|------|-------------|\n| `rules.json` | Your strategy — indicators, entry rules, risk rules |\n| `.env` | Your BitGet credentials (gitignored — never commits) |\n| `prompts\u002F01-extract-strategy.md` | Build rules.json from trader transcripts |\n| `prompts\u002F02-one-shot-trade.md` | **The one-shot prompt — paste this to trade** |\n| `safety-check-log.json` | Auto-generated log of every trade decision |\n| `trades.csv` | Tax-ready trade record — auto-written on every execution |\n| `docs\u002Fsetup-windows.md` | Windows-specific MCP setup |\n| `docs\u002Fsetup-linux.md` | Linux-specific MCP setup |\n\n---\n\n## Tax Accounting\n\nEvery trade the bot places is automatically written to `trades.csv` with the columns your accountant needs:\n\n| Column | Description |\n|--------|-------------|\n| Date | ISO date of the trade |\n| Time | UTC time |\n| Exchange | BitGet |\n| Symbol | e.g. BTCUSDT |\n| Side | Buy \u002F Sell |\n| Quantity | Units traded |\n| Price | Price per unit at execution |\n| Total USD | Gross trade value |\n| Fee (est.) | Estimated exchange fee |\n| Net Amount | Total USD minus fee |\n| Order ID | Exchange reference |\n| Mode | Paper \u002F Live |\n\nAt tax time: open the file, hand it to your accountant, or import it directly into your accounting software. Nothing to reconstruct.\n\nFor a quick summary of your trading activity, run:\n\n```bash\nnode bot.js --tax-summary\n```\n\nThis prints total trades, volume, and fees paid.\n\n---\n\n## Safety\n\nThe safety check conditions are not fixed — they come directly from your `rules.json`. If you build a strategy from a YouTube trader's transcripts using the Apify prompt, your safety check will reflect that trader's entry logic. If you use the example strategy, it reflects those conditions. They're yours, not a generic filter.\n\nEvery condition in your `entry_rules` must pass before a trade goes through. One fails — nothing happens. The bot tells you exactly which condition failed and the actual value it saw.\n\nAdditional guardrails that apply regardless of strategy:\n- Maximum trade size capped at `MAX_TRADE_SIZE_USD` in `.env`\n- Maximum trades per day capped at `MAX_TRADES_PER_DAY` in `.env`\n- Position sizing calculated from your portfolio value — max 1% risk per trade\n- Every decision logged to `safety-check-log.json` with exact indicator values\n- Every executed trade recorded in `trades.csv` for accounting\n\n**This is not financial advice.** Build your strategy properly. Run the backtest. Paper trade before going live. Never put in more than you can afford to lose.\n\n---\n\n## Resources\n\n- [First video — Connect Claude to TradingView](https:\u002F\u002Fyoutu.be\u002FvIX6ztULs4U)\n- [TradingView MCP repo (first video)](https:\u002F\u002Fgithub.com\u002Fjackson-video-resources\u002Ftradingview-mcp-jackson)\n- [Apify](https:\u002F\u002Fapify.com?fpr=3ly3yd) — search actor store for \"YouTube Transcript Scraper\"\n- [BitGet — $1,000 bonus on first deposit]([https:\u002F\u002Fpartner.bitget.com\u002Fbg\u002FLewisJackson](https:\u002F\u002Fbonus.bitget.com\u002FLewisJackson))\n","该项目通过将Claude Code与TradingView连接，并利用BitGet自动执行交易。其核心功能包括根据TradingView图表自动执行交易、安全检查确保所有策略条件满足后才进行交易、24\u002F7云执行保证服务持续运行，以及自动记录每笔交易以方便税务处理。技术上主要使用JavaScript编写，支持MACD指标计算和市场偏好的评估。适用于希望自动化其交易流程且需要一定安全保障的投资者，特别是那些已经在使用TradingView并希望进一步集成AI辅助决策工具的用户。",2,"2026-06-11 02:41:48","CREATED_QUERY"]