Micro gravity regression AIselfregulation system
- Indicatori
- Jingfeng Luo
- Versione: 16.2
- Aggiornato: 13 dicembre 2025
- Attivazioni: 5
AI Adaptive Market Holographic System Indicator Based on Microstructure and Field Theory
Abstract:
This paper aims to explore the construction principles and implementation mechanism of a novel financial market analysis tool—the Micro gravity regression AIselfregulation system. This system fuses Market Microstructure theory, classical mechanics (elasticity and gravity models), information entropy theory, and adaptive AI algorithms. By aggregating Tick-level data in real-time, physically modeling absorption density, and utilizing an entropy-based dynamic decay mechanism, the system attempts to build a dynamic physical field capable of quantifying market "Mass," "Tension," and "State," providing visualized decision support for high-frequency and swing trading.
1. Introduction
Traditional technical indicators (such as MA, RSI) are mostly based on linear processing of closing prices, which often results in lag and difficulty in capturing the internal gaming details of price. With the development of high-frequency trading, data based on Order Flow and microstructure has become crucial. The MicroStructure HUD system proposed in this study no longer views price merely as a numerical sequence but as a physical entity with "Mass" and "Energy." By simulating the Center of Mass (CoM) in a physical field and the elastic tension under Hooke's Law, it reveals the intrinsic driving forces of price movement.
2. Implementation Logic & Process
The core code implementation of this system can be decomposed into four coupled modules: the Data Aggregation Layer, the Physics Calculation Layer, the Entropy-Weighted Adaptive Layer, and the AI Learning Layer.
2.1 Data Aggregation Layer: Footprint Aggregation
-
Logic: The system first intercepts every Tick (price change) in the market in real-time via the UpdateFootprintData function.
-
Process:
-
Binning: The price space is divided into several discrete price levels (Bins) according to a GlobalStep (e.g., 0.5 or 1.0 points).
-
Flow Direction Identification: By comparing the price change between the current Tick and the previous Tick, it determines whether it is an active Buy or active Sell.
-
Accumulation: Within the BarFP structure of each candlestick, the system dynamically accumulates the volume (Ticks), buy volume, and sell volume for each price level.
-
-
Purpose: To transform time-series data into spatial distribution data, constructing the "material basis" of the market.
2.2 Physics Calculation Layer: Mass & Absorption Density (Physics Engine & Absorption)
-
Logic: Based on the hypothesis that "Volume equals Mass," the system calculates the market's Center of Mass (CoM). Version 16.0 introduces the concept of "Absorption Density."
-
Process:
-
Density Weighting: In CalculatePhysics, mass is no longer just volume. The system calculates the buy/sell imbalance:
$$Imbalance = \frac{|Buy - Sell|}{Total}$$$$DensityFactor = 1.0 + Imbalance \times (Gain - 1.0)$$ -
Scientific Basis: The more intense the struggle between bulls and bears (high imbalance), the greater the "density" at that price node, forming a more solid support/resistance.
-
Time Decay: A decay factor ( decay_factor ) is introduced; data further from the current time contributes less mass ($Weight = Decay^{Distance}$).
-
Center of Mass (CoM) Calculation:
$$CoM = \frac{\sum (Price_i \times Mass_i)}{\sum Mass_i}$$ -
Tension Calculation: Based on Hooke's Law, the system calculates the restorative force (Tension) generated by the deviation of the current price from the CoM.
$$Tension = (Price - CoM) \times K_{elasticity}$$
-
2.3 Entropy-Weighted Adaptive Layer: Dynamic Memory (Entropy & Dynamic Decay)
-
Logic: Market states switch between ordered (trend) and disordered (oscillation). The system uses CalculateEfficiency to compute the Efficiency Ratio (ER) as a proxy indicator for "Negative Entropy."
-
Implementation:
-
If ER is high (obvious trend), the system increases the decay coefficient (e.g., 0.99), shifting from short-term memory to long-term memory, because trends have inertia.
-
If ER is low (market chaos), the system decreases the decay coefficient (e.g., 0.80), accelerating the forgetting of historical data to adapt to rapid changes.
-
2.4 AI Learning Layer: Parameter Auto-Repair (Active AI Learning)
-
Logic: Through the TrainModel function, the system possesses self-reflection capabilities.
-
Process:
-
Prediction: Records historical high-tension states ( Tension Alert ).
-
Validation: After $N$ periods, checks if the price has reversed as expected (returned to the Center of Mass).
-
Reward/Punishment:
-
If the prediction succeeds (high tension leads to reversal), the current parameters are reinforced.
-
If the prediction fails (price continues to break through after high tension), the elasticity coefficient $K$ is reduced (indicating the market has broken its original constraints and entered a new equilibrium), or parameters are penalized.
-
-
Forgetting: Parameter corrections naturally decay back to baseline values over time to prevent overfitting.
-
3. Scientific Basis
3.1 Market Microstructure Theory
The Bin structure in the code directly corresponds to the Limit Order Book (LOB) and Trade Flow in microstructure theory.
-
Absorption: The practice of increasing mass weight via Imbalance in the code scientifically simulates the "absorption" phenomenon. When a large number of Market Orders attack a specific price level but the price does not move, it implies that Limit Orders have absorbed all liquidity. In the physical model, this manifests as extreme "density" at that location, making it difficult to penetrate (High Mass results in strong CoM traction).
3.2 Statistical Mechanics & Mean Reversion
-
Center of Mass (CoM): Represents the market's "Fair Value" or "Consensus Zone." According to statistical mechanics, particles (prices) always tend to distribute in the state of lowest energy (near the center of mass).
-
Tension: Quantifies the degree of price deviation from the consensus. Excessive deviation leads to an increase in system potential energy, which in turn generates a reverse restorative force. When Tension > AlertThreshold , it implies the market is in an unstable state, and the probability of Mean Reversion or a Phase Transition (Breakout) is extremely high.
3.3 Information Entropy & Adaptive Systems
The InpDynamicDecay logic referenced in the code is based on cybernetics.
-
Low Entropy State (Trend): High information transmission efficiency; historical prices have strong guiding significance for the future, so the system extends memory (High Decay).
-
High Entropy State (Oscillation): The market is filled with noise; historical information quickly becomes invalid, so the system shortens memory (Low Decay). This design solves the adaptability problem of traditional indicators with "fixed parameters" across different market conditions.
4. Analysis & Conclusion
4.1 Visual Analysis: Orange Core & Red Alert
-
Orange Blocks (Core Support): In the visualization, the orange areas identified by the code logic phy_grid[i].state == "Core" represent high-density, large-mass zones. These are defensive lines built by actual capital commitment from both bulls and bears, serving as strong support/resistance levels in trading.
-
Red Connection Lines (Stress Alert): When the tension line turns red ( Tension > 8.0 ), it indicates that the price is like a rubber band stretched to its limit. At this point, one should not chase the trend but look for reversal signals.
4.2 Limitations & Advantages of the Model
-
Advantages: This model completely detaches from lagging MA algorithms, modeling directly based on the physical properties of transactions. The identification of support and resistance has physical precision. The introduction of the AI module gives it rudimentary "evolutionary" capabilities.
-
Limitations: Driven by high-volatility news events, physical laws may temporarily fail (e.g., price gaps escaping the gravitational field). Therefore, InpTensionAlert is introduced in the code as a phase transition warning.
4.3 Conclusion
The "Micro gravity regression AI self-regulation system" is not just an indicator; it is a physical simulation system based on the four-dimensional space of Price-Volume-Time-Entropy. Through the layered analysis of the code logic, we see that it uses the "density" of micro-data to build a gravitational field, uses "entropy" to regulate time perception, and uses "AI" to correct physical constants. This interdisciplinary fusion provides a brand-new analytical perspective for quantitative trading based on first principles.
Keywords: Market Microstructure, Center of Mass, Algorithmic Trading, Adaptive System, MQL5

This indicator is truly exciting. I use it to understand market state transitions, and it works great for that purpose. It can also be helpful for identifying reversal points or deciding profit‑taking levels when letting a position run. I recommend it to anyone who feels that ordinary indicators just aren’t enough.