Technology

The heart of the project is 3T which is the Tactical Trend Trader. This collection of integrated components represents the technical manifestation of the rational, ordered, and powerful system that executes the mission. It is a sophisticated algorithmic and fully automated trading agent built upon a foundation of artificial intelligence, quantitative analysis, and decentralized finance protocols. The system's risk management controls target a strong memory of its immediate past state to find high persistence and stability.

System Architecture and Operational Cycle

The Tactical Trend Trader (3T) has evolved from a predictive machine learning paradigm to an adaptive, real-time optimization framework. The system operates as a persistent, stateful process that continuously evaluates market conditions to inform its trading decisions.

The architecture was deliberately designed to favor continuous, exploratory adaptation over retrospective prediction, directly addressing the limitations of models trained on historical data. The core operational cycle comprises four distinct stages that run in a continuous loop:

  1. Data Ingestion: The system acquires market data from two primary sources. A real-time websocket stream provides low-latency price updates for the optimization engine, while a historical API provides aggregated data for broader market analysis.

  2. Multi-Parameter Optimization: A massively parallel optimization engine continuously tests a large number of parameter permutations against live market data. This engine functions as a continuous stochastic policy generator, allowing the system to identify locally optimal configurations for the current market environment in real-time.

  3. Trade Evaluation and Execution: Using the most profitable parameter set discovered by the optimization engine, this module analyzes the market regime, evaluates entry signals, calculates position size, and executes trades.

  4. State Reconciliation: At scheduled intervals, this module manages risk at the portfolio level. It assesses the health of all open positions against the dynamic benchmark provided by the optimization engine and makes corrective adjustments, serving as an intelligent, system-wide stop-loss mechanism.

The Parameter Optimization Engine: A Shift from Prediction to Adaptation

The current architecture of 3T is the result of a deliberate evolution away from a more conventional, but ultimately less effective, machine learning paradigm.

The Abandoned Predictive Model

Early system development focused on a regression-based approach using a sophisticated bootstrap-aggregated ensemble of heterogeneous learners, including a Multi-layer Perceptron (MLP), various gradient-boosted tree models (LightGBM, CatBoost, XGBoost), a Random Forest, and others provided by AutoGluon. This model was retrained hourly with the goal of forecasting the expected profit and loss of potential trades.

However, over several months of study, this predictive approach consistently underperformed. The core issue was identified as "adaptation lag"; models trained on historical data are fundamentally retrospective and their learned patterns become stale in the face of new market dynamics. The pivotal insight was that for highly unpredictable environments,

online stochastic exploration is more effective than classic supervised learning. Consequently, the machine learning aspect was removed entirely in favor of the current paradigm.

The New Core: Real-Time Stochastic Optimization

The successful replacement for the ML ensemble is the

Parameter Optimization Engine. This engine operates as a continuous, massively parallel simulation layer that runs concurrently with the live trading system. Its purpose is to find the most profitable set of parameters for the core trading algorithm strictly as a function of out-of-sample performance on live data.

It functions as a stochastic decision engine. At each decision point, it generates a candidate policy by applying a random perturbation to a set of base parameters. This new policy is then evaluated in a virtual simulation against live market data. The engine employs an "accept-if-profitable" hill-climbing rule: if the simulated profit is positive, its parameters are adopted for the next cycle; otherwise, the policy is discarded. This mechanism allows the system to rapidly adapt to favorable market conditions while continuously exploring the parameter space.

Dynamic Risk & Position Management

The 3T framework introduces a novel, hybrid risk management model that abstracts risk from individual trades and manages it at the portfolio level.

Performance-Based Position Sizing

The system deliberately departs from the classical Kelly Criterion for position sizing, which can be sensitive to estimation errors. Instead, it employs a unique performance-based heuristic that dynamically modulates a base position size according to recent profitability.

A core rule is the

APR Gating Condition: the system will only increase its risk exposure if its rolling Annual Percentage Rate (APR) is trending positively and is above a target benchmark. This ensures that risk is escalated only during periods of sustained, proven profitability. If this condition is met, the final position size is calculated by adjusting a base size with a factor derived from the relative performance of current versus historical simulations.

The State Reconciliation Module

A key innovation in 3T is the omission of traditional, per-trade stop-loss orders, which are susceptible to transient volatility. Instead, risk is managed holistically through the State Reconciliation Module.

This module functions as a dynamic, portfolio-level risk manager that operates on a configured schedule (e.g., every 10 minutes) rather than being driven by immediate price action. During each cycle, it assesses the aggregate health of all open positions not against a static rule, but against the dynamic, real-time benchmark of expected performance generated by the thousands of simulations in the Parameter Optimization Engine.

A position is not closed simply because it is losing money, but because the system has discovered, via live simulation, that better parameter configurations exist for the current market conditions. This process serves as an intelligent, system-wide stop-loss mechanism that is always adapted to the present market environment.

Threshold Optimization

A core innovation of 3T is around how time and market data pricing behavior are handled. This allows for a set of dynamic features that introduce delays for a state-contingent decision-timing framework. These are optimized through the ANN training described above. It is 3T's mechanism for exercising algorithmic prudence, a direct counterpoint to the high-frequency trading (HFT) paradigm that prioritizes speed above all else. While HFT systems race to react within microseconds, often amplifying noise and contributing to market instability, 3T is designed to:

  • wait patiently for a clear, high-quality signal to emerge from the noise

  • treat many variable positions as a single integrated portfolio

  • when portfolio components become negative their risk allocation is removed but they continue to be monitored

  • when the overall portfolio is in a "draw down" state, this is considered a temporary credit facility to the instrument markets being traded which is managed through careful calibration of position size and margin to ensure the portfolio can sustain itself until hitting the expected profit objective.

  • introduce position 'bake time' which can be understood as a direct technical implementation of the cardinal virtue of prudence. It is an algorithmic discernment, a programmed patience that waits for clarity before acting. This deliberate approach is designed to improve the quality of trading decisions, normalize annualized percentage rates (APR) by avoiding trades in highly uncertain conditions, and ultimately enhance the long-term stability and profitability of the system.

Market Regime Analysis via Permutation Entropy

To prevent trading in stochastic and unpredictable market conditions, the system first performs a market regime analysis. For this task, 3T utilizes

Permutation Entropy to distinguish between predictable, trending regimes and random, non-trending noise. This methodology is chosen for its robustness to noise and its model-free nature.

The process is as follows:

  1. A time series is constructed from the most recent price points.

  2. Permutation Entropy,

    Is calculated on this time series using an optimized embedding dimension dd and time lag ττ.

  3. If the calculated entropy value is below a dynamically optimized threshold, the market is classified as "trending" and the algorithm proceeds to evaluate a trade. Otherwise, the market is classified as "noisy," and no new trading action is initiated.

Future: Hurst processes

Further research is underway to investigate the use of the Hurst exponent and Hurst processes to complement these entropy thresholds, particularly for optimizing performance during flat or highly oscillatory conditions.

Market Entropy
Hurst Exponent (H)
Action
Rationale

High

H≈0.5 (Random)

WAIT

Maximum uncertainty. The market is noisy and has no discernible structure.

High

H≠0.5 (Persistent)

WAIT

A potential trend or mean-reverting structure exists, but it is obscured by high noise. The signal is unreliable.

Low

H≈0.5 (Random)

WAIT

The market is not noisy, but it lacks a predictable structure. Future movements are random.

Low

H≠0.5 (Persistent)

ACT

Optimal Condition. The market is clear (low noise) and has a predictable structure (trending or mean-reverting). Deploy strategy.

Proof of Concept HyperLiquid DEX Integration

3T currently executes its strategies on the HyperLiquid decentralized exchange (DEX). This venue was specifically chosen for its unique combination of features that are critical for 3T's performance and mission alignment. To see the current proof of concept in action visit:

Execution Venue

HyperLiquid is built on its own high-performance Layer-1 blockchain, which supports a fully on-chain Central Limit Order Book (CLOB). This architecture provides the low-latency, high-throughput (up to 200,000 orders per second), and advanced order types characteristic of a centralized exchange (CEX), while preserving the core DeFi principles of transparency, non-custodial asset management, and permissionless access. This hybrid model offers the ideal environment for a sophisticated algorithmic agent, combining CEX-grade performance with blockchain-native integrity.

Once a symbol's simulated porfolio P&L shows a gain, 3T constructs and signs a transaction that is broadcasted to the exchange on-chain via market "liquidity taker" orders.

Tools

3T is built upon a foundation of robust, well-vetted, and primarily open-source technologies. This commitment to using industry-standard tools ensures reliability, facilitates maintenance, and invites collaboration from the broader community of developers and quantitative researchers. The following table outlines the core components of our technology stack.

Exchange API Interaction

The official Python SDK for interacting with HyperLiquid's REST and WebSocket APIs, enabling real-time data ingestion and automated trade execution.

pandas / numpy

Data Manipulation & Computation

The foundational libraries for all quantitative analysis in Python. Used for handling time-series data, performing numerical operations, and preparing data for the ANN models.

nolds (Current Reserach Focus)

Nonlinear Time-Series Analysis

A specialized library used to calculate the detrended fluctuation to help further classify out of sample market regime (trending vs. mean-reverting) during inference.

Last updated