A powerful Crypto futures signal bot built with TypeScript, Telegraf, and CCXT. This algorithmic bot implements a strict Smart Money Concepts (SMC) trading strategy based on the Lewis Kelly setup to automatically analyze tickers on MEXC and generate highly probable execution signals directly to Telegram.
- 📊 Fully Algorithmic SMC Engine: Deterministically identifies Market Structure (BOS/CHOCH), Supply/Demand Zones, Liquidity Sweeps, and Fair Value Gaps (FVGs).
- 🎯 Optimized Limit Entries: Calculates intelligent entry points on the edge of the supply/demand zones instead of indiscriminate market execution.
- ⚡ Confidence Rating: Scores every setup out of 100% based on macro trend alignment, deep liquidity sweeps, and unmitigated FVG backing.
- 💰 Risk Management: Generates signals with mathematically structured Stop Losses, 1:2 Risk/Reward Targets, and calculates assumed Position Size/PNL metrics.
- 🗄️ Supabase Backend: Logs query histories and tracks active users for analytics scaling without interrupting execution payload latency.
The engine (found at src/smc.ts) utilizes the following technical milestones on the 24H (Daily) timeframe before issuing a signal.
- Market Structure Calculation: First, it maps the current market trend by plotting 5-bar fractals (creating Swings Highs and Lows).
- Zone Registration: It searches backwards and highlights the "Last opposing candle" before an impulse that caused a Break of Structure (BOS). This defines the Supply and Demand Zones.
- Liquidity Sweep Detection: It checks if price wicks beyond a pre-established Swing level, trapping traders, but closes back inside the safe range.
- Trigger Generation: A
BUYorSELLsignal is strictly dispatched ONLY IF:- Liquidity is swept (SSL for buys, BSL for sells).
- The price mitigates an unbroken valid Zone.
- Price establishes a CHOCH (Change of Character) from bearish to bullish (or vice versa).
- A subsequent BOS confirms the leg.
To dial in the bot's variables based on your trading style, adjust these parameters in src/smc.ts:
- Timeframe Config: The bot retrieves data via
fetchOHLCV(symbol, '1d', 200). Change'1d'to'1h'or'15m'to calculate intrastate/scalp SMC setups. - Risk / Reward Ratio: In
src/smc.ts(aroundrr = 2), you can adjust the fixed Risk multiplier if you want tighter 1:3 RR targets or looser 1:1.5 RR settings. - Swing Fractal Size: Swings are generated via the boolean
isSwingHighlooking 2 candles backwards and 2 candles forwards. Expanding this to 3 candles (i - 3,i + 3) restricts the engine to only detect Macro sweeps. - Confidence Weights: Edit the modifiers
confidence += 15during the boolean checks forfvgAlignedorisDeepSweep.
Ensure you have Node.js installed, as well as an established connection to:
- Telegram BotFather (Token).
- Supabase Project (URL and Anon key).
Install dependencies:
npm installCopy .env.example to .env and configure it:
TELEGRAM_BOT_TOKEN="your_token"
SUPABASE_URL="your_url"
SUPABASE_ANON_KEY="your_anon_key"For development and real-time viewing logs:
npm run devTo compile and run efficiently via PM2 daemon:
npm run build
npx pm2 start dist/index.js --name smc-bot