DAFECharts - OS
DAFECharts - OS
1. Multi-Engine Chart Rendering
DAFE Charts renders price data through a multi-backend rendering pipeline supporting Canvas 2D, WebGL 2, WebGPU, and Three.js simultaneously. An adaptive performance governor monitors your frame rate in real time and auto-tunes shadow quality, gradient complexity, and particle density across four tiers (Low, Medium, High, Ultra) so the experience stays smooth whether you're on integrated graphics or a high-end GPU.
2. Twelve Bar Types
Beyond standard candlesticks, DAFE Charts offers 12 distinct price representations, each with its own dedicated rendering engine:
Candlestick -- Classic Japanese candlesticks
Heikin-Ashi -- Smoothed candles for trend clarity
Renko -- Price-movement bricks that filter noise
Range Bar -- Fixed price-range bars
Volume Bar -- Bars sized by fixed volume thresholds
Tick Bar -- Bars sized by tick count
Kagi -- Directional line breaks based on reversal amount
Footprint -- Bid/ask volume at each price level
Line -- Close-price line chart
Area -- Filled area chart
Dollar Bar -- Bars sized by fixed dollar volume
Imbalance Bar -- Order-imbalance bars
3. OakScript -- Custom Scripting Language
DAFE Charts ships with OakScript, a complete PineScript-inspired programming language built from scratch with its own lexer, parser, AST, and bar-by-bar interpreter. It supports:
Variables and persistent state (var, varip)
Control flow (if/else, for loops, while loops, ternary operators)
40+ built-in indicators (SMA, EMA, RSI, MACD, Bollinger Bands, ADX, Ichimoku, VWAP, and many more)
OakRing -- A fixed-size circular buffer with full statistics (sum, avg, min, max, median, std, percentile)
Matrix -- 2D grid operations (get/set, row/col, transpose, multiply, add, subtract)
22+ array functions and a full math library (trigonometry, logarithms, powers, etc.)
Color utilities for gradient-based visualizations
Input declarations for user-configurable parameters
Scripts can plot directly onto the chart or into dedicated lower panes, with a built-in code editor featuring syntax highlighting, documentation lookup, and an indicator category browser with 40+ pre-built examples.
4. 3D Indicator Visualizations
Powered by Three.js, DAFE Charts can render indicator data as full 3D geometry with 15 visualization styles:
Surface -- Color-mapped mesh with gradient coloring
Ribbon -- Glowing tube trace with transparency
Bars3D -- 3D columns sized by value
Scatter -- HSL-colored sphere clouds
Wireframe -- Surface in wireframe mode
Helix -- Spiral geometry
Vortex -- Swirling pattern
Manifold -- Complex curved surface
Nebula -- Particle cloud
Constellation -- Connected point network
Torus -- Donut geometry
Trail -- Time-series trail
Ridgeline -- Temporal distribution joyplot
And more
These can render in a dedicated lower pane, as a full-chart takeover unified with 3D price bars in a single scene with orbit controls, or as an overlay on the main chart.
5. Volume Profile
A built-in volume profile engine offers four rendering modes (2D-Side, 2D-Per-Bar, 3D-Extrude, 3D-Heatmap) with eight visual engines (3D-Depth, Thermal, Nebula, Quantum, DNA, Constellation, Liquid Metal, Neon Wireframe) and four color themes. It calculates Point of Control (POC), value area high/low, delta POC, and supports configurable bin count, lookback range, and value area percentage.
6. Drawing Tools
Eight drawing tools are available directly on the chart: Trend Line, Ray, Horizontal Line, Rectangle, Fibonacci Retracement, Channel, Text Label, and a Cursor for deselection. Drawings are color-coded with auto-rotation through a five-color palette, with undo and clear-all support.
7. AI Trade Advisor
An AI assistant powered by a local LLM (running via llama.cpp or Ollama) that can:
Analyze charts -- The visual adapter captures chart state into compact snapshots at three detail tiers and feeds them to the model
Identify patterns and evaluate risk/reward setups
Generate and edit OakScript code through the OakScript Bridge with permission flows
Search the web for news, earnings, and market intelligence via SerpAPI or DuckDuckGo
Voice interaction -- Wake-word detection ("Advisor"), continuous listening mode, and text-to-speech output with voice preferences
Conversation memory -- Persisted to IndexedDB with keyword search
Token optimization -- Dynamically adapts prompt size to the running model's context window, with support for dual models (advisor + coder) running concurrently
8. Paper Trading System
A full paper trading simulator with an abstract broker interface supporting market, limit, stop, stop-limit, and trailing-stop orders. Features include:
Configurable commission (per-trade, per-share, per-contract)
Configurable slippage (fixed-ticks or percentage)
Long and short position tracking
Realized and unrealized P&L
Order execution with realistic fills
Currency auto-detection from symbols (USD, EUR, GBP, JPY, CHF, CAD, AUD, NZD)
The trading panel is collapsible and draggable, with BUY/SELL buttons, spread display, quantity input that adapts units (shares/contracts/lots/coins), and account summary.
9. Hybrid Data Engine
A sophisticated multi-source data blending system that provides near-live market data at minimal API cost:
Massive API (paid) -- Authoritative price anchors, fetched sparsely
Yahoo Finance (free) -- Frequent corrections every 12 seconds
Ultra-synthetic engine -- Fills sub-second gaps between real updates, calibrated to realized volatility and drift
The synthetic path is always bracketed by real anchors, with a divergence guard that forces correction if drift exceeds 0.4%. It auto-detects symbol coverage and switches to paid-only when needed.
10. Market Hours Detection
Timezone-aware market hours for six market types: US Equities (NYSE/NASDAQ), US Futures (CME), Forex (24/5), Crypto (24/7), European (XETRA/LSE), and Asian (TSE). The system detects which market a symbol belongs to and enforces trading rules accordingly -- refusing to start live ticks outside market hours and auto-stopping on close.
11. GPU Particle System
A WebGPU compute-shader-driven particle system rendering 10,000+ particles at 60fps with gravity, drag, turbulence, and vortex forces. Four color modes (velocity, thermal, electric, cosmic) with automatic CPU fallback when WebGPU is unavailable. Particle density scales automatically based on GPU capability and performance tier.
12. Trading Strategies
Four quantitative strategy engines in the core package:
Adaptive Genesis Engine (AGE) -- An evolutionary algorithm that evolves trading strategies through population-based search, with a dedicated dashboard and 3D visualization themes
Dynamic Volume System (DVS) -- Volume-based signal generation
Market Structure Engine -- Swing point detection, profile levels, confluence zones, and intrabar analysis
Risk-Confidence Modulation (RCM) -- Risk-based signal modulation
13. Themes
Four built-in visual themes: DAFE Signature, Cyber Neon, Matrix, and Neon. Each theme defines the full color palette for bars, grids, backgrounds, indicators, and UI elements.
14. Background Visualizations
Four background modes: Stars (twinkling field), Particles (floating motes), Graph Grid, and Plain (solid dark).
15. Architecture
The application runs as three coordinated services launched from a single script:
llama-server (port 8081) -- Local LLM inference via llama.cpp with CUDA
Python/FastAPI backend (port 8788) -- Market data, web search, TTS, settings, model management
Vite frontend (port 5173) -- The charting application itself
Everything is self-contained in a monorepo with npm workspaces. The backend requires no database and no external services. The model manager auto-detects GPU hardware (NVIDIA, AMD, Apple Silicon), parses GGUF model architectures, and computes optimal launch parameters per model per machine. All four GGUF models (3B to 12B parameters) are stored locally and gitignored.