hedgequantx 2.6.5 → 2.6.7

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "2.6.5",
3
+ "version": "2.6.7",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -5,6 +5,7 @@
5
5
  const chalk = require('chalk');
6
6
  const { getLogoWidth, drawBoxHeaderContinue, drawBoxFooter, displayBanner } = 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,18 @@ const { copyTradingMenu } = require('./copy-trading');
13
14
  * Algo Trading Menu - Simplified
14
15
  */
15
16
  const algoTradingMenu = async (service) => {
17
+ // Check market hours first - block if closed
18
+ const market = checkMarketHours();
19
+ if (!market.isOpen) {
20
+ console.log();
21
+ console.log(chalk.red(` MARKET CLOSED`));
22
+ console.log(chalk.gray(` ${market.message}`));
23
+ console.log(chalk.gray(' ALGO TRADING UNAVAILABLE'));
24
+ console.log();
25
+ await prompts.waitForEnter();
26
+ return 'back';
27
+ }
28
+
16
29
  const boxWidth = getLogoWidth();
17
30
  const W = boxWidth - 2;
18
31
 
@@ -26,7 +39,12 @@ const algoTradingMenu = async (service) => {
26
39
  displayBanner();
27
40
  drawBoxHeaderContinue('ALGO TRADING', boxWidth);
28
41
 
29
- console.log(makeLine(chalk.white('[1] ONE ACCOUNT [2] COPY TRADING')));
42
+ // Centered menu line: numbers in cyan, text in yellow
43
+ const menuText = chalk.cyan('[1]') + chalk.yellow(' ONE ACCOUNT ') + chalk.cyan('[2]') + chalk.yellow(' COPY TRADING');
44
+ const plainLen = '[1] ONE ACCOUNT [2] COPY TRADING'.length;
45
+ const leftPad = Math.floor((W - plainLen) / 2);
46
+ const rightPad = W - plainLen - leftPad;
47
+ console.log(chalk.cyan('║') + ' '.repeat(leftPad) + menuText + ' '.repeat(rightPad) + chalk.cyan('║'));
30
48
 
31
49
  drawBoxFooter(boxWidth);
32
50