Crucible Platform Architecture v2.6

Quantitative Architecture & Execution Specifications

Crucible provides an end-to-end algorithmic trading infrastructure that bridges natural-language strategy formulation, deterministic AST code synthesis, multi-asset tick backtesting with statutory friction modeling, and sub-15ms multi-broker order dispatch.

01. NLP Compiler
AST grammar parser converting plain English into deterministic Python 3.11 strategies.
02. Broker Hooks
Low-latency REST & WebSocket execution bridges to Dhan, Zerodha, Angel One, and Upstox.
03. Backtest Engine
3-Year tick simulations with precise STT, exchange turnover fees, and liquidity slippage.
Core Synthesis Engine

1. Natural Language (NLP) Strategy Compiler

The NLP Strategy Compiler isolates natural-language intent recognition from deterministic code execution. It compiles conversational English rules into an Abstract Syntax Tree (AST) representing mathematical triggers, risk collars, and position sizing without LLM runtime hallucinations.

Compiler Pipeline & Validation Stages

Step 1: Tokenization & Entity Extraction: Resolves ticker symbols (e.g. NIFTY, BANKNIFTY, RELIANCE, CRUDEOIL, BTC/USDT), candle periodicity (1m, 5m, 15m, 1h, 1D), and indicator parameters (EMA periods, RSI thresholds, VWAP bands).
Step 2: Rule AST Formulation: Converts trade conditions into Boolean expressions:trigger = (cross_above(data['close'], ema(data, 20))) and (rsi(data, 14) > 55)
Step 3: Pre-Trade Risk Collar Injection: Mandates stop-loss collars (fixed %, ATR multiple, or trailing points) and maximum single-trade position limits before execution can be flagged valid.
Synthesized Python Strategy Output (Sandboxed AST)
class CrucibleStrategy(BaseStrategy):
    def __init__(self):
        self.fast_ema = 9
        self.slow_ema = 21
        self.stop_loss_pct = 0.01  # 1.0% Hard Collar
        self.target_pct = 0.025     # 2.5% Target

    def on_tick(self, candle, position):
        # Deterministic evaluation without runtime LLM dependencies
        if not position.is_open:
            if candle.ema(self.fast_ema) > candle.ema(self.slow_ema):
                return Signal.BUY(
                    qty=self.calculate_position_size(risk_pct=0.01),
                    sl=candle.close * (1 - self.stop_loss_pct),
                    tp=candle.close * (1 + self.target_pct)
                )
        return Signal.HOLD
Zero-Custody Execution Layer

2. Broker Execution Hooks & Gateways

Crucible implements a normalized Broker Gateway abstraction layer adhering to SEBI Algo Architecture circulars. Orders route directly from the client’s secure cloud container to the broker’s registered order routing server using AES-256-GCM hardware-secured API credentials.

Broker PartnerProtocol / HookOrder LatencySEBI Intermediary Role
DhanDhanHQ API v2 (WebSocket Order Feed)sub-18msMoneylicious Securities (INZ000006031)
ZerodhaKite Connect REST + Binary Tickersub-22msZerodha Broking Ltd (INZ000031633)
Angel OneSmartAPI WebSocket Gatewaysub-25msAngel One Limited (INZ000161534)
UpstoxUpstox API v2 OAuth Hooksub-20msRKSV Securities (INZ000185137)
FyersFyers Data API v3sub-24msFyers Securities (INZ000008524)
Pre-Trade RMS & Circuit Breakers
  • Max Single Order Qty Filter: Enforces SEBI price-band collars and prevents fat-finger errors before broker dispatch.
  • Max Daily Drawdown Kill Switch: Closes all active open positions and freezes broker API access if daily loss hits user-configured limit.
  • Static IP Gateway Routing: Dispatches all outbound orders via dedicated whitelisted IP gateways compliant with broker audit mandates.
Vectorized Financial Modeling

3. Backtest Engine Parameters & Statutory Friction (STT) Modeling

Unlike consumer backtesters that produce unrealistic paper profits with zero transaction costs, Crucible implements full Transaction Cost Analysis (TCA) reflecting the exact Indian statutory tax regime and exchange fee structures.

Statutory Friction & Fee Parameters Modeled in Every Backtest

Cost ComponentEquity IntradayEquity DeliveryFutures (NSE/MCX)Options (NSE)
Securities Transaction Tax (STT)0.025% on Sell0.1% Buy & Sell0.02% on Sell0.125% on Sell Premium
Exchange Turnover Fee0.00345% (NSE)0.00345% (NSE)0.002% (NSE)0.05% on Premium
SEBI Turnover Charges₹10 / Crore₹10 / Crore₹10 / Crore₹10 / Crore
Stamp Duty0.003% on Buy0.015% on Buy0.002% on Buy0.003% on Buy Premium
GST (Goods & Services Tax)18% on (Brokerage + Txn)18% on (Brokerage + Txn)18% on (Brokerage + Txn)18% on (Brokerage + Txn)
Default Brokerage₹20 or 0.03% / order₹0 / delivery₹20 flat / order₹20 flat / order
* Parameters are automatically re-calculated per trade tick and subtracted from gross PnL to yield net institutional return.

Key Statistical Evaluation Metrics

Deflated Sharpe Ratio (DSR)
Corrects for selection bias under multiple strategy testing (Bailey & López de Prado methodology).
Probability of Backtest Overfitting (PBO)
Combinatorially symmetric cross-validation (CSCV) over historical market regimes.
Sortino & Calmar Ratios
Downside volatility penalty and annualized return over maximum peak-to-trough drawdown.
Monte Carlo Reshuffling
10,000 randomized permutations testing trade sequence variance and worst-case drawdown tails.
Statutory Compliance

4. SEBI Regulatory Positioning & Zero Custody Architecture

Crucible is architected in strict compliance with the SEBI circular dated February 04, 2025 on algorithmic trading systems, Information Technology (Intermediary Guidelines) Rules 2021, and the DPDP Act 2023.

Non-Custodial, Non-Advisory Software Vendor Principle

Crucible Technologies Private Limited operates strictly as a quantitative technology infrastructure provider. Crucible never holds, touches, or pools user trading funds. All capital resides exclusively in the user’s individual demat and trading account with their chosen SEBI-registered stock broker.

Ready to test Crucible's quantitative engine?
Launch the interactive strategy builder sandbox or explore paper trading without capital risk.