hedgequantx 1.8.28 → 1.8.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -100,8 +100,18 @@ const copyTradingMenu = async () => {
|
|
|
100
100
|
// Step 3: Select Trading Symbol
|
|
101
101
|
console.log();
|
|
102
102
|
console.log(chalk.cyan(' Step 3: Select Trading Symbol'));
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
let symbol;
|
|
104
|
+
try {
|
|
105
|
+
symbol = await selectSymbol(lead.service, 'Trading');
|
|
106
|
+
} catch (err) {
|
|
107
|
+
console.log(chalk.red(` Error selecting symbol: ${err.message}`));
|
|
108
|
+
await prompts.waitForEnter();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (!symbol) {
|
|
112
|
+
log.debug('No symbol selected');
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
105
115
|
|
|
106
116
|
// Step 4: Configure parameters
|
|
107
117
|
console.log();
|
|
@@ -173,9 +183,9 @@ const getContractsFromAPI = async () => {
|
|
|
173
183
|
* Symbol selection helper - uses API contracts for all services
|
|
174
184
|
*/
|
|
175
185
|
const selectSymbol = async (service, label) => {
|
|
186
|
+
const spinner = ora({ text: 'Loading symbols...', color: 'yellow' }).start();
|
|
187
|
+
|
|
176
188
|
try {
|
|
177
|
-
const spinner = ora({ text: 'Loading symbols...', color: 'yellow' }).start();
|
|
178
|
-
|
|
179
189
|
// Always use contracts from ProjectX API for consistency
|
|
180
190
|
let contracts = await getContractsFromAPI();
|
|
181
191
|
|
|
@@ -189,6 +199,7 @@ const selectSymbol = async (service, label) => {
|
|
|
189
199
|
|
|
190
200
|
if (!contracts || contracts.length === 0) {
|
|
191
201
|
spinner.fail('No contracts available');
|
|
202
|
+
await prompts.waitForEnter();
|
|
192
203
|
return null;
|
|
193
204
|
}
|
|
194
205
|
|
|
@@ -212,7 +223,8 @@ const selectSymbol = async (service, label) => {
|
|
|
212
223
|
|
|
213
224
|
return await prompts.selectOption(`${label} Symbol:`, options);
|
|
214
225
|
} catch (e) {
|
|
215
|
-
|
|
226
|
+
spinner.fail(`Error loading contracts: ${e.message}`);
|
|
227
|
+
await prompts.waitForEnter();
|
|
216
228
|
return null;
|
|
217
229
|
}
|
|
218
230
|
};
|