Skip to content

Repository files navigation

ALPHX Institutional Trading Terminal

Next.js 14 Algorithmic Cryptocurrency Interface & TradingView Analytics Suite

Next.js React TypeScript Tailwind CSS Zustand TradingView License: MIT

ALPHX Terminal is an institutional-grade cryptocurrency web terminal built with Next.js 14 App Router, TypeScript, Tailwind CSS, and Zustand. Designed for professional traders and quantitative researchers, it pairs with the ALPHX Quantitative Backend to visualize real-time candlestick charts with custom technical overlays (Support/Resistance, Fair Value Gaps, ATR levels), display multi-model consensus signals, manage dual-currency capital (USD $ & INR β‚Ή), and execute orders seamlessly across Manual, Semi-Automatic, and Autonomous Sentinel modes.


πŸ“‘ Table of Contents

  1. Interface & Layout Architecture
  2. Core Feature Breakdown
  3. Dual-Currency (USD $ & INR β‚Ή) Precision System
  4. Execution Workflow Modes
  5. Telegram Signal Broadcaster & Channel Linking
  6. Interactive TradingView Chart Canvas & Overlays
  7. Project Structure
  8. Installation & Development Guide
  9. Production Deployment
  10. Environment Variables
  11. License

πŸ–₯ Interface & Layout Architecture

The terminal is engineered as a responsive, high-density 3-column workspace with persistent top and bottom telemetry docks:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ TOPBAR: Brand Logo β”‚ Active Ticker ($ & β‚Ή) β”‚ Trading Mode (Futures/Margin/Spot) β”‚ Balance Pill ($/β‚Ή) β”‚ Controls  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ LEFT: MARKET         β”‚ CENTER: INTERACTIVE TRADINGVIEW CHART                      β”‚ RIGHT: QUANTITATIVE HUB      β”‚
β”‚ SCREENER             β”‚ β€’ High-performance Candlestick Canvas                      β”‚ β€’ Quantitative Verdict Card  β”‚
β”‚ β€’ Search & Filter    β”‚ β€’ Dynamic Overlays: S&R, FVG, ATR Target Bands             β”‚   (Consensus, Confidence %)  β”‚
β”‚ β€’ USDT / INR / BTC   β”‚ β€’ Timeframe Switcher (1m, 5m, 15m, 1h, 4h, 1d)             β”‚ β€’ Model Vote Telemetry       β”‚
β”‚ β€’ 24h Price & Volume β”‚ β€’ Auto-Zoom / Fit Candle View                              β”‚ β€’ Execution Center           β”‚
β”‚ β€’ Favorites Tracking β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   (Leverage, Dual Currency)  β”‚
β”‚                      β”‚ CHART BOTTOM ACTION BAR: Live Price β”‚ Quick Buy/Sell β”‚ TG  β”‚ β€’ Factor Reasoning Accordion β”‚
β”‚                      β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β€’ Live Telemetry Matrix      β”‚
β”‚                      β”‚ BOTTOM DOCK: Active Positions Table β”‚ Spot & Margin Balancesβ”‚   (RSI, ADX, ATR, MACD, BB)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🌟 Core Feature Breakdown

1. Market Screener (MarketScreener.tsx)

  • Multi-Quote Currency Filtering: Switch effortlessly between ALL, USDT, INR, and BTC denominated pairs.
  • Instant Dynamic Switching: Selecting any market immediately repopulates the central chart, resets WebSocket feeds, updates order book depth, and synchronizes signal models.
  • Smart Search: Filter pairs by base or quote symbol with debounced indexing.

2. Interactive Chart Canvas (TradingViewChart.tsx)

  • Engineered on Lightweight Charts v4: Capable of streaming 60fps tick updates with zero browser thread lag.
  • Algorithmic Canvas Overlays:
    • Support & Resistance (S&R): Clusters price pivot levels with color-coded horizontal boundary bands.
    • Fair Value Gaps (FVG): Visualizes 3-candle institutional liquidity imbalances with transparent bounding boxes.
    • ATR Dynamic Setup: Overlays entry lines, dynamic stop losses, and multi-tier take profit targets directly onto the canvas.
  • Auto-Fit View: Re-scales and fits historical candle geometry instantly upon asset selection.

3. Chart Bottom Action Bar (ChartActionBar.tsx)

  • Persistent command strip directly under the candlestick canvas.
  • Displays clean market pair name, live Dollar price, and INR equivalent side by side.
  • 1-Click Quick Execution:
    • [ πŸš€ BUY / LONG ]: Executes a long order sized to $2%$ portfolio risk.
    • [ πŸ”» SELL / SHORT ]: Executes a short order sized to $2%$ portfolio risk.
  • Telegram Broadcast Trigger: 1-click dispatch to your linked Telegram channel.

4. Quantitative Signal & Model Consensus (SignalCard.tsx)

  • Displays consensus direction (STRONG BUY, STRONG SELL, HOLD / NEUTRAL).
  • Consensus Tag: Displays model agreement level (UNANIMOUS (3/3), MAJORITY (2/3), or SPLIT).
  • Telemetry Breakdown: Displays individual voting probabilities across technical and statistical engines.
  • Dynamic Setup Levels: Shows exact ATR calculated Entry, Stop Loss, and Take Profit 1 with dual-currency values.

5. Execution Center (TradePanel.tsx)

  • Leverage Slider: Supports variable leverage from $1\times$ to $25\times$.
  • Dual-Currency Sizing Input: Toggle between $ USD and β‚Ή INR inputs with real-time cross-currency conversions.
  • Auto-Risk Calculation: Automatically sizes quantities based on account equity and stop loss distance to enforce strict capital preservation.

6. Positions & Balances Dock (BottomDrawer.tsx)

  • Collapsible bottom drawer displaying active positions with real-time Mark Price, Liquidation Price, and Unrealized PnL in both USD and INR (+$16.00 (+β‚Ή1,599)).
  • 1-Click Position Exit with exchange synchronization.
  • Balances tab displaying total and available funds with native currency symbols (β‚Ή for INR, $ for USDT).

πŸ’± Dual-Currency (USD $ & INR β‚Ή) Precision System

To provide frictionless experience for Indian and global traders, all components display dual currencies side by side:

Component USD Display INR Equivalent Display
Topbar Balance $TotalUsd (β‚ΉTotalInr)
Market Tickers $Price (β‚ΉPriceInr)
Trade Setup Levels $Entry, $SL, $TP1 (β‚ΉEntry), (β‚ΉSL), (β‚ΉTP1)
Trade Execution $ Custom USD Amount β‚Ή Custom INR Amount
Unrealized PnL +$PnL_USD (+β‚ΉPnL_INR)
Asset Balances $ Amount (USDT) β‚Ή Amount (INR)

The live conversion rate is synchronized dynamically from the backend currency provider (with $99.95$ fallback).


⚑ Execution Workflow Modes

The terminal supports 3 execution philosophies configured via terminalStore.ts:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               EXECUTION ENGINE SELECTOR                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚    1. MANUAL      β”‚  2. SEMI-AUTO    β”‚     3. AUTO     β”‚
β”‚ Trader controls   β”‚ 15s High-Priorityβ”‚ Sentinel Loop   β”‚
β”‚ every execution   β”‚ Approval Modal   β”‚ Hands-off Auto  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. Manual Mode:
    • Trader inspects quantitative reasoning and executes manually via the Execution Center or Chart Bottom Bar.
  2. Semi-Automatic Mode:
    • When the backend emits a directional signal with confidence $\ge 70%$, a high-priority 15-Second Confirmation Modal (SemiAutoModal.tsx) appears with an auditory chime.
    • Trader can click Approve & Execute or let it expire safely.
  3. Autonomous Mode (Sentinel Auto-Trade):
    • Background hook (useAutoTrade.ts) automatically places verified orders on CoinDCX/Paper trading when high-confidence signals trigger, with built-in deduplication against double execution.

πŸ“’ Telegram Signal Broadcaster & Channel Linking

The terminal integrates with @alphx_signal_bot for instant signal distribution:

How to Connect Your Telegram Channel in 60 Seconds:

  1. Open your Telegram Channel or Group.
  2. Navigate to Channel Settings $\rightarrow$ Administrators $\rightarrow$ Add Administrator.
  3. Search for @alphx_signal_bot and grant permission to Post Messages.
  4. In your channel, send any test message (e.g. test), or send /start to @alphx_signal_bot in a private chat.
  5. In the ALPHX Terminal Topbar, click Telegram (or the gear icon in the Chart Bottom Bar).
  6. Click ⚑ Auto-Detect Chat ID β€” the bot will discover your channel and auto-fill the Chat ID.
  7. Click Send Test Ping to verify message delivery.
  8. Enable Auto-Broadcast if you want high-confidence signals pushed automatically!

πŸ“ Project Structure

AI_singal/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ layout.tsx             # Root layout & font configurations
β”‚   β”‚   β”œβ”€β”€ page.tsx               # Main 3-column trading terminal canvas
β”‚   β”‚   └── globals.css            # Tailwind & custom terminal styling rules
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ chart/
β”‚   β”‚   β”‚   β”œβ”€β”€ TradingViewChart.tsx # Lightweight Charts canvas & overlay drawing
β”‚   β”‚   β”‚   └── ChartActionBar.tsx   # Persistent chart bottom execution bar
β”‚   β”‚   β”œβ”€β”€ execution/
β”‚   β”‚   β”‚   β”œβ”€β”€ TradePanel.tsx       # Execution Center & dual-currency risk controls
β”‚   β”‚   β”‚   └── SemiAutoModal.tsx    # 15s high-priority trade approval modal
β”‚   β”‚   β”œβ”€β”€ layout/
β”‚   β”‚   β”‚   β”œβ”€β”€ Topbar.tsx           # Global header, balance pill, mode switcher
β”‚   β”‚   β”‚   └── ExchangeModal.tsx    # CoinDCX API connection modal
β”‚   β”‚   β”œβ”€β”€ positions/
β”‚   β”‚   β”‚   └── BottomDrawer.tsx     # Active positions & balances docking drawer
β”‚   β”‚   β”œβ”€β”€ screener/
β”‚   β”‚   β”‚   └── MarketScreener.tsx   # Searchable asset screener with quote tabs
β”‚   β”‚   β”œβ”€β”€ signal/
β”‚   β”‚   β”‚   β”œβ”€β”€ SignalCard.tsx       # Quantitative verdict & model consensus gauge
β”‚   β”‚   β”‚   β”œβ”€β”€ ReasoningAccordion.tsx # Expandable technical factor breakdown
β”‚   β”‚   β”‚   └── IndicatorMatrix.tsx  # 6-indicator live technical telemetry grid
β”‚   β”‚   β”œβ”€β”€ telegram/
β”‚   β”‚   β”‚   └── TelegramModal.tsx    # Telegram bot configuration & chat discovery
β”‚   β”‚   β”œβ”€β”€ ui/
β”‚   β”‚   β”‚   └── AlphxLogo.tsx        # Terminal vector branding badge
β”‚   β”‚   └── webhook/
β”‚   β”‚       └── WebhookModal.tsx     # Inbound TradingView webhook automation
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ useAutoTrade.ts          # Automated trade execution listener
β”‚   β”‚   └── useWebSocket.ts          # Real-time CoinDCX ticker & candle feed hook
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── api.ts                   # Typed Axios client & backend REST client
β”‚   β”œβ”€β”€ store/
β”‚   β”‚   β”œβ”€β”€ exchangeStore.ts         # Balances, positions, & connection state
β”‚   β”‚   β”œβ”€β”€ telegramStore.ts         # Channel ID & auto-broadcast settings
β”‚   β”‚   └── terminalStore.ts         # Active pair, timeframe, analysis, & mode
β”‚   └── types/
β”‚       └── index.ts                 # Complete TypeScript interfaces & schemas
β”œβ”€β”€ public/                          # Static assets
β”œβ”€β”€ .env.example                     # Environment variable template
β”œβ”€β”€ next.config.js                   # Next.js build configuration
β”œβ”€β”€ package.json                     # Node.js dependencies & scripts
β”œβ”€β”€ tailwind.config.ts               # Custom institutional color theme
β”œβ”€β”€ tsconfig.json                    # TypeScript compiler options
└── README.md

πŸš€ Installation & Development Guide

1. Prerequisites

2. Clone Repository

git clone https://github.com/your-username/AI_singal.git
cd AI_singal

3. Install Dependencies

npm install

4. Configure Environment Variables

Copy the template into a .env.local file:

cp .env.example .env.local

Verify your .env.local settings:

NEXT_PUBLIC_API_URL=http://localhost:8000/api
NEXT_PUBLIC_WS_URL=ws://localhost:8000/api/ws
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
NEXT_PUBLIC_DEFAULT_PAIR=B-BTC_USDT
NEXT_PUBLIC_DEFAULT_TIMEFRAME=15m

5. Start Development Server

npm run dev

Open http://localhost:3000 in your browser to view the terminal.


πŸ— Production Deployment

1. Build Verification

Run TypeScript validation and optimized Next.js build:

npx tsc --noEmit
npm run build

2. Start Production Server

npm run start

3. Deploying to Vercel

  1. Import the repository on Vercel.
  2. Configure Environment Variables (NEXT_PUBLIC_API_URL, NEXT_PUBLIC_WS_URL).
  3. Deploy with standard Next.js preset.

πŸ“œ License

This project is licensed under the MIT License β€” see the LICENSE file for details.

About

ALPHX Terminal is an institutional-grade cryptocurrency web terminal built with Next.js 14 App Router, TypeScript, Tailwind CSS, and Zustand. Designed for professional traders and quantitative researchers, it pairs with the ALPHX Quantitative Backend to visualize real-time candlestick charts with custom technical overlays (Support/Resistance, Fair

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages