hedgequantx 2.6.19 → 2.6.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/package.json
CHANGED
|
@@ -788,10 +788,18 @@ const selectSymbol = async (service) => {
|
|
|
788
788
|
return (a.name || '').localeCompare(b.name || '');
|
|
789
789
|
});
|
|
790
790
|
|
|
791
|
-
const options = contracts.slice(0, 30).map(c =>
|
|
792
|
-
label
|
|
793
|
-
|
|
794
|
-
|
|
791
|
+
const options = contracts.slice(0, 30).map(c => {
|
|
792
|
+
let label;
|
|
793
|
+
if (c.description) {
|
|
794
|
+
// ProjectX format
|
|
795
|
+
label = `${c.name} - ${c.description} (${c.exchange || 'CME'})`;
|
|
796
|
+
} else {
|
|
797
|
+
// Rithmic format
|
|
798
|
+
const name = c.name || c.baseSymbol || c.symbol;
|
|
799
|
+
label = `${c.symbol || name} (${c.exchange || 'CME'})`;
|
|
800
|
+
}
|
|
801
|
+
return { label, value: c };
|
|
802
|
+
});
|
|
795
803
|
|
|
796
804
|
options.push({ label: chalk.gray('< CANCEL'), value: null });
|
|
797
805
|
|
|
@@ -120,10 +120,21 @@ const selectSymbol = async (service, account) => {
|
|
|
120
120
|
spinner.succeed(`FOUND ${contracts.length} CONTRACTS`);
|
|
121
121
|
|
|
122
122
|
// Display sorted contracts from API
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
// ProjectX has: name + description
|
|
124
|
+
// Rithmic has: name (or baseSymbol) + exchange
|
|
125
|
+
const options = contracts.map(c => {
|
|
126
|
+
let label;
|
|
127
|
+
if (c.description) {
|
|
128
|
+
// ProjectX format
|
|
129
|
+
label = `${c.name} - ${c.description}`;
|
|
130
|
+
} else {
|
|
131
|
+
// Rithmic format
|
|
132
|
+
const name = c.name || c.baseSymbol || c.symbol;
|
|
133
|
+
const exchange = c.exchange ? ` (${c.exchange})` : '';
|
|
134
|
+
label = `${c.symbol || name}${exchange}`;
|
|
135
|
+
}
|
|
136
|
+
return { label, value: c };
|
|
137
|
+
});
|
|
127
138
|
|
|
128
139
|
options.push({ label: chalk.gray('< BACK'), value: 'back' });
|
|
129
140
|
|