Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
A gold scalping bot and trading dashboard built on Val Town, implementing the Ultimate Hybrid Gold Trading Strategy. It fetches live XAU/USD data from Twelve Data, runs a multi-layer technical analysis engine, generates trade signals with risk-managed levels, and (optionally) delivers alerts via Telegram.
⚠️ For educational and research purposes only. Gold trading carries significant financial risk.
- Settings tab → paste your Twelve Data API key (free tier: 800 calls/day). It's stored server-side and never returned to the browser.
- Dashboard → click Scan Now to run the first analysis and populate the chart.
- Telegram tab (optional) → add a bot token + chat ID, then send a test message.
- Strategy Intelligence tab → add custom rules that score alongside the built-in engine.
- Dashboard → Start Auto-Scan to enable scheduled scanning (every 15 min on free tier).
Rendering mermaid diagram...
A pure-TypeScript library combining many methodologies, each contributing a weighted bullish/bearish score:
- EMA trend (20/50/200) + higher-timeframe (1H) bias
- Market structure: HH/HL vs LH/LL (trend detection)
- RSI (14) and MACD (12/26/9) histogram momentum
- ICT Order Blocks (bullish/bearish) and Fair Value Gaps
- Liquidity Sweep detection — highest weight (3 points)
- SMT Divergence (price vs RSI)
- Candlestick patterns (Hammer, Shooting Star, Engulfing, Pin Bar, Marubozu, Morning/Evening Star, Doji)
- Dynamic Support & Resistance via swing points
- Trading session filter (scores reduced 30% in low-liquidity hours)
Direction requires a 2-point lead over the opposite side (avoids weak NEUTRAL signals). Confidence = winning side ÷ total score. Stop-loss = ATR × 1.5 anchored to nearest S/R; take-profits at the configured 1.5R / 2.5R / 4.0R.
| Path | Purpose |
|---|---|
main.ts | Hono HTTP API + serves the dashboard |
cron/autoscan.ts | Scheduled auto-scan (interval) |
src/lib/analysis.ts | Hybrid analysis engine |
src/lib/indicators.ts | EMA/RSI/MACD/ATR/swing math |
src/lib/patterns.ts | Candlestick patterns |
src/lib/market.ts | Twelve Data fetcher |
src/lib/telegram.ts | Outbound Telegram notifier |
src/lib/pipeline.ts | fetch → analyze → persist → notify |
src/lib/db.ts | SQLite schema + helpers (5 tables) |
src/frontend/* | React dashboard (Twind styling) |
- Twelve Data API key and Telegram credentials are stored in SQLite (configured via the dashboard) — not env vars — so no setup outside the app is needed.
- The free tier enforces a 15-minute minimum cron interval. Upgrade for tighter scheduling.
- This was adapted from a Netlify/Postgres design to Val Town's Deno runtime (HTTP vals, project SQLite, interval cron).