@pgnio/helios-mcp 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -2
- package/dist/chunk-NWGWXYTS.mjs +2964 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +2946 -0
- package/dist/cli.mjs +24 -0
- package/dist/index.d.mts +2137 -0
- package/dist/index.d.ts +2137 -0
- package/dist/index.js +3021 -0
- package/dist/index.mjs +52 -0
- package/docs/ai-agent-indicators/00_index.txt +210 -0
- package/docs/ai-agent-indicators/activity_ratio.txt +166 -0
- package/docs/ai-agent-indicators/activity_zscore.txt +166 -0
- package/docs/ai-agent-indicators/bayesian_overbought.txt +134 -0
- package/docs/ai-agent-indicators/directional_efficiency.txt +134 -0
- package/docs/ai-agent-indicators/hfi.txt +172 -0
- package/docs/ai-agent-indicators/hfi_weights.txt +124 -0
- package/docs/ai-agent-indicators/hmi.txt +305 -0
- package/docs/ai-agent-indicators/hmi_velocity.txt +155 -0
- package/docs/ai-agent-indicators/hurst_exponent.txt +136 -0
- package/docs/ai-agent-indicators/macd_divergence.txt +133 -0
- package/docs/ai-agent-indicators/macd_histogram.txt +145 -0
- package/docs/ai-agent-indicators/macd_signal.txt +119 -0
- package/docs/ai-agent-indicators/market_structure.txt +201 -0
- package/docs/ai-agent-indicators/poc.txt +131 -0
- package/docs/ai-agent-indicators/poc_distance.txt +129 -0
- package/docs/ai-agent-indicators/regime.txt +225 -0
- package/docs/ai-agent-indicators/rsi_divergence.txt +145 -0
- package/docs/ai-agent-indicators/squeeze_duration.txt +115 -0
- package/docs/ai-agent-indicators/squeeze_energy.txt +128 -0
- package/docs/ai-agent-indicators/support_resistance.txt +169 -0
- package/docs/ai-agent-indicators/tf_alignment.txt +165 -0
- package/docs/ai-agent-indicators/trend_interpretation.txt +98 -0
- package/docs/ai-agent-indicators/trend_strength.txt +134 -0
- package/docs/ai-agent-indicators/value_area_position.txt +142 -0
- package/docs/ai-agent-indicators/volatility_clustering.txt +160 -0
- package/docs/ai-agent-indicators/volatility_squeeze.txt +169 -0
- package/docs/ai-agent-indicators/volume_change_point.txt +151 -0
- package/docs/ai-agent-indicators/vwap.txt +133 -0
- package/docs/ai-agent-indicators/vwap_zscore.txt +154 -0
- package/docs/ai-agent-indicators/weighted_rsi.txt +148 -0
- package/docs/ai-agent-mcp/00_index.txt +110 -0
- package/docs/ai-agent-mcp/01_auth/00_overview.txt +51 -0
- package/docs/ai-agent-mcp/01_auth/01_tools.txt +94 -0
- package/docs/ai-agent-mcp/01_auth/02_data_contracts.txt +38 -0
- package/docs/ai-agent-mcp/01_auth/03_decision_rules.txt +25 -0
- package/docs/ai-agent-mcp/01_auth/04_failures_and_recovery.txt +46 -0
- package/docs/ai-agent-mcp/02_account/00_overview.txt +29 -0
- package/docs/ai-agent-mcp/02_account/01_tools.txt +67 -0
- package/docs/ai-agent-mcp/02_account/02_data_contracts.txt +34 -0
- package/docs/ai-agent-mcp/02_account/03_decision_rules.txt +17 -0
- package/docs/ai-agent-mcp/02_account/04_failures_and_recovery.txt +17 -0
- package/docs/ai-agent-mcp/03_market/00_overview.txt +27 -0
- package/docs/ai-agent-mcp/03_market/01_tools.txt +102 -0
- package/docs/ai-agent-mcp/03_market/02_data_contracts.txt +39 -0
- package/docs/ai-agent-mcp/03_market/03_decision_rules.txt +22 -0
- package/docs/ai-agent-mcp/03_market/04_failures_and_recovery.txt +18 -0
- package/docs/ai-agent-mcp/04_trading/00_overview.txt +25 -0
- package/docs/ai-agent-mcp/04_trading/01_tools.txt +123 -0
- package/docs/ai-agent-mcp/04_trading/02_data_contracts.txt +42 -0
- package/docs/ai-agent-mcp/04_trading/03_decision_rules.txt +30 -0
- package/docs/ai-agent-mcp/04_trading/04_failures_and_recovery.txt +25 -0
- package/docs/ai-agent-mcp/05_ledger/00_overview.txt +31 -0
- package/docs/ai-agent-mcp/05_ledger/01_tools.txt +80 -0
- package/docs/ai-agent-mcp/05_ledger/02_data_contracts.txt +46 -0
- package/docs/ai-agent-mcp/05_ledger/03_decision_rules.txt +44 -0
- package/docs/ai-agent-mcp/05_ledger/04_failures_and_recovery.txt +24 -0
- package/package.json +66 -3
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
================================================================================
|
|
2
|
+
INDICATOR: TREND_STRENGTH
|
|
3
|
+
================================================================================
|
|
4
|
+
id: trend_strength
|
|
5
|
+
data_field: indicators.trend_strength
|
|
6
|
+
type: NUMERIC
|
|
7
|
+
range: 0.0 to 100.0
|
|
8
|
+
precision: 1 decimal place
|
|
9
|
+
update_rate: per_tick
|
|
10
|
+
latency_profile: COINCIDENT
|
|
11
|
+
|
|
12
|
+
--------------------------------------------------------------------------------
|
|
13
|
+
CONSTRUCT
|
|
14
|
+
--------------------------------------------------------------------------------
|
|
15
|
+
trend_strength measures how strongly price is moving in a single direction
|
|
16
|
+
across all timeframes, using a directional index (DX) approach similar to the
|
|
17
|
+
ADX construction but applied to a multi-timeframe weighted framework.
|
|
18
|
+
|
|
19
|
+
For each timeframe, directional components are computed:
|
|
20
|
+
posSum = sum of positive (upward) normalized changes across TFs
|
|
21
|
+
negSum = sum of |negative| (downward) normalized changes across TFs
|
|
22
|
+
|
|
23
|
+
Cluster weights applied to normalize contribution:
|
|
24
|
+
micro [1m, 3m, 5m] : weight = 1.00
|
|
25
|
+
short [15m, 30m, 1h] : weight = 0.85
|
|
26
|
+
medium [2h, 4h, 6h] : weight = 0.70
|
|
27
|
+
macro [8h, 12h, 24h] : weight = 0.55
|
|
28
|
+
|
|
29
|
+
DX formula:
|
|
30
|
+
diPlus = (posSum / totalAbs) × 100
|
|
31
|
+
diMinus = (negSum / totalAbs) × 100
|
|
32
|
+
dx = (|diPlus - diMinus| / (diPlus + diMinus)) × 100
|
|
33
|
+
value = dx (clamped to [0, 100])
|
|
34
|
+
|
|
35
|
+
A value of 100 means ALL movement is in ONE direction (perfect trending).
|
|
36
|
+
A value of 0 means equal amounts of upward and downward movement (perfect chop).
|
|
37
|
+
trend_strength does NOT encode direction — only the magnitude of directional bias.
|
|
38
|
+
Use in conjunction with hmi or regime to determine which direction is trending.
|
|
39
|
+
|
|
40
|
+
--------------------------------------------------------------------------------
|
|
41
|
+
RANGE INTERPRETATION
|
|
42
|
+
--------------------------------------------------------------------------------
|
|
43
|
+
value >= 60
|
|
44
|
+
Strong trending. The directional imbalance is significant — substantially
|
|
45
|
+
more movement is in one direction than the other, weighted across all TF
|
|
46
|
+
clusters. The current directional bias is well-established and broad.
|
|
47
|
+
|
|
48
|
+
value >= 40 AND value < 60
|
|
49
|
+
Moderate trending. A meaningful directional imbalance exists but is not
|
|
50
|
+
extreme. Some timeframes may be countertrending while the majority confirms
|
|
51
|
+
direction. Trading with the trend has a statistical edge but with noise.
|
|
52
|
+
|
|
53
|
+
value >= 20 AND value < 40
|
|
54
|
+
Weak trending. Minor directional imbalance. The market has SOME bias
|
|
55
|
+
but it is faint. Countertrend activity is significant. Not reliable for
|
|
56
|
+
directional entries.
|
|
57
|
+
|
|
58
|
+
value < 20
|
|
59
|
+
Ranging / choppy. Near-equal amounts of upward and downward movement across
|
|
60
|
+
timeframes. No meaningful directional bias. Equivalent to CHOP regime signal.
|
|
61
|
+
Directional indicators carry no reliable information in this state.
|
|
62
|
+
|
|
63
|
+
--------------------------------------------------------------------------------
|
|
64
|
+
NOTE: RELATIONSHIP TO TREND_INTERPRETATION
|
|
65
|
+
--------------------------------------------------------------------------------
|
|
66
|
+
# indicators.trend_interpretation is a categorical version of this same value
|
|
67
|
+
# derived from the same computation with the same thresholds:
|
|
68
|
+
# trend_strength >= 60 → STRONG
|
|
69
|
+
# trend_strength >= 40 → MODERATE
|
|
70
|
+
# trend_strength >= 20 → WEAK
|
|
71
|
+
# trend_strength < 20 → RANGING_CHOPPY
|
|
72
|
+
# Use trend_strength for numeric comparisons; trend_interpretation for categorical logic.
|
|
73
|
+
|
|
74
|
+
--------------------------------------------------------------------------------
|
|
75
|
+
INDICATOR RELATIONSHIPS
|
|
76
|
+
--------------------------------------------------------------------------------
|
|
77
|
+
indicators.trend_interpretation | SAME DATA
|
|
78
|
+
trend_interpretation is a categorical label derived from this value.
|
|
79
|
+
They always agree. Use trend_strength for thresholds; trend_interpretation
|
|
80
|
+
for state-based branching (see trend_interpretation.txt).
|
|
81
|
+
|
|
82
|
+
indicators.hmi | CONTEXT
|
|
83
|
+
hmi provides directional sign; trend_strength provides magnitude quality.
|
|
84
|
+
|
|
85
|
+
IF hmi >= 60 AND trend_strength >= 60
|
|
86
|
+
→ High magnitude AND high strength. Both indicators confirm a strong
|
|
87
|
+
directional move is underway. Highest quality trending signal.
|
|
88
|
+
|
|
89
|
+
IF hmi >= 40 AND trend_strength < 20
|
|
90
|
+
→ HMI shows momentum but trend_strength shows equal countertrend noise.
|
|
91
|
+
The hmi reading may be driven by a few dominant TFs while the rest
|
|
92
|
+
are not confirming. Lower confidence.
|
|
93
|
+
|
|
94
|
+
indicators.directional_efficiency | COMPANION
|
|
95
|
+
directional_efficiency measures net/total ratio (cleanliness of price).
|
|
96
|
+
trend_strength measures directional imbalance (dominance of one direction).
|
|
97
|
+
These typically agree but can diverge during low-liquidity periods.
|
|
98
|
+
|
|
99
|
+
indicators.regime | CONTEXT
|
|
100
|
+
CHOP and RANGING regimes imply trend_strength < 20.
|
|
101
|
+
TREND and CASCADE regimes imply trend_strength >= 40-60.
|
|
102
|
+
Divergence between these should prompt recency check.
|
|
103
|
+
|
|
104
|
+
--------------------------------------------------------------------------------
|
|
105
|
+
DEPENDENCY ORDER
|
|
106
|
+
--------------------------------------------------------------------------------
|
|
107
|
+
1 Regime: CHOP/CONSOL/RANGING confirms near-zero trend_strength is expected.
|
|
108
|
+
2 Read value and range bucket.
|
|
109
|
+
3 Read hmi or regime to determine the direction in which trend_strength applies.
|
|
110
|
+
4 Strong directional condition: trend_strength >= 40 AND |hmi| >= 30.
|
|
111
|
+
|
|
112
|
+
--------------------------------------------------------------------------------
|
|
113
|
+
INVALIDATION CONDITIONS
|
|
114
|
+
--------------------------------------------------------------------------------
|
|
115
|
+
IF activity_ratio < 0.5
|
|
116
|
+
→ Volume is dead. TF changes are noise. trend_strength is unreliable.
|
|
117
|
+
|
|
118
|
+
IF value = 0 exactly
|
|
119
|
+
→ Either totalAbs = 0 (no movement at all) or perfect balance.
|
|
120
|
+
Check activity_ratio to distinguish.
|
|
121
|
+
|
|
122
|
+
--------------------------------------------------------------------------------
|
|
123
|
+
ANTI-PATTERNS — DETECTABLE MISUSE CONDITIONS
|
|
124
|
+
--------------------------------------------------------------------------------
|
|
125
|
+
IF trend_strength >= 60 is used as a direction signal
|
|
126
|
+
→ INCORRECT USE. trend_strength has no direction component. A value
|
|
127
|
+
of 80 means strong directional bias exists, but it is equally
|
|
128
|
+
compatible with strong upward or strong downward bias. Always
|
|
129
|
+
combine with hmi or regime to determine direction.
|
|
130
|
+
|
|
131
|
+
IF trend_strength < 20 is used to say "no trend, so mean-revert"
|
|
132
|
+
→ INCOMPLETE LOGIC. Low trend_strength means equal buy/sell pressure —
|
|
133
|
+
it does not predict where price will mean-revert to. Add vwap_zscore
|
|
134
|
+
and support/resistance to identify potential reversion targets.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
================================================================================
|
|
2
|
+
INDICATOR: VALUE_AREA_POSITION — VALUE AREA POSITION
|
|
3
|
+
================================================================================
|
|
4
|
+
id: value_area_position
|
|
5
|
+
data_field: indicators.value_area_position
|
|
6
|
+
type: CATEGORICAL
|
|
7
|
+
values: ABOVE VA | IN VA | BELOW VA
|
|
8
|
+
update_rate: per_tick
|
|
9
|
+
latency_profile: SLOW (computed from volume profile history)
|
|
10
|
+
|
|
11
|
+
--------------------------------------------------------------------------------
|
|
12
|
+
CONSTRUCT
|
|
13
|
+
--------------------------------------------------------------------------------
|
|
14
|
+
value_area_position classifies where the current price is relative to the
|
|
15
|
+
Value Area — the price range that contained 70% of all traded volume over
|
|
16
|
+
the observation window.
|
|
17
|
+
|
|
18
|
+
Value Area Computation (derived from the same volume profile as POC):
|
|
19
|
+
1. Start at POC bucket (highest volume).
|
|
20
|
+
2. Greedily expand upward or downward, adding one bucket at a time in the
|
|
21
|
+
direction that adds more volume, until cumulative volume >= 70% of total.
|
|
22
|
+
3. value_area_high = upper edge of the final Value Area.
|
|
23
|
+
4. value_area_low = lower edge of the final Value Area.
|
|
24
|
+
|
|
25
|
+
Classification:
|
|
26
|
+
ABOVE VA: currentPrice > value_area_high
|
|
27
|
+
IN VA: currentPrice >= value_area_low AND <= value_area_high
|
|
28
|
+
BELOW VA: currentPrice < value_area_low
|
|
29
|
+
|
|
30
|
+
Related data fields:
|
|
31
|
+
indicators.value_area_high (price level)
|
|
32
|
+
indicators.value_area_low (price level)
|
|
33
|
+
indicators.poc (highest-volume level within or determining the VA)
|
|
34
|
+
|
|
35
|
+
--------------------------------------------------------------------------------
|
|
36
|
+
STATE DEFINITIONS
|
|
37
|
+
--------------------------------------------------------------------------------
|
|
38
|
+
IN VA
|
|
39
|
+
Price is trading within the 70% volume zone. This zone represents where
|
|
40
|
+
the majority of participating market actors transacted. Price "in VA" is
|
|
41
|
+
in a high-liquidity, high-familiarity zone. Breakouts from VA often require
|
|
42
|
+
significant volume to sustain.
|
|
43
|
+
|
|
44
|
+
Within VA, the POC acts as a sub-anchor. Price typically gravitates toward
|
|
45
|
+
POC when in-range before committing to test one of the VA edges (VA_High
|
|
46
|
+
or VA_Low).
|
|
47
|
+
|
|
48
|
+
ABOVE VA
|
|
49
|
+
Price has moved above the zone where 70% of volume transacted. This is
|
|
50
|
+
"price discovery" territory relative to recent volume distribution.
|
|
51
|
+
Less support from historical buyers in this zone.
|
|
52
|
+
|
|
53
|
+
ABOVE VA as BEARISH CONTEXT (value-area mean-reversion):
|
|
54
|
+
If regime is not trending, ABOVE VA suggests price is extended beyond
|
|
55
|
+
typical range and may be subject to pull-back into the area.
|
|
56
|
+
|
|
57
|
+
ABOVE VA as BULLISH CONTEXT (breakout continuation):
|
|
58
|
+
In trending/breakout regimes with volume confirmation, ABOVE VA is
|
|
59
|
+
continuation — price is leaving the old range. New value area will form
|
|
60
|
+
at higher levels.
|
|
61
|
+
|
|
62
|
+
BELOW VA
|
|
63
|
+
Mirror of ABOVE VA. Price is below the 70% volume zone.
|
|
64
|
+
|
|
65
|
+
BELOW VA as BULLISH CONTEXT (mean-reversion):
|
|
66
|
+
Potential recovery toward VA from the low side in non-trending regimes.
|
|
67
|
+
|
|
68
|
+
BELOW VA as BEARISH CONTEXT (breakdown continuation):
|
|
69
|
+
In trending/breakdown regimes, BELOW VA confirms price has broken
|
|
70
|
+
below the old value area and is discovering new lower prices.
|
|
71
|
+
|
|
72
|
+
--------------------------------------------------------------------------------
|
|
73
|
+
REGIME CONTEXT
|
|
74
|
+
--------------------------------------------------------------------------------
|
|
75
|
+
# The same VA position has opposite implications depending on regime.
|
|
76
|
+
|
|
77
|
+
ABOVE VA + regime IN [CHOP, CONSOL, RANGING]
|
|
78
|
+
Price is extended above the value distribution in a non-trending state.
|
|
79
|
+
Mean-reversion toward IN VA is the historically prevalent outcome.
|
|
80
|
+
|
|
81
|
+
ABOVE VA + regime IN [CASCADE, PARABOLIC, BREAKOUT]
|
|
82
|
+
Price has left the prior value area in a trending state.
|
|
83
|
+
New VA is forming at higher levels; extension is continuation context.
|
|
84
|
+
|
|
85
|
+
ABOVE VA + regime = EXHAUST_UP
|
|
86
|
+
Extended above VA with decelerating momentum.
|
|
87
|
+
Highest compound mean-reversion risk in a post-breakout context.
|
|
88
|
+
|
|
89
|
+
--------------------------------------------------------------------------------
|
|
90
|
+
INDICATOR RELATIONSHIPS
|
|
91
|
+
--------------------------------------------------------------------------------
|
|
92
|
+
indicators.poc_distance | COMPANION
|
|
93
|
+
value_area_position gives the coarse zone (above/in/below VA).
|
|
94
|
+
poc_distance gives the precise distance from the highest-volume node.
|
|
95
|
+
Use both for complete volume-profile positioning.
|
|
96
|
+
|
|
97
|
+
indicators.poc | PREREQUISITE
|
|
98
|
+
poc is computed first; VA expands from poc. They always move together.
|
|
99
|
+
When VA is wide, poc_distance and value_area_position may disagree
|
|
100
|
+
slightly (price can be IN VA but far from poc if VA is large).
|
|
101
|
+
|
|
102
|
+
indicators.regime | REQUIRED CONTEXT
|
|
103
|
+
Do not use value_area_position for directional inference without regime.
|
|
104
|
+
The same state (ABOVE VA) is bullish in a breakout and bearish in a
|
|
105
|
+
choppy market. See regime gate above.
|
|
106
|
+
|
|
107
|
+
indicators.vwap_zscore | COMPOUND SIGNAL
|
|
108
|
+
IF value_area_position = ABOVE VA AND vwap_zscore > 2.0
|
|
109
|
+
→ Price above VWAP AND outside value area on the upside. Both
|
|
110
|
+
volume-anchored references agree on extension.
|
|
111
|
+
|
|
112
|
+
indicators.support / indicators.resistance | CONTEXT
|
|
113
|
+
value_area_high / value_area_low are implicit support/resistance levels.
|
|
114
|
+
When the explicit resistance indicator also shows a strong level near
|
|
115
|
+
value_area_high, that level has dual anchoring.
|
|
116
|
+
|
|
117
|
+
--------------------------------------------------------------------------------
|
|
118
|
+
DEPENDENCY ORDER
|
|
119
|
+
--------------------------------------------------------------------------------
|
|
120
|
+
1 Read regime — determines whether ABOVE/BELOW VA is extension or continuation context.
|
|
121
|
+
2 Read value_area_position.
|
|
122
|
+
3 If not IN VA: read poc_distance for exact deviation magnitude.
|
|
123
|
+
4 Read value_area_high / value_area_low as specific price levels.
|
|
124
|
+
5 Cross-reference with vwap_zscore.
|
|
125
|
+
|
|
126
|
+
--------------------------------------------------------------------------------
|
|
127
|
+
INVALIDATION CONDITIONS
|
|
128
|
+
--------------------------------------------------------------------------------
|
|
129
|
+
IF insufficient candle history: value area cannot be computed.
|
|
130
|
+
|
|
131
|
+
IF totalVol == 0 (no volume data): computation fails. Do not use.
|
|
132
|
+
|
|
133
|
+
--------------------------------------------------------------------------------
|
|
134
|
+
ANTI-PATTERNS — DETECTABLE MISUSE CONDITIONS
|
|
135
|
+
--------------------------------------------------------------------------------
|
|
136
|
+
IF ABOVE VA is treated as a short signal without regime check
|
|
137
|
+
→ INCORRECT. See regime interpretation section above. Context determines
|
|
138
|
+
whether ABOVE VA is bearish extension or bullish breakout confirmation.
|
|
139
|
+
|
|
140
|
+
IF value_area_position is used without referencing the price levels
|
|
141
|
+
→ INCOMPLETE. "ABOVE VA" without knowing where value_area_high is
|
|
142
|
+
numerically prevents referencing it as a level. Read the price levels too.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
================================================================================
|
|
2
|
+
INDICATOR: VOLATILITY_CLUSTERING — VOLUME CLUSTERING MULTIPLIER
|
|
3
|
+
================================================================================
|
|
4
|
+
id: volatility_clustering
|
|
5
|
+
data_field: indicators.volatility_clustering
|
|
6
|
+
type: NUMERIC (+ embedded sub-field)
|
|
7
|
+
range: [0.7, 1.5]
|
|
8
|
+
!! NOT [0, 1] — this is a common documentation error !!
|
|
9
|
+
precision: 3 decimal places
|
|
10
|
+
update_rate: per_tick
|
|
11
|
+
latency_profile: LAGGING (computed from 6 timeframe volume z-scores)
|
|
12
|
+
|
|
13
|
+
EMBEDDED FIELD:
|
|
14
|
+
indicators.volatility_clustering.change_point_probability
|
|
15
|
+
type: NUMERIC
|
|
16
|
+
range: [0, 1]
|
|
17
|
+
See: volume_change_point.txt for detailed documentation of this sub-field.
|
|
18
|
+
|
|
19
|
+
--------------------------------------------------------------------------------
|
|
20
|
+
CONSTRUCT
|
|
21
|
+
--------------------------------------------------------------------------------
|
|
22
|
+
volatility_clustering measures whether current volume activity is above or below
|
|
23
|
+
the historical norm across multiple timeframes, expressed as a confidence
|
|
24
|
+
multiplier. A value above 1.0 means above-normal volume clustering; below 1.0
|
|
25
|
+
means below-normal.
|
|
26
|
+
|
|
27
|
+
Computation:
|
|
28
|
+
For each of 6 timeframes: [5m, 15m, 30m, 1h, 4h, 12h]
|
|
29
|
+
- Compute z-score of log(volume) vs 3× timeframe lookback baseline:
|
|
30
|
+
z[tf] = (log(currentVol_tf) - mean(logVols_tf)) / std(logVols_tf)
|
|
31
|
+
- Compute per-TF multiplier:
|
|
32
|
+
multiplier_tf = clamp(1.0 + z[tf] × 0.15, 0.7, 1.5)
|
|
33
|
+
|
|
34
|
+
Weighted combination across 6 TFs (higher TFs weighted more for stability).
|
|
35
|
+
|
|
36
|
+
Final value = weighted average of multiplier_tf values.
|
|
37
|
+
|
|
38
|
+
Scale:
|
|
39
|
+
1.0 = neutral (volume at exactly historical norm)
|
|
40
|
+
< 1.0 = below-normal volume clustering (minimum: 0.7)
|
|
41
|
+
> 1.0 = above-normal volume clustering (maximum: 1.5)
|
|
42
|
+
|
|
43
|
+
--------------------------------------------------------------------------------
|
|
44
|
+
RANGE INTERPRETATION
|
|
45
|
+
--------------------------------------------------------------------------------
|
|
46
|
+
value >= 1.3
|
|
47
|
+
Significantly above-normal volume clustering. Volume across multiple TFs
|
|
48
|
+
is substantially higher than the historical baseline. Associated with
|
|
49
|
+
high-participation conditions: breakouts, major news reactions, capitulation.
|
|
50
|
+
This is when price moves are most likely to sustain.
|
|
51
|
+
|
|
52
|
+
value >= 1.1 AND value < 1.3
|
|
53
|
+
Moderately elevated volume. Above historical norm with some confidence.
|
|
54
|
+
Activity is picking up across TFs. Directional signals are more reliable
|
|
55
|
+
in this condition.
|
|
56
|
+
|
|
57
|
+
value >= 0.9 AND value < 1.1
|
|
58
|
+
Near-normal volume activity. Close to baseline. Volume is neither
|
|
59
|
+
confirming nor calling into question directional signals.
|
|
60
|
+
|
|
61
|
+
value >= 0.7 AND value < 0.9
|
|
62
|
+
Below-normal volume clustering. Activity is quieter than the historical
|
|
63
|
+
baseline. Directional signals from momentum indicators have reduced
|
|
64
|
+
reliability. Spreads may be wider; price moves less committed.
|
|
65
|
+
|
|
66
|
+
value = 0.7 (at minimum clamp)
|
|
67
|
+
Volume is at maximum below-normal (floored). Very quiet market across
|
|
68
|
+
multiple timeframes. Functionally equivalent to activity_ratio being DEAD.
|
|
69
|
+
Most indicators should be treated with skepticism here.
|
|
70
|
+
|
|
71
|
+
IMPORTANT CORRECTION vs HUMAN DOCS:
|
|
72
|
+
The human-readable documentation incorrectly stated this range as [0, 1].
|
|
73
|
+
The actual computation clamps per-TF multipliers to [0.7, 1.5] and takes
|
|
74
|
+
a weighted average, so the output is also strictly within [0.7, 1.5].
|
|
75
|
+
A value of 0.0 or 0.5 is NOT possible from this indicator.
|
|
76
|
+
|
|
77
|
+
--------------------------------------------------------------------------------
|
|
78
|
+
ROLE AS THRESHOLD MODULATOR
|
|
79
|
+
--------------------------------------------------------------------------------
|
|
80
|
+
# volatility_clustering acts as a confidence multiplier for several indicators.
|
|
81
|
+
# Its most important direct use is in vwap_zscore threshold adjustment.
|
|
82
|
+
|
|
83
|
+
vwap_zscore bands are internally scaled by volcMultiplier:
|
|
84
|
+
In high-clustering periods (value = 1.4): z-score bands widen.
|
|
85
|
+
In low-clustering periods (value = 0.75): z-score bands compress.
|
|
86
|
+
This means FAR_ABOVE requires a LARGER z-score to qualify when
|
|
87
|
+
volume clustering is high.
|
|
88
|
+
|
|
89
|
+
General confidence relationship:
|
|
90
|
+
volatility_clustering < 0.85 → below-normal participation; all signals noisier.
|
|
91
|
+
volatility_clustering > 1.20 → above-normal participation; signals more reliable.
|
|
92
|
+
|
|
93
|
+
--------------------------------------------------------------------------------
|
|
94
|
+
INDICATOR RELATIONSHIPS
|
|
95
|
+
--------------------------------------------------------------------------------
|
|
96
|
+
indicators.activity_ratio | COMPANION
|
|
97
|
+
Both measure volume activity relative to baseline, but via different methods.
|
|
98
|
+
activity_ratio: 5-candle recent vs 1-day time-of-day normalized baseline.
|
|
99
|
+
volatility_clustering: log z-score across 6 TFs vs 3× TF lookback.
|
|
100
|
+
|
|
101
|
+
They may diverge:
|
|
102
|
+
IF activity_ratio = ACTIVE AND volatility_clustering < 0.9
|
|
103
|
+
→ Current 5-candle window is active but the multi-TF clustering is below
|
|
104
|
+
norm. A short-term volume spike, not a sustained participation increase.
|
|
105
|
+
IF activity_ratio = DEAD AND volatility_clustering >= 1.1
|
|
106
|
+
→ Current 5-candle activity is very quiet but multi-TF history shows
|
|
107
|
+
above-normal volume in longer frames. Quieting after a busy period.
|
|
108
|
+
|
|
109
|
+
indicators.vwap_zscore | MODULATES
|
|
110
|
+
volatility_clustering directly adjusts vwap_zscore thresholds internally.
|
|
111
|
+
See vwap_zscore.txt INDICATOR RELATIONSHIPS section.
|
|
112
|
+
|
|
113
|
+
indicators.regime | GATE
|
|
114
|
+
REVERSAL and ROLLOVER regimes require volatility_clustering >= 1.05.
|
|
115
|
+
This means these regimes CANNOT be active with low clustering.
|
|
116
|
+
IF regime = REVERSAL AND volatility_clustering < 1.05:
|
|
117
|
+
→ Either regime data or clustering data is stale. Check timestamps.
|
|
118
|
+
|
|
119
|
+
indicators.squeeze indicators | CONTEXT
|
|
120
|
+
IF volatility_clustering < 0.85 during a squeeze (squeeze_energy > 5)
|
|
121
|
+
→ The squeeze is building in a low-participation environment.
|
|
122
|
+
The release will be triggered when volume returns. Monitor for
|
|
123
|
+
volume_change_point probability rising.
|
|
124
|
+
|
|
125
|
+
indicators.volatility_clustering.change_point_probability | EMBEDDED
|
|
126
|
+
This sub-field detects volume REGIME SHIFTS. See volume_change_point.txt.
|
|
127
|
+
It is computed jointly with the main clustering value but is a different
|
|
128
|
+
type of analysis (Bayesian changepoint detection, not z-score).
|
|
129
|
+
|
|
130
|
+
--------------------------------------------------------------------------------
|
|
131
|
+
DEPENDENCY ORDER
|
|
132
|
+
--------------------------------------------------------------------------------
|
|
133
|
+
1 Read value (range [0.7, 1.5]); confirm range is not compared against 0-1 scale.
|
|
134
|
+
2 Determine volume regime: low (<0.9), normal (0.9-1.1), high (>1.1).
|
|
135
|
+
3 Note impact on other indicator reliability (see role section above).
|
|
136
|
+
4 Check change_point_probability sub-field for volume regime shifts.
|
|
137
|
+
5 Compare to activity_ratio for short vs long TF volume agreement.
|
|
138
|
+
|
|
139
|
+
--------------------------------------------------------------------------------
|
|
140
|
+
INVALIDATION CONDITIONS
|
|
141
|
+
--------------------------------------------------------------------------------
|
|
142
|
+
IF underlying TF volume data has gaps: volume z-scores will be skewed.
|
|
143
|
+
No explicit invalidation mechanism in the computation; check data source
|
|
144
|
+
freshness for any TF with anomalously zero volume.
|
|
145
|
+
|
|
146
|
+
--------------------------------------------------------------------------------
|
|
147
|
+
ANTI-PATTERNS — DETECTABLE MISUSE CONDITIONS
|
|
148
|
+
--------------------------------------------------------------------------------
|
|
149
|
+
IF value is compared against 0-1 range thresholds
|
|
150
|
+
→ RANGE ERROR. This indicator's range is [0.7, 1.5]. A value of 0.8
|
|
151
|
+
does NOT mean "80% of normal" in a 0-100 scale sense. It means
|
|
152
|
+
the weighted TF multiplier is at 0.8 (about 14% below the clamp floor
|
|
153
|
+
of 0.7, but only about 10% below neutral of 1.0). All threshold
|
|
154
|
+
comparisons must treat 1.0 as neutral.
|
|
155
|
+
|
|
156
|
+
IF volatility_clustering is confused with volatility itself
|
|
157
|
+
→ DIFFERENT CONSTRUCT. volatility_clustering measures RELATIVE VOLUME
|
|
158
|
+
activity (via log z-scores), not price volatility. High clustering
|
|
159
|
+
means more volume than usual, not more price movement. Volatility_squeeze
|
|
160
|
+
is the price volatility indicator.
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
================================================================================
|
|
2
|
+
INDICATOR: VOLATILITY_SQUEEZE — GARCH VOLATILITY RATIO (SQUEEZE)
|
|
3
|
+
================================================================================
|
|
4
|
+
id: volatility_squeeze
|
|
5
|
+
data_field: indicators.volatility_squeeze
|
|
6
|
+
type: NUMERIC
|
|
7
|
+
range: [0, ∞) — practically [0.1, 1.5] in most conditions
|
|
8
|
+
precision: 3 decimal places
|
|
9
|
+
update_rate: per_tick
|
|
10
|
+
latency_profile: COINCIDENT
|
|
11
|
+
|
|
12
|
+
--------------------------------------------------------------------------------
|
|
13
|
+
CONSTRUCT
|
|
14
|
+
--------------------------------------------------------------------------------
|
|
15
|
+
volatility_squeeze measures the ratio of short-window to long-window GARCH
|
|
16
|
+
conditional volatility. It detects when volatility has compressed below historical
|
|
17
|
+
norms (a "squeeze") — indicating stored directional energy.
|
|
18
|
+
|
|
19
|
+
GARCH(1,1) model:
|
|
20
|
+
omega = 0.00001
|
|
21
|
+
alpha = 0.10 (weight on recent squared return)
|
|
22
|
+
beta = 0.88 (weight on prior conditional variance)
|
|
23
|
+
h[t] = omega + alpha × r[t-1]² + beta × h[t-1]
|
|
24
|
+
where r[t] = log return at time t
|
|
25
|
+
|
|
26
|
+
Two GARCH variance series computed:
|
|
27
|
+
short_window = 14 ticks → h_short (14-period GARCH conditional variance)
|
|
28
|
+
long_window = 50 ticks → h_long (50-period GARCH conditional variance)
|
|
29
|
+
|
|
30
|
+
Ratio:
|
|
31
|
+
value = sqrt(h_short / h_long)
|
|
32
|
+
|
|
33
|
+
This ratio compares current short-term GARCH volatility to the recent long-term
|
|
34
|
+
GARCH baseline. A value of 1.0 means current volatility is at its long-run norm.
|
|
35
|
+
|
|
36
|
+
CRITICAL: LOWER VALUES MEAN MORE COMPRESSION (MORE ENERGY STORED)
|
|
37
|
+
value < 0.8 → SHORT_TERM VOLATILITY IS COMPRESSED BELOW BASELINE
|
|
38
|
+
value >= 0.8 → NORMAL OR EXPANDING VOLATILITY
|
|
39
|
+
|
|
40
|
+
--------------------------------------------------------------------------------
|
|
41
|
+
RANGE INTERPRETATION — SQUEEZE STATES (BELOW 0.8)
|
|
42
|
+
--------------------------------------------------------------------------------
|
|
43
|
+
IMPORTANT: These are SQUEEZE conditions. The LOWER the value, the more
|
|
44
|
+
compressed the volatility. This is counterintuitive: a "lower squeeze value"
|
|
45
|
+
means MORE stored energy, not less.
|
|
46
|
+
|
|
47
|
+
value < 0.3 [EXTREME SQUEEZE]
|
|
48
|
+
Short-term GARCH volatility is less than 30% of the long-term norm.
|
|
49
|
+
Maximum compression. Historical breakouts after extreme squeeze are
|
|
50
|
+
often the most violent, as stored directional energy releases suddenly.
|
|
51
|
+
squeeze_duration and squeeze_energy will be at high values here.
|
|
52
|
+
|
|
53
|
+
value >= 0.3 AND value < 0.4 [ACTIVE SQUEEZE]
|
|
54
|
+
Short-term volatility is severely compressed. Still very significant
|
|
55
|
+
energy buildup. Price is in a tight consolidation with little realized
|
|
56
|
+
volatility. The market is coiling before a move.
|
|
57
|
+
|
|
58
|
+
value >= 0.4 AND value < 0.6 [MILD-ACTIVE SQUEEZE]
|
|
59
|
+
Meaningful compression. Volatility is building toward normal levels.
|
|
60
|
+
Not extreme but notable — this level typically precedes larger moves.
|
|
61
|
+
|
|
62
|
+
value >= 0.6 AND value < 0.8 [MILD SQUEEZE]
|
|
63
|
+
Light compression. Volume and volatility are slightly below the baseline.
|
|
64
|
+
Pre-squeeze signal or normal pullback in oscillation.
|
|
65
|
+
|
|
66
|
+
value >= 0.8 [EXPANSION / NO SQUEEZE]
|
|
67
|
+
Short-term volatility at or above its long-term GARCH norm. This is the
|
|
68
|
+
normal or expanding state. Price is realizing its typical or above-typical
|
|
69
|
+
movement. No stored energy condition.
|
|
70
|
+
|
|
71
|
+
value >> 1.0 (significantly above 1.0)
|
|
72
|
+
Current volatility is substantially above the long-run GARCH baseline.
|
|
73
|
+
Post-squeeze expansion or a volatility shock event.
|
|
74
|
+
|
|
75
|
+
--------------------------------------------------------------------------------
|
|
76
|
+
TRAJECTORY MATTERS
|
|
77
|
+
--------------------------------------------------------------------------------
|
|
78
|
+
# The direction of squeeze_value change is as important as the absolute level.
|
|
79
|
+
|
|
80
|
+
value moving from 0.8 → 0.5 → 0.3 (declining over multiple ticks)
|
|
81
|
+
Active compression building. Energy is accumulating. The lower it gets
|
|
82
|
+
and the longer it stays low, the more likely the breakout is material.
|
|
83
|
+
Monitor squeeze_duration and squeeze_energy for quantified buildup.
|
|
84
|
+
|
|
85
|
+
value moving from 0.3 → 0.6 → 0.9 (rising after a squeeze)
|
|
86
|
+
Squeeze is RELEASING. Energy is being converted to realized movement.
|
|
87
|
+
This is the expected transition AFTER the breakout move initiates.
|
|
88
|
+
By the time value is above 0.8, the acute breakout phase has begun.
|
|
89
|
+
|
|
90
|
+
value hovering near 0.5 for many ticks
|
|
91
|
+
Prolonged squeeze. Market is in sustained compression. Combined with
|
|
92
|
+
low squeeze_energy increase, this may indicate an information void
|
|
93
|
+
period. High-conviction break likely when catalyst arrives.
|
|
94
|
+
|
|
95
|
+
--------------------------------------------------------------------------------
|
|
96
|
+
INDICATOR RELATIONSHIPS
|
|
97
|
+
--------------------------------------------------------------------------------
|
|
98
|
+
indicators.squeeze_duration | REQUIRED_COMPANION
|
|
99
|
+
squeeze_duration counts consecutive ticks where value < 0.8.
|
|
100
|
+
Low squeeze_value + high squeeze_duration = sustained compression.
|
|
101
|
+
The combination is more meaningful than either alone.
|
|
102
|
+
|
|
103
|
+
indicators.squeeze_energy | REQUIRED_COMPANION
|
|
104
|
+
squeeze_energy = squeeze_duration × (0.8 - value) = compressionDepth × time.
|
|
105
|
+
This is the integrated measure of compression buildup.
|
|
106
|
+
High squeeze_energy = the most significant potential release.
|
|
107
|
+
|
|
108
|
+
indicators.regime | CONTEXT
|
|
109
|
+
IF regime = CONSOL AND volatility_squeeze < 0.5
|
|
110
|
+
→ Regime confirms consolidation AND volatility confirms compression.
|
|
111
|
+
Dual confirmation of coiling condition.
|
|
112
|
+
IF volatility_squeeze transitions above 0.8 AND regime shifts to BREAKOUT
|
|
113
|
+
→ The squeeze is releasing AND regime has confirmed direction.
|
|
114
|
+
Highest confidence breakout signal.
|
|
115
|
+
|
|
116
|
+
indicators.market_structure | CONTEXT
|
|
117
|
+
market_structure = CONSOL or BREAKING_UP after a squeeze period confirms
|
|
118
|
+
the structural context of both compression and release.
|
|
119
|
+
|
|
120
|
+
indicators.activity_ratio | CONTEXT
|
|
121
|
+
IF activity_ratio < 0.5 AND volatility_squeeze < 0.5
|
|
122
|
+
→ Compression in both volume AND GARCH volatility. Not just a quiet
|
|
123
|
+
period — both volume and price movement are compressed simultaneously.
|
|
124
|
+
|
|
125
|
+
indicators.hmi | CONTEXT
|
|
126
|
+
After a squeeze release, the direction of the hmi move (positive or negative)
|
|
127
|
+
provides the directional interpretation of the energy release.
|
|
128
|
+
volatility_squeeze confirms compression existed; hmi tells you which way
|
|
129
|
+
the energy released.
|
|
130
|
+
|
|
131
|
+
--------------------------------------------------------------------------------
|
|
132
|
+
DEPENDENCY ORDER
|
|
133
|
+
--------------------------------------------------------------------------------
|
|
134
|
+
1 Read value; classify SQUEEZE (< 0.8) vs EXPANSION (>= 0.8).
|
|
135
|
+
2 In squeeze: classify depth (EXTREME < 0.3, ACTIVE < 0.4, MILD < 0.6).
|
|
136
|
+
3 Read squeeze_duration and squeeze_energy for magnitude of buildup.
|
|
137
|
+
4 Regime for compression/breakout confirmation.
|
|
138
|
+
5 Post-release: read hmi for direction of energy release.
|
|
139
|
+
|
|
140
|
+
--------------------------------------------------------------------------------
|
|
141
|
+
INVALIDATION CONDITIONS
|
|
142
|
+
--------------------------------------------------------------------------------
|
|
143
|
+
IF fewer than 50 ticks of return history
|
|
144
|
+
→ Long GARCH window (50) has not converged. Value is unreliable.
|
|
145
|
+
Treat first 50-60 ticks after start/reset as warm-up.
|
|
146
|
+
|
|
147
|
+
IF a sudden extreme price move occurs (> 5% in 1 tick)
|
|
148
|
+
→ GARCH may spike sharply. One outlier return inflates h_short significantly.
|
|
149
|
+
Value may jump to >> 1.0 transiently. Wait for GARCH to stabilize.
|
|
150
|
+
|
|
151
|
+
--------------------------------------------------------------------------------
|
|
152
|
+
ANTI-PATTERNS — DETECTABLE MISUSE CONDITIONS
|
|
153
|
+
--------------------------------------------------------------------------------
|
|
154
|
+
IF value < 0.3 is treated as a trade signal on its own
|
|
155
|
+
→ INCORRECT. Extreme squeeze tells you compression exists but says
|
|
156
|
+
NOTHING about direction. Directional confirmation (hmi, regime shift,
|
|
157
|
+
market_structure breakout) is required before acting.
|
|
158
|
+
|
|
159
|
+
IF value > 0.8 is treated as "safe to trade"
|
|
160
|
+
→ INCORRECT INTERPRETATION. Value > 0.8 means volatility is expanding.
|
|
161
|
+
This is the RELEASE phase of a squeeze — often the most volatile
|
|
162
|
+
and fastest-moving period. This is when positions face highest
|
|
163
|
+
whipsaw risk, not least.
|
|
164
|
+
|
|
165
|
+
IF the relationship between value and compression is treated as "higher = more squeeze"
|
|
166
|
+
→ INVERTING THE SCALE. Lower value = more compressed. value = 0.2
|
|
167
|
+
is maximum squeeze, NOT a minimum. This is a common error with
|
|
168
|
+
ratio-based indicators. Remember: value compares short GARCH to
|
|
169
|
+
long GARCH — below 1.0 means short is below long.
|