Prepare production deployment

This commit is contained in:
2026-07-20 04:14:24 +05:00
parent 55583e2101
commit 2e3550a4dc
46 changed files with 1497 additions and 882 deletions
+18 -11
View File
@@ -39,7 +39,7 @@ export const SYMBOLS = [
{ id: 'XRPUSDT', label: 'XRP/USDT', short: 'XRP', base: 0.55, dec: 5 },
{ id: 'ADAUSDT', label: 'ADA/USDT', short: 'ADA', base: 0.43, dec: 5 },
{ id: 'DOGEUSDT', label: 'DOGE/USDT', short: 'DOGE', base: 0.131, dec: 5 },
{ id: 'LINKUSDT', label: 'LINK/USDT', short: 'LINK', base: 18.5, dec: 3 },
{ id: 'LINKUSDT', label: 'LINK/USDT', short: 'LINK', base: 18.5, dec: 3 }
] as const;
export const TIMEFRAMES = [
@@ -48,7 +48,7 @@ export const TIMEFRAMES = [
{ id: '15m' as TimeframeId, label: '15м', sec: 900 },
{ id: '1h' as TimeframeId, label: '1ч', sec: 3600 },
{ id: '4h' as TimeframeId, label: '4ч', sec: 14400 },
{ id: '1d' as TimeframeId, label: '1д', sec: 86400 },
{ id: '1d' as TimeframeId, label: '1д', sec: 86400 }
];
// Simple LCG PRNG — deterministic per seed so switching back gives the same chart
@@ -91,7 +91,13 @@ export function generateChartData(symbolId: string, tfId: TimeframeId): ChartDat
const low = Math.min(open, close) - bodyH * wk * 0.7 - rand() * vol * 0.2;
const round = (n: number) => parseFloat(n.toFixed(Math.min(sym.dec + 2, 8)));
candles.push({ time: startTime + i * tf.sec, open: round(open), high: round(high), low: round(low), close: round(close) });
candles.push({
time: startTime + i * tf.sec,
open: round(open),
high: round(high),
low: round(low),
close: round(close)
});
price = close;
}
@@ -107,15 +113,12 @@ export function generateChartData(symbolId: string, tfId: TimeframeId): ChartDat
const predDir = rand() > 0.42 ? 1 : -1;
const predStrength = (0.006 + rand() * 0.018) * sym.base;
const prediction: PredPoint[] = [
{ time: candles[HISTORY - 1].time, value: currentPrice },
];
const prediction: PredPoint[] = [{ time: candles[HISTORY - 1].time, value: currentPrice }];
let pPrice = currentPrice;
for (let i = 1; i <= HORIZON; i++) {
const t = i / HORIZON;
const noise = (rand() - 0.5) * vol * 0.6;
pPrice = currentPrice + predDir * predStrength * t + noise;
const pPrice = currentPrice + predDir * predStrength * t + noise;
const round = (n: number) => parseFloat(n.toFixed(Math.min(sym.dec + 2, 8)));
prediction.push({ time: now + i * tf.sec, value: round(Math.max(pPrice, currentPrice * 0.1)) });
}
@@ -127,8 +130,12 @@ export function generateChartData(symbolId: string, tfId: TimeframeId): ChartDat
const round = (n: number) => parseFloat(n.toFixed(Math.min(sym.dec + 2, 8)));
const entry = round(currentPrice);
const tp = round(direction === 'long' ? currentPrice + predRange * 1.3 : currentPrice - predRange * 1.3);
const sl = round(direction === 'long' ? currentPrice - predRange * 0.65 : currentPrice + predRange * 0.65);
const tp = round(
direction === 'long' ? currentPrice + predRange * 1.3 : currentPrice - predRange * 1.3
);
const sl = round(
direction === 'long' ? currentPrice - predRange * 0.65 : currentPrice + predRange * 0.65
);
return {
candles,
@@ -136,6 +143,6 @@ export function generateChartData(symbolId: string, tfId: TimeframeId): ChartDat
signal: { direction, confidence, entry, tp, sl },
currentPrice,
change24h,
change24hPct,
change24hPct
};
}