Skip to content

hatimtoor/binarytradingbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binary Signals — On-Demand Binary Options Signal Generator

A private web app for a small team to generate binary options trading signals on demand.

How It Works

  1. Log in → select any asset (forex, crypto, stocks, indices)
  2. Choose expiry timeframe (1m, 5m, 15m, 30m, 1h, 4h)
  3. Click Generate Signal → get a full signal card in under 5 seconds

Signal engine: Indicator consensus (RSI, MACD, Bollinger Bands, Stochastic, EMA) is the PRIMARY signal. ML model agreement is an optional overlay badge.

Stack

Layer Technology
Backend Python 3.11 + FastAPI + SQLAlchemy
Signal Engine ta library + scikit-learn/XGBoost
Frontend Next.js 14 + TailwindCSS
Database PostgreSQL
Auth JWT via httpOnly cookies (Next.js proxy)
Data Twelve Data API (free tier: 800 calls/day)
Deploy Vercel (frontend) + Railway (backend + DB)

Quick Start (Docker)

# 1. Clone and configure
cp backend/.env.example backend/.env
# Edit backend/.env — set TWELVE_DATA_API_KEY

# 2. Start all services
docker compose up

# 3. Seed users
docker compose exec backend python scripts/seed_users.py

# 4. Open http://localhost:3000
# Login: [email protected] / changeme123

Manual Setup

Backend

cd backend
python -m venv venv && source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env  # fill in values
uvicorn app.main:app --reload

Frontend

cd frontend
cp .env.local.example .env.local  # set BACKEND_URL=http://localhost:8000
npm install
npm run dev

Run Tests

cd backend && pytest -v

ML Model Training (Optional)

The ML overlay is disabled by default (no models trained). To enable it:

cd backend
python scripts/train_model.py

Models are saved to app/ml/. If walk-forward accuracy < 55%, the overlay is auto-disabled for that timeframe.

Deployment

Railway (Backend)

  1. Create Railway project → add PostgreSQL plugin
  2. Set env vars: DATABASE_URL, JWT_SECRET, TWELVE_DATA_API_KEY, CORS_ORIGINS, ENVIRONMENT=production, COOKIE_DOMAIN=your-vercel-domain.app
  3. Deploy from backend/ directory (uses Procfile)
  4. Run: python scripts/seed_users.py

Vercel (Frontend)

  1. Import frontend/ directory
  2. Set env var: BACKEND_URL=https://your-railway-backend-url
  3. Deploy

API Budget

Twelve Data free tier: 800 calls/day

Scenario Daily calls Status
Normal (5 users, 15 signals/day, 40% cache miss) ~30 Safe
Heavy (5 users, 50 signals/day, 60% miss) ~150 Safe
Cold start (many new assets) ~450 Approaching limit

Paid tier ($29/mo) unlocks real-time data + 800 calls/minute.

Acceptance Criteria

All 10 ACs verified:

  • Login with valid credentials; invalid rejected
  • Unauthenticated /api/v1/signals/* returns 401
  • Unauthenticated browser visits redirect to /login
  • Search and select assets from all 4 classes
  • All 6 timeframes selectable
  • Signal card returned in < 5 seconds
  • Signal card shows asset, direction, confidence, entry time, expiry, indicator breakdown
  • Signal persisted and visible in history (500 max per user)
  • Responsive on 375px mobile viewport
  • 10 concurrent requests complete within 8 seconds

About

This repo contains the code for the best binary indicator that has ever been built.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors