hedgequantx 2.9.119 → 2.9.121

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.9.119",
3
+ "version": "2.9.121",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -85,6 +85,29 @@ const CONTRACT_DESCRIPTIONS = {
85
85
 
86
86
  const getContractDescription = (baseSymbol) => CONTRACT_DESCRIPTIONS[baseSymbol] || baseSymbol;
87
87
 
88
+ // Tick sizes for common contracts (used when API doesn't provide)
89
+ const CONTRACT_TICK_SIZES = {
90
+ // Equity Index
91
+ ES: 0.25, MES: 0.25, NQ: 0.25, MNQ: 0.25,
92
+ RTY: 0.10, M2K: 0.10, YM: 1.00, MYM: 1.00,
93
+ // Metals
94
+ GC: 0.10, MGC: 0.10, '1OZ': 0.10, SI: 0.005, SIL: 0.001,
95
+ HG: 0.0005, MHG: 0.0005, PL: 0.10, PA: 0.10,
96
+ // Energy
97
+ CL: 0.01, MCL: 0.01, NG: 0.001, BZ: 0.01,
98
+ // Currencies
99
+ '6E': 0.00005, M6E: 0.0001, '6B': 0.0001, '6J': 0.0000005,
100
+ '6A': 0.0001, '6C': 0.00005, '6S': 0.0001,
101
+ // Crypto
102
+ BTC: 5.00, MBT: 5.00, ETH: 0.50, MET: 0.50,
103
+ // Treasuries
104
+ ZB: 0.03125, ZN: 0.015625, ZF: 0.0078125, ZT: 0.0078125,
105
+ // Grains
106
+ ZC: 0.25, ZS: 0.25, ZW: 0.25,
107
+ };
108
+
109
+ const getTickSize = (baseSymbol) => CONTRACT_TICK_SIZES[baseSymbol] || 0.25;
110
+
88
111
  module.exports = {
89
112
  ACCOUNT_STATUS,
90
113
  ACCOUNT_TYPE,
@@ -92,5 +115,7 @@ module.exports = {
92
115
  ORDER_TYPE,
93
116
  ORDER_SIDE,
94
117
  CONTRACT_DESCRIPTIONS,
118
+ CONTRACT_TICK_SIZES,
95
119
  getContractDescription,
120
+ getTickSize,
96
121
  };
@@ -233,7 +233,7 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
233
233
  let lastLogSecond = 0;
234
234
  let buyVolume = 0;
235
235
  let sellVolume = 0;
236
- let barCount = 0;
236
+
237
237
 
238
238
  let lastTickTime = 0;
239
239
  let tickLatencies = [];
@@ -293,9 +293,10 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
293
293
  if (currentSecond % 30 === 0) {
294
294
  const state = strategy.getAnalysisState?.(contractId, price);
295
295
  if (state) {
296
- sessionLogger.state(state.activeZones || 0, state.swingsDetected || 0, barCount, lastBias);
296
+ const bars = state.barsProcessed || 0;
297
+ sessionLogger.state(state.activeZones || 0, state.swingsDetected || 0, bars, lastBias);
297
298
  if (!state.ready) {
298
- ui.addLog('system', state.message);
299
+ ui.addLog('system', `${state.message} (${bars} bars)`);
299
300
  } else {
300
301
  const resStr = state.nearestResistance ? state.nearestResistance.toFixed(2) : '--';
301
302
  const supStr = state.nearestSupport ? state.nearestSupport.toFixed(2) : '--';
@@ -8,6 +8,7 @@
8
8
  const { decodeFrontMonthContract } = require('./protobuf');
9
9
  const { TIMEOUTS, CACHE } = require('../../config/settings');
10
10
  const { logger } = require('../../utils/logger');
11
+ const { getContractDescription, getTickSize } = require('../../config/constants');
11
12
 
12
13
  const log = logger.scope('Rithmic:Contracts');
13
14
 
@@ -155,12 +156,15 @@ const fetchAllFrontMonths = (service) => {
155
156
  const productKey = `${baseSymbol}:${contract.exchange}`;
156
157
  const product = productsToCheck.get(productKey);
157
158
 
158
- // 100% API data - no static symbol info
159
+ // Use our descriptions for better display names
160
+ const apiName = product?.productName || baseSymbol;
161
+ const displayName = getContractDescription(baseSymbol) || apiName;
159
162
  results.push({
160
163
  symbol: contract.symbol,
161
164
  baseSymbol,
162
- name: product?.productName || baseSymbol,
165
+ name: displayName,
163
166
  exchange: contract.exchange,
167
+ tickSize: getTickSize(baseSymbol),
164
168
  });
165
169
  }
166
170