A modern, AI-powered trading signal generator that combines technical analysis with AI insights and real-time news sentiment. Get intelligent trading signals for forex, crypto, and precious metals with automated WhatsApp notifications.
$$ π© Contact
If you have any question or offer for me, please contact me hereL Telegram
- Technical Analysis: RSI, MACD, EMA indicators
- AI Enhancement: OpenAI integration for signal refinement
- News Sentiment: Real-time news analysis
- Support/Resistance: Dynamic level detection
- Modern React frontend with dark theme
- Auto-refreshing signals (60-second intervals)
- Interactive chat with Astro AI assistant
- Multiple asset and timeframe selection
- WhatsApp notifications via Twilio
- High-confidence signal filtering (75%+ threshold)
- Instant entry, take-profit, and stop-loss levels
- Forex: EUR/USD, GBP/USD, XAU/USD (Gold), XAG/USD (Silver)
- Crypto: BTC/USDT, ETH/USDT
- Timeframes: 15m, 30m, 1h, 4h, 1d
astro-trading-bot/
βββ backend/ # FastAPI server
β βββ main.py # Core trading logic & API
β βββ requirements.txt
βββ frontend/ # React.js client
βββ src/
β βββ App.jsx # Main application
β βββ SignalCard.jsx # Signal display component
β βββ AstroChat.jsx # AI chat interface
β βββ main.jsx # React entry point
βββ index.html
βββ package.json
- Python 3.8+
- Node.js 16+
- API keys (see Configuration)
cd backend
pip install -r requirements.txt
# Create .env file with your API keys
cp .env.example .env # Edit with your keys
# Start the FastAPI server
uvicorn main:app --reload --host 0.0.0.0 --port 8000
cd frontend
npm install
# Set backend URL (optional)
export VITE_API_BASE=http://localhost:8000
# Start development server
npm run dev
# Backend (use gunicorn or deploy to cloud)
gunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker
# Frontend
npm run build
Create a .env
file in the backend/
directory:
# Required: Market Data
MARKET_API_KEY=your_twelvedata_api_key
# Optional: AI Enhancement
AI_MODEL_KEY=your_openai_api_key
# Optional: News Analysis
NEWS_API_KEY=your_newsapi_key
# Optional: WhatsApp Alerts
TWILIO_ACCOUNT_SID=your_twilio_sid
TWILIO_AUTH_TOKEN=your_twilio_token
TWILIO_WHATSAPP_FROM=whatsapp:+14155238886
TWILIO_WHATSAPP_TO=whatsapp:+1234567890
- TwelveData: twelvedata.com (market data)
- OpenAI: platform.openai.com (AI analysis)
- NewsAPI: newsapi.org (news sentiment)
- Twilio: twilio.com (WhatsApp notifications)
Generate trading signal for specified asset.
Parameters:
symbol
(string): Asset symbol (default: "XAU/USD")interval
(string): Timeframe (default: "30min")
Response:
{
"asset": "XAU/USD",
"timeframe": "30min",
"direction": "BUY",
"entry": 2023.45,
"tp": 2035.67,
"sl": 2015.23,
"confidence": 85,
"reason": "Strong bullish momentum with RSI oversold",
"timestamp": "2024-01-15T10:30:00Z"
}
Chat with Astro AI assistant.
Body:
{
"q": "What's your view on gold today?"
}
Response:
{
"answer": "Gold is showing bullish momentum..."
}
Health check endpoint.
- Data Fetching: Retrieve OHLC data from TwelveData
- Technical Analysis: Calculate RSI, MACD, EMA indicators
- Rule-Based Logic:
- BUY: EMA20 > EMA50 + MACD bullish + RSI < 35 (oversold)
- SELL: EMA20 < EMA50 + MACD bearish + RSI > 65 (overbought)
- HOLD: Mixed signals
- News Integration: Fetch relevant headlines for sentiment
- AI Refinement: OpenAI analyzes all data and refines the signal
- Risk Management: Calculate TP/SL based on volatility (2-3x ATR)
- 85%: Strong technical + AI confirmation
- 70%: Good technical alignment
- 50%: Neutral/hold signals
- Real-time signal cards with entry/exit levels
- Color-coded confidence indicators
- Auto-refresh every minute
- Asset and timeframe selectors
- Interactive AI assistant
- Market analysis and advice
- Trading education and tips
- Contextual responses based on current signals
WhatsApp notifications are sent when:
- Signal confidence β₯ 75%
- Direction is BUY or SELL (not HOLD)
- All Twilio credentials are configured
Alert Format:
π¨ XAU/USD BUY
Entry: 2023.45
TP: 2035.67
SL: 2015.23
Conf: 85%
Strong bullish momentum with RSI oversold
- Render: Easy Python deployment
- Railway: Modern cloud platform
- DigitalOcean: App Platform
- AWS/GCP: Production-scale deployment
- Vercel: Automatic React deployment
- Netlify: Static site hosting
- CloudFlare Pages: Fast global CDN
Set VITE_API_BASE
in frontend deployment to point to your backend URL.
- Use proper risk management
- Never risk more than you can afford to lose
- Backtest strategies before live trading
- Consider market conditions and news events
- Consult with financial advisors
The creators are not responsible for any trading losses incurred using this software.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push to branch:
git push origin feature/amazing-feature
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- TwelveData for market data API
- OpenAI for AI-powered analysis
- FastAPI for the backend framework
- React for the frontend framework
- Twilio for WhatsApp notifications
Built with β€οΈ by the TradeWithAns team
For support or questions, please open an issue on GitHub.