hedgequantx 2.3.3 → 2.3.4
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 +54 -125
- package/dist/lib/api.js +1 -0
- package/dist/{algo/trading-api.jsc → lib/api.jsc} +0 -0
- package/dist/lib/api2.js +1 -0
- package/dist/lib/api2.jsc +0 -0
- package/dist/lib/core.js +1 -0
- package/dist/lib/core.jsc +0 -0
- package/dist/lib/core2.js +1 -0
- package/dist/lib/core2.jsc +0 -0
- package/dist/lib/data.js +1 -0
- package/dist/lib/data.jsc +0 -0
- package/dist/lib/data2.js +1 -0
- package/dist/lib/data2.jsc +0 -0
- package/dist/lib/decoder.js +1 -0
- package/dist/{algo/rithmic-decoder.jsc → lib/decoder.jsc} +0 -0
- package/dist/lib/m/mod1.js +1 -0
- package/dist/lib/m/mod1.jsc +0 -0
- package/dist/lib/m/mod2.js +1 -0
- package/dist/lib/m/mod2.jsc +0 -0
- package/dist/lib/n/r1.js +1 -0
- package/dist/lib/n/r1.jsc +0 -0
- package/dist/lib/n/r2.js +1 -0
- package/dist/lib/n/r2.jsc +0 -0
- package/dist/lib/n/r3.js +1 -0
- package/dist/lib/n/r3.jsc +0 -0
- package/dist/lib/n/r4.js +1 -0
- package/dist/lib/n/r4.jsc +0 -0
- package/dist/lib/n/r5.js +1 -0
- package/dist/lib/n/r5.jsc +0 -0
- package/dist/lib/n/r6.js +1 -0
- package/dist/{algo/rithmic/pool.jsc → lib/n/r6.jsc} +0 -0
- package/dist/lib/n/r7.js +1 -0
- package/dist/lib/n/r7.jsc +0 -0
- package/dist/lib/o/util1.js +1 -0
- package/dist/lib/o/util1.jsc +0 -0
- package/dist/lib/o/util2.js +1 -0
- package/dist/lib/o/util2.jsc +0 -0
- package/package.json +7 -11
- package/src/config/constants.js +4 -42
- package/src/config/index.js +0 -2
- package/src/pages/algo/copy-trading.js +11 -18
- package/src/pages/algo/one-account.js +18 -15
- package/src/services/projectx/index.js +14 -5
- package/src/services/rithmic/constants.js +2 -151
- package/src/services/rithmic/index.js +6 -15
- package/dist/algo/copy-engine.js +0 -3
- package/dist/algo/copy-engine.jsc +0 -0
- package/dist/algo/engine.js +0 -3
- package/dist/algo/engine.jsc +0 -0
- package/dist/algo/market-data-rithmic.js +0 -3
- package/dist/algo/market-data-rithmic.jsc +0 -0
- package/dist/algo/market-data.js +0 -3
- package/dist/algo/market-data.jsc +0 -0
- package/dist/algo/rithmic/connection.js +0 -3
- package/dist/algo/rithmic/connection.jsc +0 -0
- package/dist/algo/rithmic/constants.js +0 -3
- package/dist/algo/rithmic/constants.jsc +0 -0
- package/dist/algo/rithmic/index.js +0 -3
- package/dist/algo/rithmic/index.jsc +0 -0
- package/dist/algo/rithmic/market-data.js +0 -3
- package/dist/algo/rithmic/market-data.jsc +0 -0
- package/dist/algo/rithmic/pnl.js +0 -3
- package/dist/algo/rithmic/pnl.jsc +0 -0
- package/dist/algo/rithmic/pool.js +0 -3
- package/dist/algo/rithmic/trading.js +0 -3
- package/dist/algo/rithmic/trading.jsc +0 -0
- package/dist/algo/rithmic-decoder.js +0 -3
- package/dist/algo/strategies/ultra-scalping-v2.js +0 -3
- package/dist/algo/strategies/ultra-scalping-v2.jsc +0 -0
- package/dist/algo/strategies/ultra-scalping.js +0 -3
- package/dist/algo/strategies/ultra-scalping.jsc +0 -0
- package/dist/algo/trading-api-rithmic.js +0 -3
- package/dist/algo/trading-api-rithmic.jsc +0 -0
- package/dist/algo/trading-api.js +0 -3
- package/dist/algo/utils/smart-logger.js +0 -3
- package/dist/algo/utils/smart-logger.jsc +0 -0
- package/dist/algo/utils/smart-logs.js +0 -3
- package/dist/algo/utils/smart-logs.jsc +0 -0
- package/src/config/contracts.js +0 -100
package/README.md
CHANGED
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
██╗ ██╗███████╗██████╗ ██████╗ ███████╗ ██████╗ ██╗ ██╗ █████╗ ███╗ ██╗████████╗██╗ ██╗
|
|
7
|
-
██║ ██║██╔════╝██╔══██╗██╔════╝ ██╔════╝██╔═══██╗██║ ██║██╔══██╗████╗ ██║╚══██╔══╝╚██╗██╔╝
|
|
8
|
-
███████║█████╗ ██║ ██║██║ ███╗█████╗ ██║ ██║██║ ██║███████║██╔██╗ ██║ ██║ ╚███╔╝
|
|
9
|
-
██╔══██║██╔══╝ ██║ ██║██║ ██║██╔══╝ ██║▄▄ ██║██║ ██║██╔══██║██║╚██╗██║ ██║ ██╔██╗
|
|
10
|
-
██║ ██║███████╗██████╔╝╚██████╔╝███████╗╚██████╔╝╚██████╔╝██║ ██║██║ ╚████║ ██║ ██╔╝ ██╗
|
|
11
|
-
╚═╝ ╚═╝╚══════╝╚═════╝ ╚═════╝ ╚══════╝ ╚══▀▀═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝
|
|
12
|
-
```
|
|
5
|
+
<img src="assets/logo.png" alt="HedgeQuantX" width="700">
|
|
13
6
|
|
|
14
7
|
### Prop Futures Algo Trading CLI
|
|
15
8
|
|
|
16
9
|
*Connect to 37+ prop firms and automate your futures trading*
|
|
17
10
|
|
|
18
|
-
[](https://hedgequantx.com)
|
|
12
|
+
[](https://www.npmjs.com/package/hedgequantx)
|
|
13
|
+
[](https://www.npmjs.com/package/hedgequantx)
|
|
20
14
|
[](https://github.com/HedgeQuantX/HQX-CLI)
|
|
21
|
-
[](LICENSE)
|
|
16
|
+
|
|
17
|
+
[](https://nodejs.org/)
|
|
18
|
+
[](https://github.com/HedgeQuantX/HQX-CLI)
|
|
19
|
+
[](https://discord.gg/UBKCERctZu)
|
|
20
|
+
[](https://github.com/HedgeQuantX/HQX-CLI/pulls)
|
|
22
21
|
|
|
23
|
-
[](https://hedgequantx.com)
|
|
23
|
+
[](https://hedgequantx.com)
|
|
24
|
+
[](https://hedgequantx.com)
|
|
25
|
+
[](https://hedgequantx.com)
|
|
26
26
|
|
|
27
|
-
[
|
|
27
|
+
[Website](https://hedgequantx.com) | [Installation](#installation) | [Features](#features) | [Algo Trading](#algo-trading) | [Discord](https://discord.gg/UBKCERctZu)
|
|
28
28
|
|
|
29
29
|
</div>
|
|
30
30
|
|
|
@@ -89,28 +89,9 @@ hqx --version
|
|
|
89
89
|
|
|
90
90
|
## Dashboard Preview
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
║ ██║ ██║██╔════╝██╔══██╗██╔════╝ ██╔════╝██╔═══██╗██║ ██║██╔══██╗████╗ ██║╚══██╔══╝╚██╗██╔╝ ║
|
|
96
|
-
║ ███████║█████╗ ██║ ██║██║ ███╗█████╗ ██║ ██║██║ ██║███████║██╔██╗ ██║ ██║ ╚███╔╝ ║
|
|
97
|
-
║ ██╔══██║██╔══╝ ██║ ██║██║ ██║██╔══╝ ██║▄▄ ██║██║ ██║██╔══██║██║╚██╗██║ ██║ ██╔██╗ ║
|
|
98
|
-
║ ██║ ██║███████╗██████╔╝╚██████╔╝███████╗╚██████╔╝╚██████╔╝██║ ██║██║ ╚████║ ██║ ██╔╝ ██╗ ║
|
|
99
|
-
║ ╚═╝ ╚═╝╚══════╝╚═════╝ ╚═════╝ ╚══════╝ ╚══▀▀═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ║
|
|
100
|
-
╠════════════════════════════════════════════════════════════════════════════════════════════════╣
|
|
101
|
-
║ Prop Futures Algo Trading v1.8.18 ║
|
|
102
|
-
╠════════════════════════════════════════════════════════════════════════════════════════════════╣
|
|
103
|
-
║ Welcome, HQX Trader! ║
|
|
104
|
-
╠════════════════════════════════════════════════════════════════════════════════════════════════╣
|
|
105
|
-
║ ● TopStep ● Apex Trader Funding ║
|
|
106
|
-
╠════════════════════════════════════════════════════════════════════════════════════════════════╣
|
|
107
|
-
║ Connections: 2 Accounts: 2 Balance: $449,682 P&L: +$0 ║
|
|
108
|
-
╠════════════════════════════════════════════════════════════════════════════════════════════════╣
|
|
109
|
-
║ [1] View Accounts [2] View Stats ║
|
|
110
|
-
║ [+] Add Prop-Account [A] Algo-Trading ║
|
|
111
|
-
║ [U] Update HQX [X] Disconnect ║
|
|
112
|
-
╚════════════════════════════════════════════════════════════════════════════════════════════════╝
|
|
113
|
-
```
|
|
92
|
+
<div align="center">
|
|
93
|
+
<img src="assets/dashboard.png" alt="HQX Dashboard" width="800">
|
|
94
|
+
</div>
|
|
114
95
|
|
|
115
96
|
---
|
|
116
97
|
|
|
@@ -120,90 +101,43 @@ hqx --version
|
|
|
120
101
|
|
|
121
102
|
Trade on a single account with HQX algo strategy.
|
|
122
103
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
╠════════════════════════════════════════════════╪═══════════════════════════════════════════════╣
|
|
127
|
-
║ Qty: 1 │ P&L: +$0.00 ║
|
|
128
|
-
╠════════════════════════════════════════════════╪═══════════════════════════════════════════════╣
|
|
129
|
-
║ Target: $200.00 │ Risk: $100.00 ║
|
|
130
|
-
╠════════════════════════════════════════════════╪═══════════════════════════════════════════════╣
|
|
131
|
-
║ Trades: 0 W/L: 0/0 │ Server: ON ║
|
|
132
|
-
╠════════════════════════════════════════════════╪═══════════════════════════════════════════════╣
|
|
133
|
-
║ Latency: 45ms │ Propfirm: TopStep ║
|
|
134
|
-
╚════════════════════════════════════════════════╧═══════════════════════════════════════════════╝
|
|
135
|
-
```
|
|
104
|
+
<div align="center">
|
|
105
|
+
<img src="assets/algo-trading.png" alt="HQX Algo Trading" width="800">
|
|
106
|
+
</div>
|
|
136
107
|
|
|
137
108
|
### Copy Trading Mode
|
|
138
109
|
|
|
139
110
|
Mirror trades from Lead to Follower accounts.
|
|
140
111
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
╠════════════════════════════════════════════════╪═══════════════════════════════════════════════╣
|
|
145
|
-
║ Symbol: NQ Mar26 │ Symbol: NQ Mar26 ║
|
|
146
|
-
╠════════════════════════════════════════════════╪═══════════════════════════════════════════════╣
|
|
147
|
-
║ Qty: 1 │ Qty: 1 ║
|
|
148
|
-
╠════════════════════════════════════════════════╪═══════════════════════════════════════════════╣
|
|
149
|
-
║ Target: $400.00 │ Risk: $200.00 ║
|
|
150
|
-
╚════════════════════════════════════════════════╧═══════════════════════════════════════════════╝
|
|
151
|
-
```
|
|
112
|
+
<div align="center">
|
|
113
|
+
<img src="assets/copy-trading.png" alt="HQX Copy Trading" width="800">
|
|
114
|
+
</div>
|
|
152
115
|
|
|
153
116
|
---
|
|
154
117
|
|
|
155
118
|
## Supported Prop Firms
|
|
156
119
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
|
161
|
-
|
|
162
|
-
|
|
|
163
|
-
| Alpha Futures |
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
|
168
|
-
|
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
| TX3 Funding | Active |
|
|
179
|
-
| Lucid Trading | Active |
|
|
180
|
-
| Tradeify | Active |
|
|
181
|
-
|
|
182
|
-
</details>
|
|
183
|
-
|
|
184
|
-
<details>
|
|
185
|
-
<summary><b>Rithmic (16 firms)</b></summary>
|
|
186
|
-
|
|
187
|
-
| Firm | Status |
|
|
188
|
-
|------|--------|
|
|
189
|
-
| Apex Trader Funding | Active |
|
|
190
|
-
| TopstepTrader | Active |
|
|
191
|
-
| MES Capital | Active |
|
|
192
|
-
| Bulenox | Active |
|
|
193
|
-
| TradeFundrr | Active |
|
|
194
|
-
| TheTradingPit | Active |
|
|
195
|
-
| FundedFuturesNetwork | Active |
|
|
196
|
-
| PropShopTrader | Active |
|
|
197
|
-
| 4PropTrader | Active |
|
|
198
|
-
| DayTraders.com | Active |
|
|
199
|
-
| 10XFutures | Active |
|
|
200
|
-
| LucidTrading | Active |
|
|
201
|
-
| ThriveTrading | Active |
|
|
202
|
-
| LegendsTrading | Active |
|
|
203
|
-
| Earn2Trade | Active |
|
|
204
|
-
| Tradesea | Active |
|
|
205
|
-
|
|
206
|
-
</details>
|
|
120
|
+
| ProjectX (19) | Rithmic (16) | Tradovate (3) |
|
|
121
|
+
|---------------|--------------|---------------|
|
|
122
|
+
| TopStep | Apex Trader Funding | Apex |
|
|
123
|
+
| TickTickTrader | TopstepTrader | TakeProfitTrader |
|
|
124
|
+
| TradeDay | MES Capital | MyFundedFutures |
|
|
125
|
+
| Goat Futures | Bulenox | |
|
|
126
|
+
| Alpha Futures | TradeFundrr | |
|
|
127
|
+
| Bulenox | TheTradingPit | |
|
|
128
|
+
| Blusky | FundedFuturesNetwork | |
|
|
129
|
+
| The Futures Desk | PropShopTrader | |
|
|
130
|
+
| DayTraders | 4PropTrader | |
|
|
131
|
+
| E8 Futures | DayTraders.com | |
|
|
132
|
+
| Blue Guardian Futures | 10XFutures | |
|
|
133
|
+
| FuturesElite | LucidTrading | |
|
|
134
|
+
| FXIFY | ThriveTrading | |
|
|
135
|
+
| Hola Prime | LegendsTrading | |
|
|
136
|
+
| Top One Futures | Earn2Trade | |
|
|
137
|
+
| Funding Futures | Tradesea | |
|
|
138
|
+
| TX3 Funding | | |
|
|
139
|
+
| Lucid Trading | | |
|
|
140
|
+
| Tradeify | | |
|
|
207
141
|
|
|
208
142
|
---
|
|
209
143
|
|
|
@@ -258,19 +192,14 @@ Mirror trades from Lead to Follower accounts.
|
|
|
258
192
|
|
|
259
193
|
## Roadmap
|
|
260
194
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
-
|
|
267
|
-
|
|
268
|
-
-
|
|
269
|
-
- [x] HQX Server
|
|
270
|
-
- [x] Market hours check
|
|
271
|
-
- [ ] Real-time streaming
|
|
272
|
-
- [ ] Advanced orders
|
|
273
|
-
- [ ] Mobile app
|
|
195
|
+
| Done | Done | Coming Soon |
|
|
196
|
+
|------|------|-------------|
|
|
197
|
+
| :white_check_mark: ProjectX integration | :white_check_mark: One Account mode | :hourglass: Tradovate integration |
|
|
198
|
+
| :white_check_mark: Rithmic integration | :white_check_mark: Copy Trading mode | :hourglass: Telegram alerts |
|
|
199
|
+
| :white_check_mark: 38+ prop firms | :white_check_mark: HQX Server | :hourglass: Multi-symbol trading |
|
|
200
|
+
| :white_check_mark: Multi-account | :white_check_mark: Market hours check | :hourglass: Performance analytics |
|
|
201
|
+
| :white_check_mark: Trailing SL & BE | :white_check_mark: Session summary | :hourglass: Trade journal export |
|
|
202
|
+
| :white_check_mark: Encrypted sessions | :white_check_mark: Auto-update | :hourglass: Web dashboard |
|
|
274
203
|
|
|
275
204
|
---
|
|
276
205
|
|
|
@@ -287,7 +216,7 @@ Mirror trades from Lead to Follower accounts.
|
|
|
287
216
|
|
|
288
217
|
## License
|
|
289
218
|
|
|
290
|
-
|
|
219
|
+
MIT License - Open Source
|
|
291
220
|
|
|
292
221
|
---
|
|
293
222
|
|
package/dist/lib/api.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./api.jsc');
|
|
Binary file
|
package/dist/lib/api2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./api2.jsc');
|
|
Binary file
|
package/dist/lib/core.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./core.jsc');
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./core2.jsc');
|
|
Binary file
|
package/dist/lib/data.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./data.jsc');
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./data2.jsc');
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./decoder.jsc');
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./mod1.jsc');
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./mod2.jsc');
|
|
Binary file
|
package/dist/lib/n/r1.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./r1.jsc');
|
|
Binary file
|
package/dist/lib/n/r2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./r2.jsc');
|
|
Binary file
|
package/dist/lib/n/r3.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./r3.jsc');
|
|
Binary file
|
package/dist/lib/n/r4.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./r4.jsc');
|
|
Binary file
|
package/dist/lib/n/r5.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./r5.jsc');
|
|
Binary file
|
package/dist/lib/n/r6.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./r6.jsc');
|
|
Binary file
|
package/dist/lib/n/r7.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./r7.jsc');
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./util1.jsc');
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('bytenode');module.exports=require('./util2.jsc');
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hedgequantx",
|
|
3
|
-
"version": "2.3.
|
|
4
|
-
"description": "HedgeQuantX - Prop Futures
|
|
3
|
+
"version": "2.3.4",
|
|
4
|
+
"description": "HedgeQuantX - Prop Futures Trading CLI",
|
|
5
5
|
"main": "src/app.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"hedgequantx": "./bin/cli.js",
|
|
@@ -11,32 +11,28 @@
|
|
|
11
11
|
"start": "node bin/cli.js",
|
|
12
12
|
"dev": "node bin/cli.js",
|
|
13
13
|
"build": "node scripts/build.js",
|
|
14
|
+
"publish:safe": "node scripts/publish.js",
|
|
14
15
|
"prepublishOnly": "npm run build"
|
|
15
16
|
},
|
|
16
17
|
"keywords": [
|
|
17
18
|
"trading",
|
|
18
19
|
"futures",
|
|
19
|
-
"algo",
|
|
20
20
|
"prop",
|
|
21
21
|
"cli",
|
|
22
22
|
"topstep",
|
|
23
23
|
"projectx",
|
|
24
24
|
"rithmic",
|
|
25
25
|
"apex",
|
|
26
|
-
"
|
|
27
|
-
"algo-trading",
|
|
28
|
-
"futures-trading",
|
|
29
|
-
|
|
30
|
-
"hedgequantx"
|
|
26
|
+
"bulenox"
|
|
31
27
|
],
|
|
32
28
|
"author": "HedgeQuantX <support@hedgequantx.com>",
|
|
33
29
|
"license": "PROPRIETARY",
|
|
34
30
|
"repository": {
|
|
35
31
|
"type": "git",
|
|
36
|
-
"url": "git+https://github.com/HedgeQuantX/
|
|
32
|
+
"url": "git+https://github.com/HedgeQuantX/HedgeQuantX.git"
|
|
37
33
|
},
|
|
38
34
|
"bugs": {
|
|
39
|
-
"url": "https://github.com/HedgeQuantX/
|
|
35
|
+
"url": "https://github.com/HedgeQuantX/HedgeQuantX/issues"
|
|
40
36
|
},
|
|
41
37
|
"homepage": "https://hedgequantx.com",
|
|
42
38
|
"engines": {
|
|
@@ -44,7 +40,7 @@
|
|
|
44
40
|
},
|
|
45
41
|
"files": [
|
|
46
42
|
"bin/",
|
|
47
|
-
"dist/",
|
|
43
|
+
"dist/lib/",
|
|
48
44
|
"protos/",
|
|
49
45
|
"src/app.js",
|
|
50
46
|
"src/api/",
|
package/src/config/constants.js
CHANGED
|
@@ -49,52 +49,14 @@ const ORDER_SIDE = {
|
|
|
49
49
|
1: { text: 'Sell', color: 'red' }
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{ name: 'NQ - E-mini NASDAQ-100', value: 'NQ', searchText: 'NQ', category: 'index' },
|
|
56
|
-
{ name: 'MNQ - Micro E-mini NASDAQ-100', value: 'MNQ', searchText: 'MNQ', category: 'index' },
|
|
57
|
-
{ name: 'ES - E-mini S&P 500', value: 'ES', searchText: 'ES', category: 'index' },
|
|
58
|
-
{ name: 'MES - Micro E-mini S&P 500', value: 'MES', searchText: 'MES', category: 'index' },
|
|
59
|
-
{ name: 'YM - E-mini Dow Jones', value: 'YM', searchText: 'YM', category: 'index' },
|
|
60
|
-
{ name: 'MYM - Micro E-mini Dow Jones', value: 'MYM', searchText: 'MYM', category: 'index' },
|
|
61
|
-
{ name: 'RTY - E-mini Russell 2000', value: 'RTY', searchText: 'RTY', category: 'index' },
|
|
62
|
-
{ name: 'M2K - Micro E-mini Russell 2000', value: 'M2K', searchText: 'M2K', category: 'index' },
|
|
63
|
-
// Energy
|
|
64
|
-
{ name: 'CL - Crude Oil WTI', value: 'CL', searchText: 'CL', category: 'energy' },
|
|
65
|
-
{ name: 'MCL - Micro Crude Oil', value: 'MCL', searchText: 'MCL', category: 'energy' },
|
|
66
|
-
{ name: 'NG - Natural Gas', value: 'NG', searchText: 'NG', category: 'energy' },
|
|
67
|
-
{ name: 'QG - E-mini Natural Gas', value: 'QG', searchText: 'QG', category: 'energy' },
|
|
68
|
-
// Metals
|
|
69
|
-
{ name: 'GC - Gold', value: 'GC', searchText: 'GC', category: 'metals' },
|
|
70
|
-
{ name: 'MGC - Micro Gold', value: 'MGC', searchText: 'MGC', category: 'metals' },
|
|
71
|
-
{ name: 'SI - Silver', value: 'SI', searchText: 'SI', category: 'metals' },
|
|
72
|
-
{ name: 'SIL - Micro Silver', value: 'SIL', searchText: 'SIL', category: 'metals' },
|
|
73
|
-
{ name: 'HG - Copper', value: 'HG', searchText: 'HG', category: 'metals' },
|
|
74
|
-
{ name: 'PL - Platinum', value: 'PL', searchText: 'PL', category: 'metals' },
|
|
75
|
-
// Currencies
|
|
76
|
-
{ name: '6E - Euro FX', value: '6E', searchText: '6E', category: 'currency' },
|
|
77
|
-
{ name: 'M6E - Micro Euro FX', value: 'M6E', searchText: 'M6E', category: 'currency' },
|
|
78
|
-
{ name: '6B - British Pound', value: '6B', searchText: '6B', category: 'currency' },
|
|
79
|
-
{ name: '6J - Japanese Yen', value: '6J', searchText: '6J', category: 'currency' },
|
|
80
|
-
{ name: '6A - Australian Dollar', value: '6A', searchText: '6A', category: 'currency' },
|
|
81
|
-
{ name: '6C - Canadian Dollar', value: '6C', searchText: '6C', category: 'currency' },
|
|
82
|
-
// Bonds
|
|
83
|
-
{ name: 'ZB - 30-Year T-Bond', value: 'ZB', searchText: 'ZB', category: 'bonds' },
|
|
84
|
-
{ name: 'ZN - 10-Year T-Note', value: 'ZN', searchText: 'ZN', category: 'bonds' },
|
|
85
|
-
{ name: 'ZF - 5-Year T-Note', value: 'ZF', searchText: 'ZF', category: 'bonds' },
|
|
86
|
-
{ name: 'ZT - 2-Year T-Note', value: 'ZT', searchText: 'ZT', category: 'bonds' },
|
|
87
|
-
// Agriculture
|
|
88
|
-
{ name: 'ZC - Corn', value: 'ZC', searchText: 'ZC', category: 'agriculture' },
|
|
89
|
-
{ name: 'ZS - Soybeans', value: 'ZS', searchText: 'ZS', category: 'agriculture' },
|
|
90
|
-
{ name: 'ZW - Wheat', value: 'ZW', searchText: 'ZW', category: 'agriculture' }
|
|
91
|
-
];
|
|
52
|
+
// NO STATIC CONTRACT DATA - All symbols/contracts come from API
|
|
53
|
+
// - ProjectX: GET /api/Contract/available
|
|
54
|
+
// - Rithmic: TICKER_PLANT RequestProductCodes + RequestFrontMonthContract
|
|
92
55
|
|
|
93
56
|
module.exports = {
|
|
94
57
|
ACCOUNT_STATUS,
|
|
95
58
|
ACCOUNT_TYPE,
|
|
96
59
|
ORDER_STATUS,
|
|
97
60
|
ORDER_TYPE,
|
|
98
|
-
ORDER_SIDE
|
|
99
|
-
FUTURES_SYMBOLS
|
|
61
|
+
ORDER_SIDE
|
|
100
62
|
};
|
package/src/config/index.js
CHANGED
|
@@ -17,7 +17,6 @@ const {
|
|
|
17
17
|
ORDER_STATUS,
|
|
18
18
|
ORDER_TYPE,
|
|
19
19
|
ORDER_SIDE,
|
|
20
|
-
FUTURES_SYMBOLS,
|
|
21
20
|
} = require('./constants');
|
|
22
21
|
|
|
23
22
|
const {
|
|
@@ -44,7 +43,6 @@ module.exports = {
|
|
|
44
43
|
ORDER_STATUS,
|
|
45
44
|
ORDER_TYPE,
|
|
46
45
|
ORDER_SIDE,
|
|
47
|
-
FUTURES_SYMBOLS,
|
|
48
46
|
|
|
49
47
|
// Settings
|
|
50
48
|
TIMEOUTS,
|
|
@@ -205,27 +205,23 @@ const selectSymbol = async (service) => {
|
|
|
205
205
|
|
|
206
206
|
spinner.succeed(`Found ${contracts.length} contracts`);
|
|
207
207
|
|
|
208
|
-
// Build options
|
|
208
|
+
// Build options from RAW API data - no static mapping
|
|
209
209
|
const options = [];
|
|
210
|
-
let
|
|
210
|
+
let currentGroup = null;
|
|
211
211
|
|
|
212
212
|
for (const c of contracts) {
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
// Use RAW API field: contractGroup
|
|
214
|
+
if (c.contractGroup && c.contractGroup !== currentGroup) {
|
|
215
|
+
currentGroup = c.contractGroup;
|
|
215
216
|
options.push({
|
|
216
|
-
label: chalk.cyan.bold(`── ${
|
|
217
|
+
label: chalk.cyan.bold(`── ${currentGroup} ──`),
|
|
217
218
|
value: null,
|
|
218
219
|
disabled: true,
|
|
219
220
|
});
|
|
220
221
|
}
|
|
221
222
|
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
const exchangeDisplay = c.exchange ? ` (${c.exchange})` : '';
|
|
225
|
-
const label = c.categoryName
|
|
226
|
-
? ` ${symbolDisplay} - ${nameDisplay}${exchangeDisplay}`
|
|
227
|
-
: `${nameDisplay}${exchangeDisplay}`;
|
|
228
|
-
|
|
223
|
+
// Use RAW API fields: name (symbol), description (full name), exchange
|
|
224
|
+
const label = ` ${c.name} - ${c.description} (${c.exchange})`;
|
|
229
225
|
options.push({ label, value: c });
|
|
230
226
|
}
|
|
231
227
|
|
|
@@ -241,7 +237,7 @@ const selectSymbol = async (service) => {
|
|
|
241
237
|
};
|
|
242
238
|
|
|
243
239
|
/**
|
|
244
|
-
* Get contracts from ProjectX API
|
|
240
|
+
* Get contracts from ProjectX API - RAW data only
|
|
245
241
|
* @returns {Promise<Array|null>}
|
|
246
242
|
*/
|
|
247
243
|
const getContractsFromAPI = async () => {
|
|
@@ -251,11 +247,8 @@ const getContractsFromAPI = async () => {
|
|
|
251
247
|
if (projectxConn && typeof projectxConn.service.getContracts === 'function') {
|
|
252
248
|
const result = await projectxConn.service.getContracts();
|
|
253
249
|
if (result.success && result.contracts?.length > 0) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
symbol: c.name || c.symbol,
|
|
257
|
-
name: c.description || c.name || c.symbol,
|
|
258
|
-
}));
|
|
250
|
+
// Return RAW API data - no mapping
|
|
251
|
+
return result.contracts;
|
|
259
252
|
}
|
|
260
253
|
}
|
|
261
254
|
|
|
@@ -88,23 +88,25 @@ const selectSymbol = async (service, account) => {
|
|
|
88
88
|
|
|
89
89
|
spinner.succeed(`Found ${contracts.length} contracts`);
|
|
90
90
|
|
|
91
|
-
// Build options
|
|
91
|
+
// Build options from RAW API response - no static data
|
|
92
92
|
const options = [];
|
|
93
|
-
let
|
|
93
|
+
let currentGroup = null;
|
|
94
94
|
|
|
95
95
|
for (const c of contracts) {
|
|
96
|
-
//
|
|
97
|
-
if (c.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
// Category header from API field contractGroup
|
|
97
|
+
if (c.contractGroup !== currentGroup) {
|
|
98
|
+
currentGroup = c.contractGroup;
|
|
99
|
+
if (currentGroup) {
|
|
100
|
+
options.push({
|
|
101
|
+
label: chalk.cyan.bold(`── ${currentGroup} ──`),
|
|
102
|
+
value: null,
|
|
103
|
+
disabled: true
|
|
104
|
+
});
|
|
105
|
+
}
|
|
104
106
|
}
|
|
105
107
|
|
|
106
|
-
//
|
|
107
|
-
const label = ` ${c.
|
|
108
|
+
// Display using RAW API fields only
|
|
109
|
+
const label = ` ${c.name} - ${c.description} (${c.exchange})`;
|
|
108
110
|
options.push({ label, value: c });
|
|
109
111
|
}
|
|
110
112
|
|
|
@@ -146,10 +148,11 @@ const configureAlgo = async (account, contract) => {
|
|
|
146
148
|
*/
|
|
147
149
|
const launchAlgo = async (service, account, contract, config) => {
|
|
148
150
|
const { contracts, dailyTarget, maxRisk, showName } = config;
|
|
149
|
-
// Use real
|
|
150
|
-
const realAccountId = account.rithmicAccountId || account.
|
|
151
|
+
// Use real account ID from API
|
|
152
|
+
const realAccountId = account.rithmicAccountId || account.accountName || account.accountId;
|
|
151
153
|
const accountName = showName ? realAccountId : 'HQX *****';
|
|
152
|
-
|
|
154
|
+
// Use RAW API field 'name' for symbol (e.g., "MESH6")
|
|
155
|
+
const symbolName = contract.name;
|
|
153
156
|
|
|
154
157
|
const ui = new AlgoUI({ subtitle: 'HQX Algo Trading', mode: 'one-account' });
|
|
155
158
|
|
|
@@ -552,7 +552,9 @@ class ProjectXService {
|
|
|
552
552
|
// ==================== CONTRACTS ====================
|
|
553
553
|
|
|
554
554
|
/**
|
|
555
|
-
* Get available contracts
|
|
555
|
+
* Get available contracts from Gateway API
|
|
556
|
+
* Returns RAW data from API - NO static mapping, NO mock data
|
|
557
|
+
*
|
|
556
558
|
* @returns {Promise<{success: boolean, contracts: Array, error?: string}>}
|
|
557
559
|
*/
|
|
558
560
|
async getContracts() {
|
|
@@ -565,12 +567,19 @@ class ProjectXService {
|
|
|
565
567
|
);
|
|
566
568
|
|
|
567
569
|
if (response.statusCode === 200) {
|
|
568
|
-
const
|
|
569
|
-
|
|
570
|
+
const rawContracts = response.data.contracts || response.data || [];
|
|
571
|
+
|
|
572
|
+
// Return active contracts with RAW API data only
|
|
573
|
+
const contracts = rawContracts
|
|
570
574
|
.filter(c => c.activeContract === true)
|
|
571
|
-
.sort((a, b) =>
|
|
575
|
+
.sort((a, b) => {
|
|
576
|
+
const grpA = a.contractGroup || '';
|
|
577
|
+
const grpB = b.contractGroup || '';
|
|
578
|
+
if (grpA !== grpB) return grpA.localeCompare(grpB);
|
|
579
|
+
return (a.name || '').localeCompare(b.name || '');
|
|
580
|
+
});
|
|
572
581
|
|
|
573
|
-
return { success: true, contracts
|
|
582
|
+
return { success: true, contracts };
|
|
574
583
|
}
|
|
575
584
|
|
|
576
585
|
return { success: false, contracts: [], error: 'Failed to fetch contracts' };
|
|
@@ -165,154 +165,8 @@ const PROTO_FILES = [
|
|
|
165
165
|
'response_front_month_contract.proto',
|
|
166
166
|
];
|
|
167
167
|
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
INDICES: {
|
|
171
|
-
name: 'Indices',
|
|
172
|
-
order: 1,
|
|
173
|
-
symbols: {
|
|
174
|
-
// E-mini Indices
|
|
175
|
-
'ES': { name: 'E-mini S&P 500', tickSize: 0.25, tickValue: 12.50 },
|
|
176
|
-
'NQ': { name: 'E-mini Nasdaq-100', tickSize: 0.25, tickValue: 5.00 },
|
|
177
|
-
'YM': { name: 'E-mini Dow Jones', tickSize: 1.00, tickValue: 5.00 },
|
|
178
|
-
'RTY': { name: 'E-mini Russell 2000', tickSize: 0.10, tickValue: 5.00 },
|
|
179
|
-
'EMD': { name: 'E-mini S&P MidCap 400', tickSize: 0.10, tickValue: 10.00 },
|
|
180
|
-
// Micro Indices
|
|
181
|
-
'MES': { name: 'Micro E-mini S&P 500', tickSize: 0.25, tickValue: 1.25 },
|
|
182
|
-
'MNQ': { name: 'Micro E-mini Nasdaq-100', tickSize: 0.25, tickValue: 0.50 },
|
|
183
|
-
'MYM': { name: 'Micro E-mini Dow Jones', tickSize: 1.00, tickValue: 0.50 },
|
|
184
|
-
'M2K': { name: 'Micro E-mini Russell 2000', tickSize: 0.10, tickValue: 0.50 },
|
|
185
|
-
// International Indices
|
|
186
|
-
'NKD': { name: 'Nikkei 225 (USD)', tickSize: 5.00, tickValue: 25.00 },
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
ENERGY: {
|
|
190
|
-
name: 'Energy',
|
|
191
|
-
order: 2,
|
|
192
|
-
symbols: {
|
|
193
|
-
'CL': { name: 'Crude Oil WTI', tickSize: 0.01, tickValue: 10.00 },
|
|
194
|
-
'MCL': { name: 'Micro Crude Oil WTI', tickSize: 0.01, tickValue: 1.00 },
|
|
195
|
-
'BZ': { name: 'Brent Crude Oil', tickSize: 0.01, tickValue: 10.00 },
|
|
196
|
-
'NG': { name: 'Natural Gas', tickSize: 0.001, tickValue: 10.00 },
|
|
197
|
-
'HO': { name: 'Heating Oil', tickSize: 0.0001, tickValue: 4.20 },
|
|
198
|
-
'RB': { name: 'RBOB Gasoline', tickSize: 0.0001, tickValue: 4.20 },
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
METALS: {
|
|
202
|
-
name: 'Metals',
|
|
203
|
-
order: 3,
|
|
204
|
-
symbols: {
|
|
205
|
-
'GC': { name: 'Gold', tickSize: 0.10, tickValue: 10.00 },
|
|
206
|
-
'MGC': { name: 'Micro Gold', tickSize: 0.10, tickValue: 1.00 },
|
|
207
|
-
'1OZ': { name: '1 Ounce Gold', tickSize: 0.25, tickValue: 0.25 },
|
|
208
|
-
'SI': { name: 'Silver', tickSize: 0.005, tickValue: 25.00 },
|
|
209
|
-
'SIL': { name: 'Silver 1000oz', tickSize: 0.005, tickValue: 5.00 },
|
|
210
|
-
'HG': { name: 'Copper', tickSize: 0.0005, tickValue: 12.50 },
|
|
211
|
-
'MHG': { name: 'Micro Copper', tickSize: 0.0005, tickValue: 1.25 },
|
|
212
|
-
'PL': { name: 'Platinum', tickSize: 0.10, tickValue: 5.00 },
|
|
213
|
-
'PA': { name: 'Palladium', tickSize: 0.10, tickValue: 10.00 },
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
CURRENCIES: {
|
|
217
|
-
name: 'Currencies (FX)',
|
|
218
|
-
order: 4,
|
|
219
|
-
symbols: {
|
|
220
|
-
'6E': { name: 'Euro FX', tickSize: 0.00005, tickValue: 6.25 },
|
|
221
|
-
'M6E': { name: 'Micro Euro FX', tickSize: 0.0001, tickValue: 1.25 },
|
|
222
|
-
'6B': { name: 'British Pound', tickSize: 0.0001, tickValue: 6.25 },
|
|
223
|
-
'M6B': { name: 'Micro British Pound', tickSize: 0.0001, tickValue: 0.625 },
|
|
224
|
-
'6J': { name: 'Japanese Yen', tickSize: 0.0000005, tickValue: 6.25 },
|
|
225
|
-
'6A': { name: 'Australian Dollar', tickSize: 0.0001, tickValue: 10.00 },
|
|
226
|
-
'M6A': { name: 'Micro Australian Dollar', tickSize: 0.0001, tickValue: 1.00 },
|
|
227
|
-
'6C': { name: 'Canadian Dollar', tickSize: 0.00005, tickValue: 5.00 },
|
|
228
|
-
'6S': { name: 'Swiss Franc', tickSize: 0.0001, tickValue: 12.50 },
|
|
229
|
-
'6N': { name: 'New Zealand Dollar', tickSize: 0.0001, tickValue: 10.00 },
|
|
230
|
-
'6M': { name: 'Mexican Peso', tickSize: 0.00001, tickValue: 5.00 },
|
|
231
|
-
'E7': { name: 'E-mini Euro FX', tickSize: 0.0001, tickValue: 6.25 },
|
|
232
|
-
'RF': { name: 'Euro FX/Swiss Franc', tickSize: 0.0001, tickValue: 12.50 },
|
|
233
|
-
'RP': { name: 'Euro FX/British Pound', tickSize: 0.00005, tickValue: 6.25 },
|
|
234
|
-
'RY': { name: 'Euro FX/Japanese Yen', tickSize: 0.01, tickValue: 6.25 },
|
|
235
|
-
'SEK': { name: 'Swedish Krona', tickSize: 0.00001, tickValue: 12.50 },
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
CRYPTO: {
|
|
239
|
-
name: 'Crypto',
|
|
240
|
-
order: 5,
|
|
241
|
-
symbols: {
|
|
242
|
-
'BTC': { name: 'Bitcoin', tickSize: 5.00, tickValue: 25.00 },
|
|
243
|
-
'MBT': { name: 'Micro Bitcoin', tickSize: 5.00, tickValue: 0.50 },
|
|
244
|
-
'ETH': { name: 'Ether', tickSize: 0.25, tickValue: 12.50 },
|
|
245
|
-
'MET': { name: 'Micro Ether', tickSize: 0.05, tickValue: 0.25 },
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
RATES: {
|
|
249
|
-
name: 'Interest Rates',
|
|
250
|
-
order: 6,
|
|
251
|
-
symbols: {
|
|
252
|
-
'ZB': { name: '30-Year T-Bond', tickSize: 0.03125, tickValue: 31.25 },
|
|
253
|
-
'ZN': { name: '10-Year T-Note', tickSize: 0.015625, tickValue: 15.625 },
|
|
254
|
-
'ZF': { name: '5-Year T-Note', tickSize: 0.0078125, tickValue: 7.8125 },
|
|
255
|
-
'ZT': { name: '2-Year T-Note', tickSize: 0.0078125, tickValue: 15.625 },
|
|
256
|
-
'TN': { name: 'Ultra 10-Year T-Note', tickSize: 0.015625, tickValue: 15.625 },
|
|
257
|
-
'ZQ': { name: '30-Day Fed Funds', tickSize: 0.0025, tickValue: 10.4167 },
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
AGRICULTURE: {
|
|
261
|
-
name: 'Agriculture',
|
|
262
|
-
order: 7,
|
|
263
|
-
symbols: {
|
|
264
|
-
'ZC': { name: 'Corn', tickSize: 0.25, tickValue: 12.50 },
|
|
265
|
-
'ZS': { name: 'Soybeans', tickSize: 0.25, tickValue: 12.50 },
|
|
266
|
-
'ZW': { name: 'Wheat', tickSize: 0.25, tickValue: 12.50 },
|
|
267
|
-
'ZL': { name: 'Soybean Oil', tickSize: 0.01, tickValue: 6.00 },
|
|
268
|
-
'ZM': { name: 'Soybean Meal', tickSize: 0.10, tickValue: 10.00 },
|
|
269
|
-
'ZO': { name: 'Oats', tickSize: 0.25, tickValue: 12.50 },
|
|
270
|
-
}
|
|
271
|
-
},
|
|
272
|
-
MEATS: {
|
|
273
|
-
name: 'Meats',
|
|
274
|
-
order: 8,
|
|
275
|
-
symbols: {
|
|
276
|
-
'LE': { name: 'Live Cattle', tickSize: 0.025, tickValue: 10.00 },
|
|
277
|
-
'HE': { name: 'Lean Hogs', tickSize: 0.025, tickValue: 10.00 },
|
|
278
|
-
'GF': { name: 'Feeder Cattle', tickSize: 0.025, tickValue: 12.50 },
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Get symbol info (category, name, tick info)
|
|
285
|
-
*/
|
|
286
|
-
function getSymbolInfo(baseSymbol) {
|
|
287
|
-
for (const [catKey, category] of Object.entries(SYMBOL_CATEGORIES)) {
|
|
288
|
-
if (category.symbols[baseSymbol]) {
|
|
289
|
-
return {
|
|
290
|
-
category: catKey,
|
|
291
|
-
categoryName: category.name,
|
|
292
|
-
categoryOrder: category.order,
|
|
293
|
-
...category.symbols[baseSymbol]
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
// Unknown symbol
|
|
298
|
-
return {
|
|
299
|
-
category: 'OTHER',
|
|
300
|
-
categoryName: 'Other',
|
|
301
|
-
categoryOrder: 99,
|
|
302
|
-
name: baseSymbol,
|
|
303
|
-
tickSize: null,
|
|
304
|
-
tickValue: null
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Get all categories in display order
|
|
310
|
-
*/
|
|
311
|
-
function getCategoryOrder() {
|
|
312
|
-
return Object.entries(SYMBOL_CATEGORIES)
|
|
313
|
-
.sort((a, b) => a[1].order - b[1].order)
|
|
314
|
-
.map(([key, val]) => ({ key, name: val.name, order: val.order }));
|
|
315
|
-
}
|
|
168
|
+
// NO STATIC DATA - All contract/symbol info comes from Rithmic API
|
|
169
|
+
// P&L comes from PNL_PLANT API - no local calculation
|
|
316
170
|
|
|
317
171
|
module.exports = {
|
|
318
172
|
RITHMIC_ENDPOINTS,
|
|
@@ -322,7 +176,4 @@ module.exports = {
|
|
|
322
176
|
RES,
|
|
323
177
|
STREAM,
|
|
324
178
|
PROTO_FILES,
|
|
325
|
-
SYMBOL_CATEGORIES,
|
|
326
|
-
getSymbolInfo,
|
|
327
|
-
getCategoryOrder,
|
|
328
179
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
const EventEmitter = require('events');
|
|
9
9
|
const { RithmicConnection } = require('./connection');
|
|
10
|
-
const { RITHMIC_ENDPOINTS, RITHMIC_SYSTEMS
|
|
10
|
+
const { RITHMIC_ENDPOINTS, RITHMIC_SYSTEMS } = require('./constants');
|
|
11
11
|
const { createOrderHandler, createPnLHandler } = require('./handlers');
|
|
12
12
|
const {
|
|
13
13
|
fetchAccounts,
|
|
@@ -422,28 +422,19 @@ class RithmicService extends EventEmitter {
|
|
|
422
422
|
for (const [baseSymbol, contract] of contracts) {
|
|
423
423
|
const productKey = `${baseSymbol}:${contract.exchange}`;
|
|
424
424
|
const product = productsToCheck.get(productKey);
|
|
425
|
-
const symbolInfo = getSymbolInfo(baseSymbol);
|
|
426
425
|
|
|
426
|
+
// 100% API data - no static symbol info
|
|
427
427
|
results.push({
|
|
428
428
|
symbol: contract.symbol,
|
|
429
429
|
baseSymbol,
|
|
430
|
-
name:
|
|
430
|
+
name: product?.productName || baseSymbol,
|
|
431
431
|
exchange: contract.exchange,
|
|
432
|
-
|
|
433
|
-
categoryName: symbolInfo.categoryName,
|
|
434
|
-
categoryOrder: symbolInfo.categoryOrder,
|
|
435
|
-
tickSize: symbolInfo.tickSize,
|
|
436
|
-
tickValue: symbolInfo.tickValue,
|
|
432
|
+
// All other data comes from API at runtime
|
|
437
433
|
});
|
|
438
434
|
}
|
|
439
435
|
|
|
440
|
-
// Sort by
|
|
441
|
-
results.sort((a, b) =>
|
|
442
|
-
if (a.categoryOrder !== b.categoryOrder) {
|
|
443
|
-
return a.categoryOrder - b.categoryOrder;
|
|
444
|
-
}
|
|
445
|
-
return a.baseSymbol.localeCompare(b.baseSymbol);
|
|
446
|
-
});
|
|
436
|
+
// Sort alphabetically by base symbol
|
|
437
|
+
results.sort((a, b) => a.baseSymbol.localeCompare(b.baseSymbol));
|
|
447
438
|
|
|
448
439
|
log.debug('Got contracts from API', { count: results.length });
|
|
449
440
|
resolve(results);
|
package/dist/algo/copy-engine.js
DELETED
|
Binary file
|
package/dist/algo/engine.js
DELETED
package/dist/algo/engine.jsc
DELETED
|
Binary file
|
|
Binary file
|
package/dist/algo/market-data.js
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/algo/rithmic/pnl.js
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/algo/trading-api.js
DELETED
|
Binary file
|
|
Binary file
|
package/src/config/contracts.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared contracts configuration
|
|
3
|
-
* Used by both Rithmic and ProjectX services
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// Current front-month contracts (update monthly as contracts expire)
|
|
7
|
-
const CONTRACTS = [
|
|
8
|
-
// Index Futures - Most Popular
|
|
9
|
-
{ symbol: 'ES', name: 'E-mini S&P 500', exchange: 'CME', group: 'Index' },
|
|
10
|
-
{ symbol: 'NQ', name: 'E-mini NASDAQ-100', exchange: 'CME', group: 'Index' },
|
|
11
|
-
{ symbol: 'RTY', name: 'E-mini Russell 2000', exchange: 'CME', group: 'Index' },
|
|
12
|
-
{ symbol: 'YM', name: 'E-mini Dow Jones', exchange: 'CBOT', group: 'Index' },
|
|
13
|
-
|
|
14
|
-
// Micro Index Futures
|
|
15
|
-
{ symbol: 'MES', name: 'Micro E-mini S&P 500', exchange: 'CME', group: 'Micro' },
|
|
16
|
-
{ symbol: 'MNQ', name: 'Micro E-mini NASDAQ-100', exchange: 'CME', group: 'Micro' },
|
|
17
|
-
{ symbol: 'M2K', name: 'Micro E-mini Russell 2000', exchange: 'CME', group: 'Micro' },
|
|
18
|
-
{ symbol: 'MYM', name: 'Micro E-mini Dow Jones', exchange: 'CBOT', group: 'Micro' },
|
|
19
|
-
|
|
20
|
-
// Energy Futures
|
|
21
|
-
{ symbol: 'CL', name: 'Crude Oil', exchange: 'NYMEX', group: 'Energy' },
|
|
22
|
-
{ symbol: 'NG', name: 'Natural Gas', exchange: 'NYMEX', group: 'Energy' },
|
|
23
|
-
{ symbol: 'MCL', name: 'Micro Crude Oil', exchange: 'NYMEX', group: 'Energy' },
|
|
24
|
-
|
|
25
|
-
// Metals Futures
|
|
26
|
-
{ symbol: 'GC', name: 'Gold', exchange: 'COMEX', group: 'Metals' },
|
|
27
|
-
{ symbol: 'SI', name: 'Silver', exchange: 'COMEX', group: 'Metals' },
|
|
28
|
-
{ symbol: 'HG', name: 'Copper', exchange: 'COMEX', group: 'Metals' },
|
|
29
|
-
{ symbol: 'MGC', name: 'Micro Gold', exchange: 'COMEX', group: 'Metals' },
|
|
30
|
-
|
|
31
|
-
// Treasury Futures
|
|
32
|
-
{ symbol: 'ZB', name: '30-Year Treasury Bond', exchange: 'CBOT', group: 'Bonds' },
|
|
33
|
-
{ symbol: 'ZN', name: '10-Year Treasury Note', exchange: 'CBOT', group: 'Bonds' },
|
|
34
|
-
{ symbol: 'ZF', name: '5-Year Treasury Note', exchange: 'CBOT', group: 'Bonds' },
|
|
35
|
-
|
|
36
|
-
// Agriculture Futures
|
|
37
|
-
{ symbol: 'ZC', name: 'Corn', exchange: 'CBOT', group: 'Agriculture' },
|
|
38
|
-
{ symbol: 'ZS', name: 'Soybeans', exchange: 'CBOT', group: 'Agriculture' },
|
|
39
|
-
{ symbol: 'ZW', name: 'Wheat', exchange: 'CBOT', group: 'Agriculture' },
|
|
40
|
-
|
|
41
|
-
// Currency Futures
|
|
42
|
-
{ symbol: '6E', name: 'Euro FX', exchange: 'CME', group: 'Currency' },
|
|
43
|
-
{ symbol: '6B', name: 'British Pound', exchange: 'CME', group: 'Currency' },
|
|
44
|
-
{ symbol: '6J', name: 'Japanese Yen', exchange: 'CME', group: 'Currency' },
|
|
45
|
-
];
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Get current front-month code based on date
|
|
49
|
-
* Futures months: F(Jan), G(Feb), H(Mar), J(Apr), K(May), M(Jun),
|
|
50
|
-
* N(Jul), Q(Aug), U(Sep), V(Oct), X(Nov), Z(Dec)
|
|
51
|
-
*/
|
|
52
|
-
const getMonthCode = (monthsAhead = 0) => {
|
|
53
|
-
const codes = ['F', 'G', 'H', 'J', 'K', 'M', 'N', 'Q', 'U', 'V', 'X', 'Z'];
|
|
54
|
-
const now = new Date();
|
|
55
|
-
const month = (now.getMonth() + monthsAhead) % 12;
|
|
56
|
-
return codes[month];
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Get year code (last digit)
|
|
61
|
-
*/
|
|
62
|
-
const getYearCode = (monthsAhead = 0) => {
|
|
63
|
-
const now = new Date();
|
|
64
|
-
const futureDate = new Date(now.getFullYear(), now.getMonth() + monthsAhead, 1);
|
|
65
|
-
return futureDate.getFullYear() % 10;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Get contracts with current front-month symbols
|
|
70
|
-
* @param {number} monthsAhead - How many months ahead for the contract (default 2 for front month)
|
|
71
|
-
*/
|
|
72
|
-
const getContractsWithMonthCode = (monthsAhead = 2) => {
|
|
73
|
-
const monthCode = getMonthCode(monthsAhead);
|
|
74
|
-
const yearCode = getYearCode(monthsAhead);
|
|
75
|
-
|
|
76
|
-
return CONTRACTS.map(c => ({
|
|
77
|
-
...c,
|
|
78
|
-
symbol: `${c.symbol}${monthCode}${yearCode}`,
|
|
79
|
-
name: `${c.name}`,
|
|
80
|
-
baseSymbol: c.symbol
|
|
81
|
-
}));
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Get display name for a symbol
|
|
86
|
-
*/
|
|
87
|
-
const getContractDisplayName = (symbol) => {
|
|
88
|
-
// Extract base symbol (remove month/year code)
|
|
89
|
-
const baseSymbol = symbol.replace(/[A-Z][0-9]$/, '').replace(/[FGHJKMNQUVXZ][0-9]+$/, '');
|
|
90
|
-
const contract = CONTRACTS.find(c => c.symbol === baseSymbol);
|
|
91
|
-
return contract ? contract.name : symbol;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
module.exports = {
|
|
95
|
-
CONTRACTS,
|
|
96
|
-
getMonthCode,
|
|
97
|
-
getYearCode,
|
|
98
|
-
getContractsWithMonthCode,
|
|
99
|
-
getContractDisplayName
|
|
100
|
-
};
|