learning_ai_invt_trdg/backend/quick_eth.ts

20 lines
729 B
TypeScript

import { ConnectorFactory } from '../src/connectors/factory.js';
import { Indicators } from '../src/utils/indicators.js';
async function verifyETH() {
const exchange = ConnectorFactory.getCustomConnector('ccxt', '', '');
const symbol = 'ETH/USDT';
console.log(`\n--- 📊 ETH ANALYSIS ---`);
const candles4h = await exchange.fetchOHLCV(symbol, '4h', 100);
const ema50_4h = Indicators.calculateEMA(candles4h.map(c => c.close), 50);
const last4h = candles4h[candles4h.length - 1];
console.log(`ETH 4H Price: $${last4h.close}`);
console.log(`ETH 4H EMA50: $${ema50_4h.toFixed(2)}`);
console.log(`Trend: ${last4h.close > ema50_4h ? 'BULLISH' : 'BEARISH'}`);
}
verifyETH();