hedgequantx 2.6.6 → 2.6.8
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/index.js +17 -1
package/package.json
CHANGED
package/src/pages/algo/index.js
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
const chalk = require('chalk');
|
|
6
|
-
const { getLogoWidth, drawBoxHeaderContinue, drawBoxFooter, displayBanner } = require('../../ui');
|
|
6
|
+
const { getLogoWidth, drawBoxHeaderContinue, drawBoxFooter, displayBanner, prepareStdin } = require('../../ui');
|
|
7
7
|
const { prompts } = require('../../utils');
|
|
8
|
+
const { checkMarketHours } = require('../../services/projectx/market');
|
|
8
9
|
|
|
9
10
|
const { oneAccountMenu } = require('./one-account');
|
|
10
11
|
const { copyTradingMenu } = require('./copy-trading');
|
|
@@ -13,6 +14,21 @@ const { copyTradingMenu } = require('./copy-trading');
|
|
|
13
14
|
* Algo Trading Menu - Simplified
|
|
14
15
|
*/
|
|
15
16
|
const algoTradingMenu = async (service) => {
|
|
17
|
+
// Ensure stdin is ready
|
|
18
|
+
prepareStdin();
|
|
19
|
+
|
|
20
|
+
// Check market hours first - block if closed
|
|
21
|
+
const market = checkMarketHours();
|
|
22
|
+
if (!market.isOpen) {
|
|
23
|
+
console.log();
|
|
24
|
+
console.log(chalk.red(` MARKET CLOSED`));
|
|
25
|
+
console.log(chalk.gray(` ${market.message}`));
|
|
26
|
+
console.log(chalk.gray(' ALGO TRADING UNAVAILABLE'));
|
|
27
|
+
console.log();
|
|
28
|
+
await prompts.waitForEnter();
|
|
29
|
+
return 'back';
|
|
30
|
+
}
|
|
31
|
+
|
|
16
32
|
const boxWidth = getLogoWidth();
|
|
17
33
|
const W = boxWidth - 2;
|
|
18
34
|
|