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 +1 -1
- package/src/lib/smart-logs-messages.js +236 -233
- package/src/lib/smart-logs.js +26 -1
- package/src/pages/algo/algo-executor.js +16 -20
- package/src/pages/algo/ui.js +2 -2
package/package.json
CHANGED
|
@@ -2,32 +2,35 @@
|
|
|
2
2
|
* =============================================================================
|
|
3
3
|
* Smart Logs Messages - HF Grade Message Pools
|
|
4
4
|
* =============================================================================
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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
|
|
17
|
-
'Bid side absorbing sell pressure
|
|
18
|
-
'Bullish
|
|
19
|
-
'Buy programs
|
|
20
|
-
'Strong buyer presence
|
|
21
|
-
'Accumulation
|
|
22
|
-
'Demand exceeding supply - bid
|
|
23
|
-
'Buyers stepping up with institutional size
|
|
24
|
-
'Long-side momentum
|
|
25
|
-
'Bid accumulation
|
|
26
|
-
'Bullish delta divergence confirmed
|
|
27
|
-
'Buy-side imbalance driving price
|
|
28
|
-
'Institutional buying
|
|
29
|
-
'Aggressive bid
|
|
30
|
-
'Bullish microstructure with strong delta
|
|
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
|
|
39
|
-
'Offer side absorbing buy pressure
|
|
40
|
-
'Bearish
|
|
41
|
-
'Sell programs
|
|
42
|
-
'Strong seller presence
|
|
43
|
-
'Distribution
|
|
44
|
-
'Supply exceeding demand - offer
|
|
45
|
-
'Sellers stepping in with institutional size
|
|
46
|
-
'Short-side momentum
|
|
47
|
-
'Offer distribution
|
|
48
|
-
'Bearish delta divergence confirmed
|
|
49
|
-
'Sell-side imbalance driving price
|
|
50
|
-
'Institutional selling
|
|
51
|
-
'Aggressive offer
|
|
52
|
-
'Bearish microstructure with weak delta
|
|
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
|
|
61
|
-
'Two-way flow
|
|
62
|
-
'Consolidation
|
|
63
|
-
'No
|
|
64
|
-
'Mixed signals
|
|
65
|
-
'Range-bound
|
|
66
|
-
'Equilibrium
|
|
67
|
-
'Neutral
|
|
68
|
-
'Balanced book
|
|
69
|
-
'Rotation
|
|
70
|
-
'Price discovery
|
|
71
|
-
'Awaiting catalyst - volume declining
|
|
72
|
-
'Sideways chop
|
|
73
|
-
'Mean reversion zone
|
|
74
|
-
'Liquidity absorption
|
|
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
|
|
83
|
-
'Long opportunity
|
|
84
|
-
'Bullish setup
|
|
85
|
-
'Entry
|
|
86
|
-
'Buy zone
|
|
87
|
-
'Long trigger
|
|
88
|
-
'Bullish confirmation
|
|
89
|
-
'Buy
|
|
90
|
-
'Long setup materialized
|
|
91
|
-
'Bullish pattern complete - entry
|
|
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
|
|
96
|
-
'Short opportunity
|
|
97
|
-
'Bearish setup
|
|
98
|
-
'Entry
|
|
99
|
-
'Sell zone
|
|
100
|
-
'Short trigger
|
|
101
|
-
'Bearish confirmation
|
|
102
|
-
'Sell
|
|
103
|
-
'Short setup materialized
|
|
104
|
-
'Bearish pattern complete - entry
|
|
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
|
|
113
|
-
'Buy
|
|
114
|
-
'Entered long with
|
|
115
|
-
'Long
|
|
116
|
-
'Position: LONG
|
|
117
|
-
'Long
|
|
118
|
-
'Buy
|
|
119
|
-
'Long
|
|
120
|
-
'Bought at market
|
|
121
|
-
'Long
|
|
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
|
|
126
|
-
'Sell
|
|
127
|
-
'Entered short with
|
|
128
|
-
'Short
|
|
129
|
-
'Position: SHORT
|
|
130
|
-
'Short
|
|
131
|
-
'Sell
|
|
132
|
-
'Short
|
|
133
|
-
'Sold at market
|
|
134
|
-
'Short
|
|
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 -
|
|
139
|
-
'Profit
|
|
140
|
-
'Winner closed
|
|
141
|
-
'TP hit -
|
|
142
|
-
'Profit locked
|
|
143
|
-
'Gain realized -
|
|
144
|
-
'Profitable exit
|
|
145
|
-
'Target achieved
|
|
146
|
-
'Winner booked
|
|
147
|
-
'Profit
|
|
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 -
|
|
152
|
-
'Loss
|
|
153
|
-
'Loser closed -
|
|
154
|
-
'SL hit -
|
|
155
|
-
'Risk contained -
|
|
156
|
-
'Loss
|
|
157
|
-
'Stop
|
|
158
|
-
'Risk managed -
|
|
159
|
-
'Loser booked -
|
|
160
|
-
'Loss controlled -
|
|
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
|
|
169
|
-
'Zone test
|
|
170
|
-
'Near decision point - watching
|
|
171
|
-
'Level approach
|
|
172
|
-
'Key zone in range
|
|
173
|
-
'Price nearing structure
|
|
174
|
-
'Zone proximity
|
|
175
|
-
'Testing liquidity zone
|
|
176
|
-
'Approaching pivot
|
|
177
|
-
'Near
|
|
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
|
|
182
|
-
'Level validated
|
|
183
|
-
'
|
|
184
|
-
'Zone reaction
|
|
185
|
-
'Level holding
|
|
186
|
-
'Structure confirmed by
|
|
187
|
-
'Zone defense
|
|
188
|
-
'Level response
|
|
189
|
-
'Pivot confirmed with volume
|
|
190
|
-
'Volume node
|
|
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 -
|
|
199
|
-
'High ATR
|
|
200
|
-
'Increased
|
|
201
|
-
'Market volatile -
|
|
202
|
-
'Wide swings
|
|
203
|
-
'Volatility expansion
|
|
204
|
-
'Range expanding
|
|
205
|
-
'High activity zone
|
|
206
|
-
'Momentum surge
|
|
207
|
-
'Breakout conditions with volume
|
|
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
|
|
212
|
-
'Tight range
|
|
213
|
-
'Compressed
|
|
214
|
-
'Market quiet - awaiting catalyst
|
|
215
|
-
'Narrow swings
|
|
216
|
-
'Volatility contraction - coiling
|
|
217
|
-
'Range compressing
|
|
218
|
-
'Low activity
|
|
219
|
-
'Momentum cooling
|
|
220
|
-
'Consolidation forming
|
|
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
|
|
229
|
-
'Trade approved by risk
|
|
230
|
-
'Within risk limits -
|
|
231
|
-
'Risk validated -
|
|
232
|
-
'Clear to trade - no
|
|
233
|
-
'Risk parameters met
|
|
234
|
-
'
|
|
235
|
-
'Risk budget OK
|
|
236
|
-
'Trade authorized
|
|
237
|
-
'Risk
|
|
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
|
|
242
|
-
'Trade blocked -
|
|
243
|
-
'Exceeds risk
|
|
244
|
-
'
|
|
245
|
-
'
|
|
246
|
-
'
|
|
247
|
-
'
|
|
248
|
-
'
|
|
249
|
-
'Trade denied -
|
|
250
|
-
'
|
|
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
|
|
259
|
-
'Analyzing order flow for
|
|
260
|
-
'Monitoring
|
|
261
|
-
'Watching
|
|
262
|
-
'Evaluating
|
|
263
|
-
'Processing
|
|
264
|
-
'Analyzing order book
|
|
265
|
-
'Monitoring
|
|
266
|
-
'Scanning for alpha
|
|
267
|
-
'Evaluating
|
|
268
|
-
'Analyzing microstructure for edge
|
|
269
|
-
'Monitoring bid/ask imbalances
|
|
270
|
-
'Scanning
|
|
271
|
-
'Evaluating momentum
|
|
272
|
-
'Analyzing
|
|
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
|
|
277
|
-
'Pending
|
|
278
|
-
'Standby
|
|
279
|
-
'Awaiting signal - monitoring zone
|
|
280
|
-
'Ready
|
|
281
|
-
'Monitoring
|
|
282
|
-
'Waiting for
|
|
283
|
-
'Confirmation pending
|
|
284
|
-
'Entry conditions not met
|
|
285
|
-
'Awaiting confluence
|
|
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
|
|
294
|
-
'Market data flowing
|
|
295
|
-
'Live feed active -
|
|
296
|
-
'Tick stream healthy
|
|
297
|
-
'Data
|
|
298
|
-
'Feed
|
|
299
|
-
'Real-time data
|
|
300
|
-
'Tick processing nominal
|
|
301
|
-
'
|
|
302
|
-
'Market feed online
|
|
303
|
-
'Tick ingestion active
|
|
304
|
-
'Data flow nominal
|
|
305
|
-
'Stream latency optimal
|
|
306
|
-
'Feed quality excellent
|
|
307
|
-
'
|
|
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
|
|
312
|
-
'Aggregating
|
|
313
|
-
'Forming candles
|
|
314
|
-
'Bar construction
|
|
315
|
-
'Chart building
|
|
316
|
-
'OHLC
|
|
317
|
-
'Bar formation active
|
|
318
|
-
'Candle building
|
|
319
|
-
'Time bar processing
|
|
320
|
-
'Bar data updating
|
|
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
|
|
325
|
-
'Analyzing
|
|
326
|
-
'Computing signals
|
|
327
|
-
'Model evaluation
|
|
328
|
-
'Strategy analysis
|
|
329
|
-
'Pattern recognition scanning
|
|
330
|
-
'Signal computation
|
|
331
|
-
'Model processing
|
|
332
|
-
'Algorithm evaluation
|
|
333
|
-
'Quantitative analysis
|
|
334
|
-
'Statistical modeling
|
|
335
|
-
'Feature extraction
|
|
336
|
-
'Predictive analysis
|
|
337
|
-
'Model optimization
|
|
338
|
-
'Multi-factor analysis
|
|
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
|
// =============================================================================
|
package/src/lib/smart-logs.js
CHANGED
|
@@ -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
|
-
|
|
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
|
|
368
|
-
|
|
369
|
-
|
|
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
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
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;
|
package/src/pages/algo/ui.js
CHANGED
|
@@ -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
|
-
|
|
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 });
|