An intelligent BTC/USD paper trading bot with a modern web dashboard, Telegram notifications, and 24-hour continuous operation in IST timezone.
✅ 24/7 Bot Operation - Runs continuously in IST timezone ✅ Real-time Dashboard - Live BTC price, trades, and balance tracking ✅ Telegram Notifications - Get alerts for every trade executed ✅ IST Timezone Support - All times displayed in Indian Standard Time ✅ Trade Journal - Comprehensive history with export to CSV ✅ Live Chart - Real-time BTC/USD price visualization ✅ Backtester - Test strategy on historical data ✅ Docker Ready - One-click deployment ✅ Remote Access - Deploy anywhere and access from any device ✅ Manual Trading - Execute trades manually when needed
- Node.js 18+
- npm
- Telegram bot token from BotFather
- Clone & Install
git clone <repo-url>
cd newtrade
bash setup.sh- Configure Telegram
Edit
.env:
TELEGRAM_BOT_TOKEN=your-telegram-bot-token
TELEGRAM_CHAT_ID=your-telegram-chat-id
SEND_TELEGRAM_ON_TRADE=true
- Start Bot
npm start- Access Dashboard
Open browser:
http://localhost:5001
- Real-time bot status (Online/Offline)
- Daily trade count
- Last analysis timestamp (IST)
- Real-time BTC/USD chart
- 50-point data visualization
- Current price display
- USD balance
- BTC balance
- Total portfolio value
- Live P&L updates
- Entry/Exit levels
- Stop Loss & Take Profit
- All trades with timestamps (IST)
- P&L calculation
- Export to CSV
- Execute Buy/Sell manually
- Configurable quantity
- Real-time feedback
Receive instant alerts when:
- A trade is executed
- Daily summary sent at midnight
- Errors or warnings occur
- Create a bot with BotFather.
- Add the token to
.envor Railway Variables. - Open your bot chat and send
/start. - Call
POST /api/telegram/verifyto discoverTELEGRAM_CHAT_IDif needed. - Add the chat ID and redeploy.
Required variables:
TELEGRAM_BOT_TOKEN=your-telegram-bot-token
TELEGRAM_CHAT_ID=your-telegram-chat-id
SEND_TELEGRAM_ON_TRADE=true
docker-compose up -d- Dashboard: http://localhost:5001
- Logs:
docker-compose logs -f trading-bot
heroku create trading-bot
heroku config:set TELEGRAM_BOT_TOKEN=your-telegram-bot-token
heroku config:set TELEGRAM_CHAT_ID=your-telegram-chat-id
heroku config:set SEND_TELEGRAM_ON_TRADE=true
git push heroku mainSee DEPLOYMENT.md for detailed instructions.
# Server
PORT=5001
NODE_ENV=production
# Telegram
TELEGRAM_BOT_TOKEN=your-telegram-bot-token
TELEGRAM_CHAT_ID=your-telegram-chat-id
# Bot
BOT_ENABLED=true
DAILY_TRADE_LIMIT=1
BOT_START_HOUR=0
BOT_END_HOUR=23
# Notifications
SEND_TELEGRAM_ON_TRADE=true
SEND_DAILY_SUMMARY=true
SEND_ERROR_ALERTS=true
# Timezone (always IST for this bot)
TIMEZONE=Asia/Kolkata# Bot Status
GET /api/bot/status
# Get Current Price
GET /api/price
# Get Trades
GET /api/trades
GET /api/trades/active
# Manual Trade
POST /api/manual-trade
{ "action": "BUY", "quantity": 0.01 }
# Telegram Status
GET /api/telegram/status
# Test Telegram
POST /api/telegram/test
# Export Trades
GET /api/trades/exportnewtrade/
├── backend/
│ ├── server.js # Main server
│ ├── tradingBot.js # Bot core
│ ├── analysisEngine.js # Trading logic
│ ├── decisionEngine.js # Signal generation
│ ├── executionEngine.js # Trade execution
│ └── emailService.js # Telegram notifications
├── frontend/
│ └── src/
│ ├── components/ # UI components
│ ├── utils/
│ │ └── timeFormatter.js # IST formatting ✨ NEW
│ └── services/
│ └── api.js # API calls
└── docker-compose.yml # Docker setup ✨ NEW
# Terminal 1: Backend
npm run dev:backend
# Terminal 2: Frontend
npm run dev:frontend# Runs the same unified logic used by the live bot
node improved_backtest_cpr.js 90The backtester uses the same closed-candle signal logic, realistic lifecycle accounting, and risk settings as the bot.
- Strategy: Advanced 10-Factor Confluence Scoring (EMA, RSI, MACD, CPR, VWAP, Wyckoff, etc.)
- Timeframe: 6-hour candles
- Position Sizing: Confluence-scaled, two-decimal BTC lots only:
0.01through0.08 BTC; scores8+target larger lots while risk guards still cap oversized stops. - Risk Management: Smart Stop Loss, partial TP, final TP, and trailing stop logic.
- Hours: Configurable session gate. Current defaults allow 24-hour analysis.
- Paper Trading: Current implementation logs paper trades; it does not place real exchange orders
- Not Financial Advice: Use at your own risk
- Paper Trading: Test thoroughly before using real money
- Monitor Actively: Always monitor bot performance
# Check Telegram status
curl http://localhost:5001/api/telegram/status
# Verify bot/chat
curl -X POST http://localhost:5001/api/telegram/verify
# Send test alert
curl -X POST http://localhost:5001/api/telegram/test# Check logs
docker-compose logs trading-bot
# Or run locally
npm start# Reset database
rm trading.db
docker-compose restart- Deployment Guide - Detailed deployment instructions
- Architecture - System design
- API Reference - Complete API docs
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request
MIT License - See LICENSE file
For issues or questions:
- Check DEPLOYMENT.md
- Review logs:
docker-compose logs -f - Test Telegram:
curl -X POST http://localhost:5001/api/telegram/test
Last Updated: May 2026 Timezone: Asia/Kolkata (IST) ✅ Status: Production Ready ✅ Features: 24/7 Operation, Telegram Alerts, IST Support ✅