hedgequantx 1.8.18 → 1.8.20

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 CHANGED
@@ -1,5 +1,7 @@
1
1
  # HedgeQuantX CLI
2
2
 
3
+ <div align="center">
4
+
3
5
  ```
4
6
  ██╗ ██╗███████╗██████╗ ██████╗ ███████╗ ██████╗ ██╗ ██╗ █████╗ ███╗ ██╗████████╗██╗ ██╗
5
7
  ██║ ██║██╔════╝██╔══██╗██╔════╝ ██╔════╝██╔═══██╗██║ ██║██╔══██╗████╗ ██║╚══██╔══╝╚██╗██╔╝
@@ -9,37 +11,51 @@
9
11
  ╚═╝ ╚═╝╚══════╝╚═════╝ ╚═════╝ ╚══════╝ ╚══▀▀═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝
10
12
  ```
11
13
 
12
- **Prop Futures Algo Trading CLI**
14
+ ### Prop Futures Algo Trading CLI
15
+
16
+ *Connect to 37+ prop firms and automate your futures trading*
17
+
18
+ [![npm version](https://img.shields.io/npm/v/hedgequantx?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/hedgequantx)
19
+ [![npm downloads](https://img.shields.io/npm/dm/hedgequantx?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/hedgequantx)
20
+ [![GitHub stars](https://img.shields.io/github/stars/HedgeQuantX/HQX-CLI?style=for-the-badge&logo=github&logoColor=white&color=181717)](https://github.com/HedgeQuantX/HQX-CLI)
21
+ [![License](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge)](LICENSE)
22
+
23
+ [![Node.js](https://img.shields.io/badge/Node.js-18+-339933?style=flat-square&logo=node.js&logoColor=white)](https://nodejs.org/)
24
+ [![Platform](https://img.shields.io/badge/Platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey?style=flat-square)](https://github.com/HedgeQuantX/HQX-CLI)
25
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen?style=flat-square)](https://github.com/HedgeQuantX/HQX-CLI/pulls)
13
26
 
14
- A powerful command-line interface for connecting to prop trading firms and managing your futures trading accounts with automated algo trading capabilities.
27
+ [Installation](#-installation) | [Features](#-features) | [Usage](#-usage) | [Algo Trading](#-algo-trading) | [Support](#-support)
15
28
 
16
- [![npm version](https://img.shields.io/npm/v/hedgequantx.svg)](https://www.npmjs.com/package/hedgequantx)
17
- [![npm downloads](https://img.shields.io/npm/dm/hedgequantx.svg)](https://www.npmjs.com/package/hedgequantx)
29
+ </div>
18
30
 
19
31
  ---
20
32
 
21
33
  ## Features
22
34
 
23
- - **Multi-platform support** - ProjectX, Rithmic, Tradovate
24
- - **37+ supported prop firms**
25
- - **Multi-account connections** - Connect multiple accounts simultaneously
26
- - **Real-time stats** - Balance, P&L, positions, orders
27
- - **Algo Trading** - One Account & Copy Trading modes
28
- - **HQX Server** - Cloud-based execution engine
29
- - **Secure sessions** - AES-256-GCM encrypted storage
30
- - **Auto-update** - Built-in update with restart
35
+ | Feature | Description |
36
+ |---------|-------------|
37
+ | **Multi-Platform** | ProjectX & Rithmic APIs |
38
+ | **37+ Prop Firms** | TopStep, Apex, Bulenox, and more |
39
+ | **Multi-Account** | Connect multiple accounts simultaneously |
40
+ | **Real-Time Stats** | Balance, P&L, positions, orders |
41
+ | **Algo Trading** | One Account & Copy Trading modes |
42
+ | **Ultra-Scalping** | VWAP Mean Reversion + Order Flow |
43
+ | **Market Hours** | Auto-blocks when market closed |
44
+ | **Cloud Execution** | HQX Server low-latency engine |
45
+ | **Secure Storage** | AES-256-GCM encrypted sessions |
46
+ | **Auto-Update** | Built-in version checker |
31
47
 
32
48
  ---
33
49
 
34
50
  ## Installation
35
51
 
36
- ### Option 1: NPM (Recommended)
52
+ ### NPM (Recommended)
37
53
 
38
54
  ```bash
39
55
  npm install -g hedgequantx
40
56
  ```
41
57
 
42
- ### Option 2: Clone from GitHub
58
+ ### From Source
43
59
 
44
60
  ```bash
45
61
  git clone https://github.com/HedgeQuantX/HQX-CLI.git
@@ -54,78 +70,19 @@ npm link
54
70
 
55
71
  ```bash
56
72
  # Launch CLI
57
- hedgequantx
58
-
59
- # Or use short alias
60
73
  hqx
61
74
 
75
+ # Or full command
76
+ hedgequantx
77
+
62
78
  # Show version
63
- hedgequantx version
79
+ hqx --version
64
80
  ```
65
81
 
66
82
  ---
67
83
 
68
- ## Algo Trading Modes
84
+ ## Dashboard Preview
69
85
 
70
- ### One Account Mode
71
- Trade on a single account with automated signals and risk management.
72
-
73
- - Symbol selection (ES, NQ, MNQ, etc.)
74
- - Configurable contracts quantity
75
- - Daily target and max risk limits
76
- - Real-time P&L tracking
77
- - Activity log with trade history
78
-
79
- ### Copy Trading Mode
80
- Mirror trades from a Lead account to Follower accounts.
81
-
82
- - Lead -> Follower trade copying
83
- - Different symbols per account
84
- - Configurable contract ratios
85
- - Privacy mode (hide account names)
86
- - Low-latency execution via HQX Server
87
-
88
- ---
89
-
90
- ## Supported Prop Firms (37+)
91
-
92
- | ProjectX (19) | Rithmic (16) | Tradovate (2) |
93
- |---------------|--------------|---------------|
94
- | TopStep | Apex Trader Funding | Apex |
95
- | Alpha Futures | TopstepTrader | TakeProfitTrader |
96
- | TickTickTrader | MES Capital | |
97
- | Bulenox | Bulenox | |
98
- | TradeDay | TradeFundrr | |
99
- | Blusky | TheTradingPit | |
100
- | Goat Futures | FundedFuturesNetwork | |
101
- | The Futures Desk | PropShopTrader | |
102
- | DayTraders | 4PropTrader | |
103
- | E8 Futures | DayTraders.com | |
104
- | Blue Guardian Futures | 10XFutures | |
105
- | FuturesElite | LucidTrading | |
106
- | FXIFY | ThriveTrading | |
107
- | Hola Prime | LegendsTrading | |
108
- | Top One Futures | Earn2Trade | |
109
- | Funding Futures | Tradesea | |
110
- | TX3 Funding | | |
111
- | Lucid Trading | | |
112
- | Tradeify | | |
113
-
114
- ---
115
-
116
- ## Dashboard Features
117
-
118
- - **View Accounts** - List all trading accounts with balance and status
119
- - **View Stats** - Trading metrics, equity curve, P&L calendar
120
- - **Add Prop-Account** - Connect multiple prop firms
121
- - **Algo-Trading** - One Account & Copy Trading modes
122
- - **Update HQX** - Auto-update with confirmation and restart
123
-
124
- ---
125
-
126
- ## Screenshots
127
-
128
- ### Main Dashboard
129
86
  ```
130
87
  ╔════════════════════════════════════════════════════════════════════════════════════════════════╗
131
88
  ║ ██╗ ██╗███████╗██████╗ ██████╗ ███████╗ ██████╗ ██╗ ██╗ █████╗ ███╗ ██╗████████╗██╗ ██╗ ║
@@ -135,111 +92,161 @@ Mirror trades from a Lead account to Follower accounts.
135
92
  ║ ██║ ██║███████╗██████╔╝╚██████╔╝███████╗╚██████╔╝╚██████╔╝██║ ██║██║ ╚████║ ██║ ██╔╝ ██╗ ║
136
93
  ║ ╚═╝ ╚═╝╚══════╝╚═════╝ ╚═════╝ ╚══════╝ ╚══▀▀═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ║
137
94
  ╠════════════════════════════════════════════════════════════════════════════════════════════════╣
138
- Prop Futures Algo Trading v1.3.0
95
+ Prop Futures Algo Trading v1.8.18
139
96
  ╠════════════════════════════════════════════════════════════════════════════════════════════════╣
140
- ║ Connections: 2 Accounts: 3 Balance: $601,526 P&L: +$1,526 (+0.3%) ║
141
- ╚════════════════════════════════════════════════════════════════════════════════════════════════╝
142
-
143
- ╔════════════════════════════════════════════════════════════════════════════════════════════════╗
144
97
  ║ Welcome, HQX Trader! ║
145
98
  ╠════════════════════════════════════════════════════════════════════════════════════════════════╣
146
- ┌────────────────────────────────────────────┐ ┌────────────────────────────────────────────┐
147
- ║ │ TopStep │ │ Apex Trader Funding │ ║
148
- └────────────────────────────────────────────┘ └────────────────────────────────────────────┘
99
+ TopStep ● Apex Trader Funding
100
+ ╠════════════════════════════════════════════════════════════════════════════════════════════════╣
101
+ Connections: 2 Accounts: 2 Balance: $449,682 P&L: +$0
149
102
  ╠════════════════════════════════════════════════════════════════════════════════════════════════╣
150
- ║ [1] View Accounts [2] View Stats
151
- ║ [+] Add Prop-Account [A] Algo-Trading
152
- ║ [U] Update HQX [X] Disconnect
103
+ ║ [1] View Accounts [2] View Stats
104
+ ║ [+] Add Prop-Account [A] Algo-Trading
105
+ ║ [U] Update HQX [X] Disconnect
153
106
  ╚════════════════════════════════════════════════════════════════════════════════════════════════╝
154
107
  ```
155
108
 
156
109
  ---
157
110
 
158
- ## Project Structure
111
+ ## Algo Trading
112
+
113
+ ### One Account Mode
114
+
115
+ Trade on a single account with HQX Ultra-Scalping strategy.
116
+
117
+ ```
118
+ ╠════════════════════════════════════════════════╤═══════════════════════════════════════════════╣
119
+ ║ Account: PRAC-V2-153156 │ Symbol: ES Mar26 ║
120
+ ╠════════════════════════════════════════════════╪═══════════════════════════════════════════════╣
121
+ ║ Qty: 1 │ P&L: +$0.00 ║
122
+ ╠════════════════════════════════════════════════╪═══════════════════════════════════════════════╣
123
+ ║ Target: $200.00 │ Risk: $100.00 ║
124
+ ╠════════════════════════════════════════════════╪═══════════════════════════════════════════════╣
125
+ ║ Trades: 0 W/L: 0/0 │ Server: ON ║
126
+ ╠════════════════════════════════════════════════╪═══════════════════════════════════════════════╣
127
+ ║ Latency: 45ms │ Propfirm: TopStep ║
128
+ ╚════════════════════════════════════════════════╧═══════════════════════════════════════════════╝
129
+ ```
130
+
131
+ ### Copy Trading Mode
132
+
133
+ Mirror trades from Lead to Follower accounts.
159
134
 
160
135
  ```
161
- HQX-CLI/
162
- ├── bin/
163
- │ └── cli.js # Entry point
164
- ├── src/
165
- │ ├── app.js # Main router (380 lines)
166
- ├── config/
167
- │ │ ├── constants.js # Futures symbols
168
- │ │ └── propfirms.js # 37+ PropFirms config
169
- │ ├── menus/
170
- │ │ ├── connect.js # Connection menus
171
- │ │ └── dashboard.js # Dashboard & update
172
- │ ├── pages/
173
- │ │ ├── algo/
174
- │ │ │ ├── ui.js # Algo trading UI
175
- │ │ │ ├── one-account.js # One Account mode
176
- │ │ │ └── copy-trading.js # Copy Trading mode
177
- │ │ ├── accounts.js
178
- │ │ └── stats.js
179
- │ ├── security/
180
- │ │ ├── encryption.js # AES-256-GCM
181
- │ │ ├── validation.js # Input sanitization
182
- │ │ └── rateLimit.js # API rate limiting
183
- │ ├── services/
184
- │ │ ├── projectx/ # ProjectX API
185
- │ │ ├── rithmic/ # Rithmic API
186
- │ │ ├── tradovate/ # Tradovate API
187
- │ │ ├── hqx-server.js # HQX Server API
188
- │ │ └── session.js # Encrypted sessions
189
- │ └── ui/
190
- │ ├── box.js
191
- │ ├── table.js
192
- │ └── device.js
193
- ├── package.json
194
- └── README.md
136
+ ╠════════════════════════════════════════════════╤═══════════════════════════════════════════════╣
137
+ Lead: Apex ***** │ Follower: TopStep ***** ║
138
+ ╠════════════════════════════════════════════════╪═══════════════════════════════════════════════╣
139
+ Symbol: NQ Mar26 │ Symbol: NQ Mar26 ║
140
+ ╠════════════════════════════════════════════════╪═══════════════════════════════════════════════╣
141
+ ║ Qty: 1 Qty: 1 ║
142
+ ╠════════════════════════════════════════════════╪═══════════════════════════════════════════════╣
143
+ Target: $400.00 │ Risk: $200.00 ║
144
+ ╚════════════════════════════════════════════════╧═══════════════════════════════════════════════╝
195
145
  ```
196
146
 
197
147
  ---
198
148
 
149
+ ## Supported Prop Firms
150
+
151
+ <details>
152
+ <summary><b>ProjectX (19 firms)</b></summary>
153
+
154
+ | Firm | Status |
155
+ |------|--------|
156
+ | TopStep | Active |
157
+ | Alpha Futures | Active |
158
+ | TickTickTrader | Active |
159
+ | Bulenox | Active |
160
+ | TradeDay | Active |
161
+ | Blusky | Active |
162
+ | Goat Futures | Active |
163
+ | The Futures Desk | Active |
164
+ | DayTraders | Active |
165
+ | E8 Futures | Active |
166
+ | Blue Guardian Futures | Active |
167
+ | FuturesElite | Active |
168
+ | FXIFY | Active |
169
+ | Hola Prime | Active |
170
+ | Top One Futures | Active |
171
+ | Funding Futures | Active |
172
+ | TX3 Funding | Active |
173
+ | Lucid Trading | Active |
174
+ | Tradeify | Active |
175
+
176
+ </details>
177
+
178
+ <details>
179
+ <summary><b>Rithmic (16 firms)</b></summary>
180
+
181
+ | Firm | Status |
182
+ |------|--------|
183
+ | Apex Trader Funding | Active |
184
+ | TopstepTrader | Active |
185
+ | MES Capital | Active |
186
+ | Bulenox | Active |
187
+ | TradeFundrr | Active |
188
+ | TheTradingPit | Active |
189
+ | FundedFuturesNetwork | Active |
190
+ | PropShopTrader | Active |
191
+ | 4PropTrader | Active |
192
+ | DayTraders.com | Active |
193
+ | 10XFutures | Active |
194
+ | LucidTrading | Active |
195
+ | ThriveTrading | Active |
196
+ | LegendsTrading | Active |
197
+ | Earn2Trade | Active |
198
+ | Tradesea | Active |
199
+
200
+ </details>
201
+
202
+ ---
203
+
199
204
  ## Security
200
205
 
201
- - AES-256-GCM encrypted session storage
202
- - Machine-bound encryption keys
203
- - Input validation and sanitization
204
- - API rate limiting
205
- - Secure file permissions (0600)
206
- - No credentials stored in plain text
206
+ | Feature | Implementation |
207
+ |---------|---------------|
208
+ | Encryption | AES-256-GCM |
209
+ | Key Binding | Machine-bound keys |
210
+ | Input | Validated & sanitized |
211
+ | Rate Limiting | API protection |
212
+ | File Permissions | 0600 (owner only) |
213
+ | Credentials | Never stored in plain text |
207
214
 
208
215
  ---
209
216
 
210
- ## Update
217
+ ## Changelog
211
218
 
212
- The CLI has a built-in update feature:
219
+ <details>
220
+ <summary><b>v1.8.x (Current)</b></summary>
213
221
 
214
- 1. Select **[U] Update HQX** from the dashboard
215
- 2. CLI checks npm registry for latest version
216
- 3. Prompts for confirmation before updating
217
- 4. Installs new version globally
218
- 5. Auto-restarts with new version
222
+ - Separate UI for One Account and Copy Trading
223
+ - Market hours validation
224
+ - Arrow keys navigation
225
+ - Contracts from API
226
+ - Native readline input
227
+ - Seamless UI design
228
+ - 40 visible activity logs
219
229
 
220
- Or manually:
230
+ </details>
221
231
 
222
- ```bash
223
- npm install -g hedgequantx@latest
224
- ```
232
+ <details>
233
+ <summary><b>v1.7.x</b></summary>
225
234
 
226
- ---
235
+ - HQX Ultra-Scalping strategy
236
+ - Copy Trading single symbol
237
+ - Spinner indicators
238
+ - Cyan color theme
227
239
 
228
- ## Changelog
240
+ </details>
229
241
 
230
- ### v1.3.0
231
- - Major refactoring for maintainability
232
- - Robust update function with confirmation
233
- - Fixed stdin leak in menus
234
- - Split services into modules
235
- - Algo UI: logs now show newest at bottom
242
+ <details>
243
+ <summary><b>v1.3.x</b></summary>
236
244
 
237
- ### v1.2.x
238
- - Algo Trading: One Account & Copy Trading modes
239
- - HQX Server integration
240
- - Rithmic full support
241
- - Multi-account dashboard
242
- - Privacy mode for account names
245
+ - Major refactoring
246
+ - Robust update function
247
+ - Modular services
248
+
249
+ </details>
243
250
 
244
251
  ---
245
252
 
@@ -247,17 +254,28 @@ npm install -g hedgequantx@latest
247
254
 
248
255
  - [x] ProjectX integration
249
256
  - [x] Rithmic integration
250
- - [x] Multi-propfirm support (37+ firms)
251
- - [x] Multi-account connections
252
- - [x] Stats with equity curve
257
+ - [x] 37+ prop firms
258
+ - [x] Multi-account
259
+ - [x] Stats & equity curve
253
260
  - [x] Encrypted sessions
254
- - [x] Algo Trading - One Account mode
255
- - [x] Algo Trading - Copy Trading mode
256
- - [x] HQX Server integration
257
- - [ ] Tradovate full integration
258
- - [ ] Real-time market data streaming
259
- - [ ] Advanced order types
260
- - [ ] Mobile companion app
261
+ - [x] One Account mode
262
+ - [x] Copy Trading mode
263
+ - [x] HQX Server
264
+ - [x] Market hours check
265
+ - [ ] Real-time streaming
266
+ - [ ] Advanced orders
267
+ - [ ] Mobile app
268
+
269
+ ---
270
+
271
+ ## Support
272
+
273
+ <div align="center">
274
+
275
+ [![Discord](https://img.shields.io/badge/Discord-Join%20Server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/UBKCERctZu)
276
+ [![GitHub Issues](https://img.shields.io/badge/GitHub-Issues-181717?style=for-the-badge&logo=github&logoColor=white)](https://github.com/HedgeQuantX/HQX-CLI/issues)
277
+
278
+ </div>
261
279
 
262
280
  ---
263
281
 
@@ -269,15 +287,14 @@ MIT License - see [LICENSE](LICENSE) for details.
269
287
 
270
288
  ## Disclaimer
271
289
 
272
- This software is for educational and informational purposes only. Trading futures involves substantial risk of loss and is not suitable for all investors. Past performance is not indicative of future results.
290
+ > This software is for educational and informational purposes only. Trading futures involves substantial risk of loss and is not suitable for all investors. Past performance is not indicative of future results.
273
291
 
274
292
  ---
275
293
 
276
- ## Support
294
+ <div align="center">
277
295
 
278
- - Discord: [https://discord.gg/UBKCERctZu](https://discord.gg/UBKCERctZu)
279
- - GitHub Issues: [https://github.com/HedgeQuantX/HQX-CLI/issues](https://github.com/HedgeQuantX/HQX-CLI/issues)
296
+ **Made with passion by HedgeQuantX**
280
297
 
281
- ---
298
+ [![GitHub](https://img.shields.io/badge/GitHub-HedgeQuantX-181717?style=flat-square&logo=github)](https://github.com/HedgeQuantX)
282
299
 
283
- **Made with passion by HedgeQuantX**
300
+ </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "1.8.18",
3
+ "version": "1.8.20",
4
4
  "description": "Prop Futures Algo Trading CLI - Connect to Topstep, Alpha Futures, and other prop firms",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -6,6 +6,23 @@
6
6
  const inquirer = require('inquirer');
7
7
  const readline = require('readline');
8
8
 
9
+ // Shared readline instance
10
+ let rl = null;
11
+
12
+ /**
13
+ * Get or create readline interface
14
+ */
15
+ const getReadline = () => {
16
+ if (!rl || rl.closed) {
17
+ rl = readline.createInterface({
18
+ input: process.stdin,
19
+ output: process.stdout,
20
+ terminal: true
21
+ });
22
+ }
23
+ return rl;
24
+ };
25
+
9
26
  /**
10
27
  * Ensure stdin is ready
11
28
  */
@@ -19,17 +36,14 @@ const prepareStdin = () => {
19
36
  };
20
37
 
21
38
  /**
22
- * Native readline prompt - more reliable than inquirer for simple input
39
+ * Native readline prompt
23
40
  */
24
41
  const nativePrompt = (message) => {
25
42
  return new Promise((resolve) => {
26
- const rl = readline.createInterface({
27
- input: process.stdin,
28
- output: process.stdout
29
- });
43
+ prepareStdin();
44
+ const r = getReadline();
30
45
 
31
- rl.question(message + ' ', (answer) => {
32
- rl.close();
46
+ r.question(message + ' ', (answer) => {
33
47
  resolve(answer || '');
34
48
  });
35
49
  });
@@ -54,6 +68,7 @@ const textInput = async (message, defaultVal = '') => {
54
68
  * Password input
55
69
  */
56
70
  const passwordInput = async (message) => {
71
+ if (rl && !rl.closed) { rl.close(); rl = null; }
57
72
  prepareStdin();
58
73
  const { value } = await inquirer.prompt([{
59
74
  type: 'password',
@@ -69,6 +84,7 @@ const passwordInput = async (message) => {
69
84
  * Confirm - arrow keys selection
70
85
  */
71
86
  const confirmPrompt = async (message, defaultVal = true) => {
87
+ if (rl && !rl.closed) { rl.close(); rl = null; }
72
88
  prepareStdin();
73
89
  const choices = defaultVal
74
90
  ? [{ name: 'Yes', value: true }, { name: 'No', value: false }]
@@ -89,6 +105,7 @@ const confirmPrompt = async (message, defaultVal = true) => {
89
105
  * Number input
90
106
  */
91
107
  const numberInput = async (message, defaultVal = 1, min = 1, max = 1000) => {
108
+ if (rl && !rl.closed) { rl.close(); rl = null; }
92
109
  prepareStdin();
93
110
  const { value } = await inquirer.prompt([{
94
111
  type: 'input',
@@ -111,6 +128,11 @@ const numberInput = async (message, defaultVal = 1, min = 1, max = 1000) => {
111
128
  * Select - arrow keys navigation
112
129
  */
113
130
  const selectOption = async (message, options) => {
131
+ // Close shared readline before inquirer to avoid conflicts
132
+ if (rl && !rl.closed) {
133
+ rl.close();
134
+ rl = null;
135
+ }
114
136
  prepareStdin();
115
137
 
116
138
  const choices = options.map(opt => ({