hedgequantx 2.9.77 → 2.9.78

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "2.9.77",
3
+ "version": "2.9.78",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -2,32 +2,35 @@
2
2
  * =============================================================================
3
3
  * Smart Logs Messages - HF Grade Message Pools
4
4
  * =============================================================================
5
- * Large pools of professional, institutional-grade messages
6
- * Separated from logic for modularity (RULES.md: max 500 lines per file)
5
+ * Max message length: 76 chars (fits in 96-char UI width)
6
+ *
7
+ * Color placeholders:
8
+ * {bull:text} {bear:text} {zone:text} {action:text}
9
+ * {risk:text} {profit:text} {flow:text} {inst:text}
7
10
  */
8
11
 
9
12
  'use strict';
10
13
 
11
14
  // =============================================================================
12
- // MESSAGE POOLS - Market Flow (Bullish)
15
+ // MESSAGE POOLS - Market Flow (Bullish) - Max 50 chars + details
13
16
  // =============================================================================
14
17
 
15
18
  const LONG_BIAS_MESSAGES = [
16
- 'Buyers taking control of the tape with aggressive lifting',
17
- 'Bid side absorbing sell pressure at current levels',
18
- 'Bullish order flow detected on liquidity sweep',
19
- 'Buy programs actively lifting offers through resistance',
20
- 'Strong buyer presence accumulating at bid levels',
21
- 'Accumulation pattern forming with increasing volume',
22
- 'Demand exceeding supply - bid stack strengthening',
23
- 'Buyers stepping up with institutional size orders',
24
- 'Long-side momentum building with positive delta',
25
- 'Bid accumulation detected at key support structure',
26
- 'Bullish delta divergence confirmed on tape reading',
27
- 'Buy-side imbalance driving price action higher',
28
- 'Institutional buying flow detected on time and sales',
29
- 'Aggressive bid lifting through stacked offers',
30
- 'Bullish microstructure with strong delta confirmation',
19
+ '{bull:Buyers} taking control with aggressive {bull:lifting}',
20
+ '{bull:Bid} side absorbing sell pressure',
21
+ '{bull:Bullish} flow on {action:liquidity sweep}',
22
+ '{bull:Buy} programs {bull:lifting} through {zone:resistance}',
23
+ 'Strong {bull:buyer} presence at {bull:bid} levels',
24
+ '{flow:Accumulation} with increasing {flow:volume}',
25
+ '{flow:Demand} exceeding supply - {bull:bid} strengthening',
26
+ '{bull:Buyers} stepping up with {inst:institutional} size',
27
+ '{bull:Long}-side {flow:momentum} with positive {flow:delta}',
28
+ '{bull:Bid} accumulation at key {zone:support}',
29
+ '{bull:Bullish} {flow:delta} divergence confirmed',
30
+ '{bull:Buy}-side imbalance driving price higher',
31
+ '{inst:Institutional} {bull:buying} on tape',
32
+ 'Aggressive {bull:bid} through stacked offers',
33
+ '{bull:Bullish} microstructure with strong {flow:delta}',
31
34
  ];
32
35
 
33
36
  // =============================================================================
@@ -35,21 +38,21 @@ const LONG_BIAS_MESSAGES = [
35
38
  // =============================================================================
36
39
 
37
40
  const SHORT_BIAS_MESSAGES = [
38
- 'Sellers taking control of the tape with aggressive hitting',
39
- 'Offer side absorbing buy pressure at current levels',
40
- 'Bearish order flow detected on liquidity sweep',
41
- 'Sell programs actively hitting bids through support',
42
- 'Strong seller presence distributing at offer levels',
43
- 'Distribution pattern forming with increasing volume',
44
- 'Supply exceeding demand - offer stack strengthening',
45
- 'Sellers stepping in with institutional size orders',
46
- 'Short-side momentum building with negative delta',
47
- 'Offer distribution detected at key resistance structure',
48
- 'Bearish delta divergence confirmed on tape reading',
49
- 'Sell-side imbalance driving price action lower',
50
- 'Institutional selling flow detected on time and sales',
51
- 'Aggressive offer hitting through stacked bids',
52
- 'Bearish microstructure with weak delta confirmation',
41
+ '{bear:Sellers} taking control with aggressive {bear:hitting}',
42
+ '{bear:Offer} side absorbing buy pressure',
43
+ '{bear:Bearish} flow on {action:liquidity sweep}',
44
+ '{bear:Sell} programs {bear:hitting} through {zone:support}',
45
+ 'Strong {bear:seller} presence at {bear:offer} levels',
46
+ '{flow:Distribution} with increasing {flow:volume}',
47
+ '{flow:Supply} exceeding demand - {bear:offer} strengthening',
48
+ '{bear:Sellers} stepping in with {inst:institutional} size',
49
+ '{bear:Short}-side {flow:momentum} with negative {flow:delta}',
50
+ '{bear:Offer} distribution at key {zone:resistance}',
51
+ '{bear:Bearish} {flow:delta} divergence confirmed',
52
+ '{bear:Sell}-side imbalance driving price lower',
53
+ '{inst:Institutional} {bear:selling} on tape',
54
+ 'Aggressive {bear:offer} through stacked bids',
55
+ '{bear:Bearish} microstructure with weak {flow:delta}',
53
56
  ];
54
57
 
55
58
  // =============================================================================
@@ -57,21 +60,21 @@ const SHORT_BIAS_MESSAGES = [
57
60
  // =============================================================================
58
61
 
59
62
  const FLAT_BIAS_MESSAGES = [
60
- 'Market balanced with two-way institutional flow',
61
- 'Two-way flow active - no clear directional bias',
62
- 'Consolidation mode with balanced order book',
63
- 'No clear direction - awaiting catalyst for breakout',
64
- 'Mixed signals detected across multiple timeframes',
65
- 'Range-bound activity with absorption on both sides',
66
- 'Equilibrium state - buyers and sellers balanced',
67
- 'Neutral order flow with symmetric book depth',
68
- 'Balanced book pressure at current price levels',
69
- 'Rotation in progress between support and resistance',
70
- 'Price discovery phase with low conviction moves',
71
- 'Awaiting catalyst - volume declining in range',
72
- 'Sideways chop detected with mean reversion behavior',
73
- 'Mean reversion zone - fading extremes profitable',
74
- 'Liquidity absorption on both bid and offer sides',
63
+ 'Market balanced - two-way {inst:institutional} flow',
64
+ 'Two-way flow - no clear directional bias',
65
+ 'Consolidation with balanced order book',
66
+ 'No direction - awaiting {action:breakout} catalyst',
67
+ 'Mixed signals across timeframes',
68
+ 'Range-bound with absorption both sides',
69
+ 'Equilibrium - {bull:buyers}/{bear:sellers} balanced',
70
+ 'Neutral flow with symmetric book depth',
71
+ 'Balanced book at current price levels',
72
+ 'Rotation between {zone:support}/{zone:resistance}',
73
+ 'Price discovery with low conviction',
74
+ 'Awaiting catalyst - {flow:volume} declining',
75
+ 'Sideways chop - mean reversion behavior',
76
+ 'Mean reversion {zone:zone} active',
77
+ 'Liquidity absorption {bull:bid}/{bear:offer} sides',
75
78
  ];
76
79
 
77
80
  // =============================================================================
@@ -79,29 +82,29 @@ const FLAT_BIAS_MESSAGES = [
79
82
  // =============================================================================
80
83
 
81
84
  const SIGNAL_LONG_MESSAGES = [
82
- 'Buy signal generated with high confidence score',
83
- 'Long opportunity detected at key support level',
84
- 'Bullish setup confirmed with volume confirmation',
85
- 'Entry signal: LONG with optimal risk-reward ratio',
86
- 'Buy zone activated after liquidity sweep completion',
87
- 'Long trigger fired on support zone rejection',
88
- 'Bullish confirmation received from multiple factors',
89
- 'Buy entry validated with strong momentum backing',
90
- 'Long setup materialized with clean price action',
91
- 'Bullish pattern complete - entry conditions met',
85
+ '{bull:Buy} signal - high confidence',
86
+ '{bull:Long} opportunity at key {zone:support}',
87
+ '{bull:Bullish} setup with {flow:volume} confirmation',
88
+ 'Entry: {bull:LONG} optimal risk-reward',
89
+ '{bull:Buy} {zone:zone} after {action:sweep} complete',
90
+ '{bull:Long} trigger on {zone:support} {action:rejection}',
91
+ '{bull:Bullish} confirmation from multiple factors',
92
+ '{bull:Buy} validated with {flow:momentum}',
93
+ '{bull:Long} setup materialized',
94
+ '{bull:Bullish} pattern complete - entry met',
92
95
  ];
93
96
 
94
97
  const SIGNAL_SHORT_MESSAGES = [
95
- 'Sell signal generated with high confidence score',
96
- 'Short opportunity detected at key resistance level',
97
- 'Bearish setup confirmed with volume confirmation',
98
- 'Entry signal: SHORT with optimal risk-reward ratio',
99
- 'Sell zone activated after liquidity sweep completion',
100
- 'Short trigger fired on resistance zone rejection',
101
- 'Bearish confirmation received from multiple factors',
102
- 'Sell entry validated with strong momentum backing',
103
- 'Short setup materialized with clean price action',
104
- 'Bearish pattern complete - entry conditions met',
98
+ '{bear:Sell} signal - high confidence',
99
+ '{bear:Short} opportunity at key {zone:resistance}',
100
+ '{bear:Bearish} setup with {flow:volume} confirmation',
101
+ 'Entry: {bear:SHORT} optimal risk-reward',
102
+ '{bear:Sell} {zone:zone} after {action:sweep} complete',
103
+ '{bear:Short} trigger on {zone:resistance} {action:rejection}',
104
+ '{bear:Bearish} confirmation from multiple factors',
105
+ '{bear:Sell} validated with {flow:momentum}',
106
+ '{bear:Short} setup materialized',
107
+ '{bear:Bearish} pattern complete - entry met',
105
108
  ];
106
109
 
107
110
  // =============================================================================
@@ -109,55 +112,55 @@ const SIGNAL_SHORT_MESSAGES = [
109
112
  // =============================================================================
110
113
 
111
114
  const ENTRY_LONG_MESSAGES = [
112
- 'Long position opened at optimal entry price',
113
- 'Buy order filled with minimal slippage execution',
114
- 'Entered long with bracket orders attached',
115
- 'Long initiated at support zone rejection level',
116
- 'Position: LONG with defined risk parameters',
117
- 'Long execution complete with stop and target set',
118
- 'Buy fill confirmed at expected price level',
119
- 'Long entry executed with tight spread capture',
120
- 'Bought at market with immediate fill confirmation',
121
- 'Long position established with risk management active',
115
+ '{bull:Long} opened at optimal entry',
116
+ '{bull:Buy} filled - minimal slippage',
117
+ 'Entered {bull:long} with brackets',
118
+ '{bull:Long} at {zone:support} {action:rejection}',
119
+ 'Position: {bull:LONG} - {risk:risk} defined',
120
+ '{bull:Long} complete - {risk:SL}/{profit:TP} set',
121
+ '{bull:Buy} confirmed at expected price',
122
+ '{bull:Long} executed - tight spread',
123
+ '{bull:Bought} at market - filled',
124
+ '{bull:Long} established - {risk:risk} active',
122
125
  ];
123
126
 
124
127
  const ENTRY_SHORT_MESSAGES = [
125
- 'Short position opened at optimal entry price',
126
- 'Sell order filled with minimal slippage execution',
127
- 'Entered short with bracket orders attached',
128
- 'Short initiated at resistance zone rejection level',
129
- 'Position: SHORT with defined risk parameters',
130
- 'Short execution complete with stop and target set',
131
- 'Sell fill confirmed at expected price level',
132
- 'Short entry executed with tight spread capture',
133
- 'Sold at market with immediate fill confirmation',
134
- 'Short position established with risk management active',
128
+ '{bear:Short} opened at optimal entry',
129
+ '{bear:Sell} filled - minimal slippage',
130
+ 'Entered {bear:short} with brackets',
131
+ '{bear:Short} at {zone:resistance} {action:rejection}',
132
+ 'Position: {bear:SHORT} - {risk:risk} defined',
133
+ '{bear:Short} complete - {risk:SL}/{profit:TP} set',
134
+ '{bear:Sell} confirmed at expected price',
135
+ '{bear:Short} executed - tight spread',
136
+ '{bear:Sold} at market - filled',
137
+ '{bear:Short} established - {risk:risk} active',
135
138
  ];
136
139
 
137
140
  const EXIT_PROFIT_MESSAGES = [
138
- 'Target reached - profit locked successfully',
139
- 'Profit taken at predetermined target level',
140
- 'Winner closed with full target achievement',
141
- 'TP hit - position closed with realized gain',
142
- 'Profit locked after successful trade execution',
143
- 'Gain realized - trade objective completed',
144
- 'Profitable exit at optimal price level',
145
- 'Target achieved with clean execution',
146
- 'Winner booked - adding to session P&L',
147
- 'Profit captured at resistance/support level',
141
+ '{profit:Target} reached - locked',
142
+ '{profit:Profit} at target level',
143
+ '{profit:Winner} closed - full target',
144
+ '{profit:TP} hit - realized gain',
145
+ '{profit:Profit} locked successfully',
146
+ '{profit:Gain} realized - objective met',
147
+ '{profit:Profitable} exit optimal',
148
+ '{profit:Target} achieved clean',
149
+ '{profit:Winner} booked to P&L',
150
+ '{profit:Profit} at {zone:level}',
148
151
  ];
149
152
 
150
153
  const EXIT_LOSS_MESSAGES = [
151
- 'Stop triggered - risk contained as planned',
152
- 'Loss taken within acceptable risk parameters',
153
- 'Loser closed - preserving capital for next setup',
154
- 'SL hit - position closed with controlled loss',
155
- 'Risk contained - stop loss executed properly',
156
- 'Loss realized within predefined risk budget',
157
- 'Stop executed at predetermined level',
158
- 'Risk managed - loss within acceptable range',
159
- 'Loser booked - maintaining risk discipline',
160
- 'Loss controlled - ready for next opportunity',
154
+ '{risk:Stop} triggered - contained',
155
+ '{risk:Loss} within parameters',
156
+ '{risk:Loser} closed - capital preserved',
157
+ '{risk:SL} hit - controlled loss',
158
+ '{risk:Risk} contained - SL executed',
159
+ '{risk:Loss} within budget',
160
+ '{risk:Stop} at predetermined level',
161
+ '{risk:Risk} managed - acceptable',
162
+ '{risk:Loser} booked - discipline',
163
+ '{risk:Loss} controlled - next setup',
161
164
  ];
162
165
 
163
166
  // =============================================================================
@@ -165,29 +168,29 @@ const EXIT_LOSS_MESSAGES = [
165
168
  // =============================================================================
166
169
 
167
170
  const ZONE_APPROACH_MESSAGES = [
168
- 'Approaching key liquidity zone for potential sweep',
169
- 'Zone test incoming - monitoring for rejection',
170
- 'Near decision point - watching order flow closely',
171
- 'Level approach detected with increasing volume',
172
- 'Key zone in range - preparing for reaction',
173
- 'Price nearing structure with momentum building',
174
- 'Zone proximity alert - sweep opportunity forming',
175
- 'Testing liquidity zone for potential entry',
176
- 'Approaching pivot level with volume confirmation',
177
- 'Near high-volume node - expecting reaction',
171
+ 'Approaching {zone:liquidity zone} for {action:sweep}',
172
+ '{zone:Zone} test - monitoring {action:rejection}',
173
+ 'Near decision point - watching flow',
174
+ '{zone:Level} approach with {flow:volume}',
175
+ 'Key {zone:zone} in range',
176
+ 'Price nearing {zone:structure}',
177
+ '{zone:Zone} proximity - {action:sweep} forming',
178
+ 'Testing {zone:liquidity zone}',
179
+ 'Approaching {zone:pivot} with {flow:volume}',
180
+ 'Near {flow:volume} node - reaction expected',
178
181
  ];
179
182
 
180
183
  const ZONE_CONFIRMED_MESSAGES = [
181
- 'Zone confirmation - level holding with rejection',
182
- 'Level validated with strong order flow response',
183
- 'Support/resistance active with visible defense',
184
- 'Zone reaction detected - entry signal possible',
185
- 'Level holding with institutional participation',
186
- 'Structure confirmed by price action rejection',
187
- 'Zone defense active with absorption visible',
188
- 'Level response detected on tape reading',
189
- 'Pivot confirmed with volume at level',
190
- 'Volume node reaction - zone integrity intact',
184
+ '{zone:Zone} confirmed - {action:rejection}',
185
+ '{zone:Level} validated - strong response',
186
+ '{zone:S/R} active with defense',
187
+ '{zone:Zone} reaction - signal possible',
188
+ '{zone:Level} holding - {inst:institutional}',
189
+ '{zone:Structure} confirmed by {action:rejection}',
190
+ '{zone:Zone} defense - absorption visible',
191
+ '{zone:Level} response on tape',
192
+ '{zone:Pivot} confirmed with {flow:volume}',
193
+ '{flow:Volume} node - {zone:zone} intact',
191
194
  ];
192
195
 
193
196
  // =============================================================================
@@ -195,29 +198,29 @@ const ZONE_CONFIRMED_MESSAGES = [
195
198
  // =============================================================================
196
199
 
197
200
  const HIGH_VOLATILITY_MESSAGES = [
198
- 'Volatility elevated - widening stops recommended',
199
- 'High ATR detected - adjust position sizing',
200
- 'Increased price range with fast moves',
201
- 'Market volatile - exercise caution on entries',
202
- 'Wide swings detected with rapid reversals',
203
- 'Volatility expansion phase - breakout conditions',
204
- 'Range expanding with momentum acceleration',
205
- 'High activity zone - increased tick velocity',
206
- 'Momentum surge with strong directional moves',
207
- 'Breakout conditions with volume confirmation',
201
+ '{flow:Volatility} elevated - widen {risk:stops}',
202
+ 'High ATR - adjust sizing',
203
+ 'Increased range - fast moves',
204
+ 'Market volatile - caution',
205
+ 'Wide swings - rapid reversals',
206
+ '{flow:Volatility} expansion - {action:breakout}',
207
+ 'Range expanding - {flow:momentum}',
208
+ 'High activity {zone:zone}',
209
+ '{flow:Momentum} surge - directional',
210
+ '{action:Breakout} conditions with {flow:volume}',
208
211
  ];
209
212
 
210
213
  const LOW_VOLATILITY_MESSAGES = [
211
- 'Low volatility - tighten stops for efficiency',
212
- 'Tight range detected - breakout pending',
213
- 'Compressed price action before expansion',
214
- 'Market quiet - awaiting catalyst for move',
215
- 'Narrow swings with decreasing volume',
216
- 'Volatility contraction - coiling for breakout',
217
- 'Range compressing with lowering highs/lows',
218
- 'Low activity zone - patience required',
219
- 'Momentum cooling with decreasing velocity',
220
- 'Consolidation forming before next move',
214
+ 'Low {flow:volatility} - tighten {risk:stops}',
215
+ 'Tight range - {action:breakout} pending',
216
+ 'Compressed action before expansion',
217
+ 'Market quiet - awaiting catalyst',
218
+ 'Narrow swings - {flow:volume} low',
219
+ '{flow:Volatility} contraction - coiling',
220
+ 'Range compressing',
221
+ 'Low activity - patience required',
222
+ '{flow:Momentum} cooling',
223
+ 'Consolidation forming',
221
224
  ];
222
225
 
223
226
  // =============================================================================
@@ -225,29 +228,29 @@ const LOW_VOLATILITY_MESSAGES = [
225
228
  // =============================================================================
226
229
 
227
230
  const RISK_PASSED_MESSAGES = [
228
- 'Risk check passed - trade within parameters',
229
- 'Trade approved by risk management filters',
230
- 'Within risk limits - position size acceptable',
231
- 'Risk validated - all criteria satisfied',
232
- 'Clear to trade - no risk constraints violated',
233
- 'Risk parameters met for current market conditions',
234
- 'Position size approved within daily limits',
235
- 'Risk budget OK - sufficient margin available',
236
- 'Trade authorized by all risk filters',
237
- 'Risk constraints satisfied - executing trade',
231
+ '{profit:Risk passed} - within parameters',
232
+ 'Trade {profit:approved} by {risk:risk} filters',
233
+ 'Within {risk:risk} limits - size OK',
234
+ '{risk:Risk} validated - criteria met',
235
+ '{profit:Clear to trade} - no violations',
236
+ '{risk:Risk} parameters met',
237
+ 'Size {profit:approved} within limits',
238
+ '{risk:Risk} budget OK',
239
+ 'Trade {profit:authorized}',
240
+ '{risk:Risk} satisfied - executing',
238
241
  ];
239
242
 
240
243
  const RISK_BLOCKED_MESSAGES = [
241
- 'Risk limit reached - trade blocked for protection',
242
- 'Trade blocked - exceeds position size limits',
243
- 'Exceeds risk threshold - reduce size or wait',
244
- 'Risk rejected - daily loss limit approaching',
245
- 'Waiting for conditions - risk too elevated',
246
- 'Risk parameters exceeded - trade not allowed',
247
- 'Position size rejected - above maximum allowed',
248
- 'Risk budget depleted - no new trades until reset',
249
- 'Trade denied - would exceed drawdown limits',
250
- 'Risk constraints violated - protecting capital',
244
+ '{risk:Risk limit} - blocked',
245
+ 'Trade {risk:blocked} - size exceeded',
246
+ 'Exceeds {risk:threshold} - wait',
247
+ '{risk:Rejected} - loss limit near',
248
+ '{risk:Risk} too elevated',
249
+ '{risk:Parameters exceeded}',
250
+ 'Size {risk:rejected} - max exceeded',
251
+ '{risk:Budget depleted}',
252
+ 'Trade {risk:denied} - drawdown',
253
+ '{risk:Constraints violated}',
251
254
  ];
252
255
 
253
256
  // =============================================================================
@@ -255,34 +258,34 @@ const RISK_BLOCKED_MESSAGES = [
255
258
  // =============================================================================
256
259
 
257
260
  const SCANNING_MESSAGES = [
258
- 'Scanning market for liquidity sweep opportunities...',
259
- 'Analyzing order flow for directional bias...',
260
- 'Monitoring market structure for zone formation...',
261
- 'Watching for swing point development...',
262
- 'Evaluating conditions for high-probability setup...',
263
- 'Processing market data through strategy filters...',
264
- 'Analyzing order book depth and imbalances...',
265
- 'Monitoring tape for institutional activity...',
266
- 'Scanning for alpha-generating opportunities...',
267
- 'Evaluating price action at key levels...',
268
- 'Analyzing microstructure for edge detection...',
269
- 'Monitoring bid/ask imbalances for signals...',
270
- 'Scanning liquidity zones for sweep setups...',
271
- 'Evaluating momentum across timeframes...',
272
- 'Analyzing market regime for strategy alignment...',
261
+ 'Scanning for {action:liquidity sweep}...',
262
+ 'Analyzing order flow for bias...',
263
+ 'Monitoring {zone:structure} for zones...',
264
+ 'Watching swing point development...',
265
+ 'Evaluating high-probability setup...',
266
+ 'Processing through strategy filters...',
267
+ 'Analyzing order book imbalances...',
268
+ 'Monitoring for {inst:institutional} activity...',
269
+ 'Scanning for alpha opportunities...',
270
+ 'Evaluating at key {zone:levels}...',
271
+ 'Analyzing microstructure for edge...',
272
+ 'Monitoring {bull:bid}/{bear:ask} imbalances...',
273
+ 'Scanning {zone:zones} for {action:sweep}...',
274
+ 'Evaluating {flow:momentum}...',
275
+ 'Analyzing regime alignment...',
273
276
  ];
274
277
 
275
278
  const WAITING_MESSAGES = [
276
- 'Waiting for sweep confirmation before entry...',
277
- 'Pending trigger - zone penetration required...',
278
- 'Standby mode - conditions not yet met...',
279
- 'Awaiting signal - monitoring zone closely...',
280
- 'Ready to act on confirmed liquidity sweep...',
281
- 'Monitoring for entry trigger activation...',
282
- 'Waiting for setup completion with rejection...',
283
- 'Confirmation pending - need price rejection...',
284
- 'Entry conditions not met - patience required...',
285
- 'Awaiting confluence of multiple factors...',
279
+ 'Waiting for {action:sweep} confirmation...',
280
+ 'Pending - {zone:zone} penetration needed...',
281
+ 'Standby - conditions not met...',
282
+ 'Awaiting signal - monitoring {zone:zone}...',
283
+ 'Ready for {action:liquidity sweep}...',
284
+ 'Monitoring entry trigger...',
285
+ 'Waiting for {action:rejection}...',
286
+ 'Confirmation pending...',
287
+ 'Entry conditions not met...',
288
+ 'Awaiting confluence...',
286
289
  ];
287
290
 
288
291
  // =============================================================================
@@ -290,52 +293,52 @@ const WAITING_MESSAGES = [
290
293
  // =============================================================================
291
294
 
292
295
  const TICK_FLOW_MESSAGES = [
293
- 'Processing tick data from Rithmic feed',
294
- 'Market data flowing with normal latency',
295
- 'Live feed active - all systems operational',
296
- 'Tick stream healthy with consistent flow',
297
- 'Data streaming from ticker plant connection',
298
- 'Feed connection stable - no packet loss',
299
- 'Real-time data active and synchronized',
300
- 'Tick processing nominal - strategy receiving',
301
- 'Data pipeline healthy - low latency confirmed',
302
- 'Market feed online with full depth',
303
- 'Tick ingestion active at expected rate',
304
- 'Data flow nominal - no gaps detected',
305
- 'Stream latency optimal for execution',
306
- 'Feed quality excellent - clean data',
307
- 'Data throughput normal for current session',
296
+ 'Processing tick data from Rithmic',
297
+ 'Market data flowing - normal latency',
298
+ 'Live feed active - systems OK',
299
+ 'Tick stream healthy',
300
+ 'Data from ticker plant',
301
+ 'Feed stable - no packet loss',
302
+ 'Real-time data synchronized',
303
+ 'Tick processing nominal',
304
+ 'Pipeline healthy - low latency',
305
+ 'Market feed online',
306
+ 'Tick ingestion active',
307
+ 'Data flow nominal',
308
+ 'Stream latency optimal',
309
+ 'Feed quality excellent',
310
+ 'Throughput normal',
308
311
  ];
309
312
 
310
313
  const BUILDING_BARS_MESSAGES = [
311
- 'Building price bars from tick aggregation',
312
- 'Aggregating ticks into OHLC structure',
313
- 'Forming candles for pattern analysis',
314
- 'Bar construction in progress with volume',
315
- 'Chart building from real-time tick data',
316
- 'OHLC aggregation updating continuously',
317
- 'Bar formation active for strategy input',
318
- 'Candle building with volume profile',
319
- 'Time bar processing for signal generation',
320
- 'Bar data updating with new tick input',
314
+ 'Building bars from ticks',
315
+ 'Aggregating into OHLC',
316
+ 'Forming candles',
317
+ 'Bar construction active',
318
+ 'Chart building',
319
+ 'OHLC updating',
320
+ 'Bar formation active',
321
+ 'Candle building',
322
+ 'Time bar processing',
323
+ 'Bar data updating',
321
324
  ];
322
325
 
323
326
  const MODEL_ANALYSIS_MESSAGES = [
324
- 'Running quantitative models on live data',
325
- 'Analyzing patterns for signal generation',
326
- 'Computing signals from multiple factors',
327
- 'Model evaluation in progress continuously',
328
- 'Strategy analysis with real-time inputs',
329
- 'Pattern recognition scanning price action',
330
- 'Signal computation from order flow data',
331
- 'Model processing tick-by-tick updates',
332
- 'Algorithm evaluation for trade signals',
333
- 'Quantitative analysis of market microstructure',
334
- 'Statistical modeling of price behavior',
335
- 'Feature extraction from market data',
336
- 'Predictive analysis for entry timing',
337
- 'Model optimization based on conditions',
338
- 'Multi-factor analysis for signal quality',
327
+ 'Running models on live data',
328
+ 'Analyzing for signals',
329
+ 'Computing multi-factor signals',
330
+ 'Model evaluation active',
331
+ 'Strategy analysis running',
332
+ 'Pattern recognition scanning',
333
+ 'Signal computation active',
334
+ 'Model processing ticks',
335
+ 'Algorithm evaluation',
336
+ 'Quantitative analysis',
337
+ 'Statistical modeling',
338
+ 'Feature extraction',
339
+ 'Predictive analysis',
340
+ 'Model optimization',
341
+ 'Multi-factor analysis',
339
342
  ];
340
343
 
341
344
  // =============================================================================
@@ -13,6 +13,8 @@
13
13
  'use strict';
14
14
 
15
15
  const chalk = require('chalk');
16
+ // Force colors to be enabled for log messages
17
+ chalk.level = 3;
16
18
  const {
17
19
  LONG_BIAS_MESSAGES,
18
20
  SHORT_BIAS_MESSAGES,
@@ -40,6 +42,28 @@ const {
40
42
  const recentMessages = new Map();
41
43
  const MAX_RECENT = 8;
42
44
 
45
+ // Color map for placeholders {type:text}
46
+ const colorMap = {
47
+ bull: chalk.cyan,
48
+ bear: chalk.magenta,
49
+ zone: chalk.yellow,
50
+ action: chalk.green,
51
+ risk: chalk.red,
52
+ profit: chalk.green.bold,
53
+ flow: chalk.blue,
54
+ inst: chalk.white.bold,
55
+ };
56
+
57
+ /**
58
+ * Apply colors to message placeholders like {bull:Buyers}
59
+ */
60
+ function colorize(msg) {
61
+ return msg.replace(/\{(\w+):([^}]+)\}/g, (match, type, text) => {
62
+ const colorFn = colorMap[type];
63
+ return colorFn ? colorFn(text) : text;
64
+ });
65
+ }
66
+
43
67
  /**
44
68
  * Get a message from a pool, avoiding recent ones
45
69
  */
@@ -57,7 +81,8 @@ function getVariedMessage(category, pool, defaultMsg) {
57
81
  if (recent.length > MAX_RECENT) recent.shift();
58
82
  recentMessages.set(category, recent);
59
83
 
60
- return chosen;
84
+ // Apply colors to placeholders
85
+ return colorize(chosen);
61
86
  }
62
87
 
63
88
  // =============================================================================
@@ -364,27 +364,23 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
364
364
  timestamp: tick.timestamp || Date.now()
365
365
  });
366
366
 
367
- // Calculate latency based on tick timestamp or inter-tick timing
368
- if (tick.timestamp) {
369
- const tickTime = typeof tick.timestamp === 'number' ? tick.timestamp : Date.parse(tick.timestamp);
370
- if (!isNaN(tickTime) && tickTime > 1000000000000) { // Valid millisecond timestamp
371
- stats.latency = Math.max(0, now - tickTime);
372
- }
373
- } else if (tick.ssboe && tick.usecs) {
367
+ // Calculate latency from Rithmic ssboe/usecs (exchange timestamp)
368
+ // Priority: ssboe/usecs (real exchange time) > inter-tick timing (fallback)
369
+ if (tick.ssboe && tick.usecs !== undefined) {
374
370
  // Rithmic sends ssboe (seconds since epoch) and usecs (microseconds)
375
- const tickTimeMs = tick.ssboe * 1000 + Math.floor(tick.usecs / 1000);
376
- stats.latency = Math.max(0, now - tickTimeMs);
377
- } else {
378
- // Estimate latency from tick frequency - if we're getting real-time data, latency should be low
379
- if (lastTickTime > 0) {
380
- const timeSinceLastTick = now - lastTickTime;
381
- // If ticks are coming frequently, latency is low
382
- if (timeSinceLastTick < 100) {
383
- tickLatencies.push(timeSinceLastTick);
384
- if (tickLatencies.length > 20) tickLatencies.shift();
385
- // Average of recent inter-tick times as proxy for latency
386
- stats.latency = Math.round(tickLatencies.reduce((a, b) => a + b, 0) / tickLatencies.length);
387
- }
371
+ const tickTimeMs = (tick.ssboe * 1000) + Math.floor(tick.usecs / 1000);
372
+ const latency = now - tickTimeMs;
373
+ // Only update if reasonable (0-5000ms) - avoids clock sync issues
374
+ if (latency >= 0 && latency < 5000) {
375
+ stats.latency = latency;
376
+ }
377
+ } else if (lastTickTime > 0) {
378
+ // Fallback: estimate from inter-tick timing
379
+ const timeSinceLastTick = now - lastTickTime;
380
+ if (timeSinceLastTick < 100) {
381
+ tickLatencies.push(timeSinceLastTick);
382
+ if (tickLatencies.length > 20) tickLatencies.shift();
383
+ stats.latency = Math.round(tickLatencies.reduce((a, b) => a + b, 0) / tickLatencies.length);
388
384
  }
389
385
  }
390
386
  lastTickTime = now;
@@ -289,8 +289,8 @@ class AlgoUI {
289
289
 
290
290
  // Activity header - HF style with animated spinner
291
291
  if (!this.startTime) this.startTime = Date.now();
292
- if (!this.spinnerFrame) this.spinnerFrame = 0;
293
- this.spinnerFrame = (this.spinnerFrame + 1) % SPINNER.length;
292
+ // Increment spinner frame on each render
293
+ this.spinnerFrame = ((this.spinnerFrame || 0) + 1) % SPINNER.length;
294
294
  const spinner = SPINNER[this.spinnerFrame];
295
295
  const now = new Date();
296
296
  const timeStr = now.toLocaleTimeString('en-US', { hour12: false });