hedgequantx 2.9.99 → 2.9.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/one-account.js +22 -16
package/package.json
CHANGED
|
@@ -87,6 +87,9 @@ const oneAccountMenu = async (service) => {
|
|
|
87
87
|
selectedAccount = matchingAccount;
|
|
88
88
|
accountService = selectedAccount.service || connections.getServiceForAccount(selectedAccount.accountId) || service;
|
|
89
89
|
|
|
90
|
+
// Show spinner while loading
|
|
91
|
+
const loadSpinner = ora({ text: 'Loading configuration...', color: 'yellow' }).start();
|
|
92
|
+
|
|
90
93
|
// Load contracts to find the saved symbol (match by baseSymbol first, then exact symbol)
|
|
91
94
|
const contractsResult = await accountService.getContracts();
|
|
92
95
|
if (contractsResult.success && contractsResult.contracts.length > 0) {
|
|
@@ -105,23 +108,26 @@ const oneAccountMenu = async (service) => {
|
|
|
105
108
|
contract = contractsResult.contracts.find(c => c.baseSymbol === extractedBase);
|
|
106
109
|
}
|
|
107
110
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
111
|
+
|
|
112
|
+
// Find strategy
|
|
113
|
+
const strategies = getAvailableStrategies();
|
|
114
|
+
strategy = strategies.find(s => s.id === lastConfig.strategyId);
|
|
115
|
+
|
|
116
|
+
// Restore config
|
|
117
|
+
if (contract && strategy) {
|
|
118
|
+
config = {
|
|
119
|
+
contracts: lastConfig.contracts,
|
|
120
|
+
dailyTarget: lastConfig.dailyTarget,
|
|
121
|
+
maxRisk: lastConfig.maxRisk,
|
|
122
|
+
showName: lastConfig.showName
|
|
123
|
+
};
|
|
124
|
+
loadSpinner.succeed('Configuration loaded');
|
|
125
|
+
} else {
|
|
126
|
+
loadSpinner.fail('Symbol or strategy no longer available, please reconfigure');
|
|
127
|
+
selectedAccount = null;
|
|
128
|
+
}
|
|
123
129
|
} else {
|
|
124
|
-
|
|
130
|
+
loadSpinner.fail('Failed to load contracts');
|
|
125
131
|
selectedAccount = null;
|
|
126
132
|
}
|
|
127
133
|
}
|