hedgequantx 1.2.100 → 1.2.101
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/pages/algo.js +31 -9
package/package.json
CHANGED
package/src/pages/algo.js
CHANGED
|
@@ -159,25 +159,47 @@ const selectSymbolMenu = async (service, account) => {
|
|
|
159
159
|
|
|
160
160
|
let availableSymbols = [];
|
|
161
161
|
|
|
162
|
-
// Search for common symbols to get available contracts
|
|
163
|
-
const commonSearches = [
|
|
162
|
+
// Search for common symbols to get available contracts (including micros)
|
|
163
|
+
const commonSearches = [
|
|
164
|
+
'NQ', 'MNQ', // NASDAQ
|
|
165
|
+
'ES', 'MES', // S&P 500
|
|
166
|
+
'YM', 'MYM', // Dow Jones
|
|
167
|
+
'RTY', 'M2K', // Russell 2000
|
|
168
|
+
'CL', 'MCL', 'QM', // Crude Oil
|
|
169
|
+
'GC', 'MGC', // Gold
|
|
170
|
+
'SI', 'SIL', // Silver
|
|
171
|
+
'6E', 'M6E', // Euro FX
|
|
172
|
+
'6B', '6J', '6A', '6C', // Other currencies
|
|
173
|
+
'ZB', 'ZN', 'ZF', 'ZT', // Treasuries
|
|
174
|
+
'NG', 'QG', // Natural Gas
|
|
175
|
+
'HG', 'PL' // Copper, Platinum
|
|
176
|
+
];
|
|
164
177
|
|
|
165
178
|
try {
|
|
166
179
|
for (const search of commonSearches) {
|
|
167
180
|
const result = await service.searchContracts(search, false);
|
|
168
181
|
if (result.success && result.contracts && result.contracts.length > 0) {
|
|
169
182
|
for (const contract of result.contracts) {
|
|
170
|
-
// Only add
|
|
171
|
-
if (contract.
|
|
172
|
-
const
|
|
183
|
+
// Only add contracts that have valid data
|
|
184
|
+
if (contract.id || contract.contractId || contract.name) {
|
|
185
|
+
const contractId = contract.id || contract.contractId;
|
|
186
|
+
const existing = availableSymbols.find(s => s.id === contractId);
|
|
173
187
|
if (!existing) {
|
|
188
|
+
// Extract symbol from name if not provided (e.g., "NQH6" from "CON.F.US.ENQ.H26")
|
|
189
|
+
let symbolCode = contract.symbol || search;
|
|
190
|
+
if (contract.name && contract.name.includes(' ')) {
|
|
191
|
+
// Try to extract from name like "E-mini NASDAQ-100 Mar 2026"
|
|
192
|
+
symbolCode = search;
|
|
193
|
+
}
|
|
194
|
+
|
|
174
195
|
availableSymbols.push({
|
|
175
|
-
id:
|
|
176
|
-
name: contract.name || contract.symbol,
|
|
177
|
-
symbol:
|
|
196
|
+
id: contractId,
|
|
197
|
+
name: contract.name || contract.symbol || search,
|
|
198
|
+
symbol: symbolCode,
|
|
178
199
|
tickSize: contract.tickSize,
|
|
179
200
|
tickValue: contract.tickValue,
|
|
180
|
-
exchange: contract.exchange || 'CME'
|
|
201
|
+
exchange: contract.exchange || 'CME',
|
|
202
|
+
activeContract: contract.activeContract || false
|
|
181
203
|
});
|
|
182
204
|
}
|
|
183
205
|
}
|