diff --git a/src/web/bot.html b/src/web/bot.html
index 390c34f..1ecb0d7 100644
--- a/src/web/bot.html
+++ b/src/web/bot.html
@@ -488,6 +488,7 @@ function initChart() {
upColor: '#2ecc71', downColor: '#e74c3c',
borderUpColor: '#2ecc71', borderDownColor: '#e74c3c',
wickUpColor: '#2ecc71', wickDownColor: '#e74c3c',
+ priceFormat: { type: 'price', precision: 8, minMove: 0.00000001 },
});
chart.subscribeCrosshairMove(p => {
if (!p.seriesData || !p.seriesData.size) return;
@@ -508,9 +509,19 @@ function initChart() {
async function loadKlines() {
const interval = TF_MAP[bot.timeframe] || '5m';
try {
- const res = await fetch(`https://api.binance.com/api/v3/klines?symbol=${bot.symbol}&interval=${interval}&limit=200`);
+ const res = await fetch(`https://api.binance.com/api/v3/klines?symbol=${bot.symbol}&interval=${interval}&limit=1000`);
const data = await res.json();
const candles = data.map(k => ({ time: Math.floor(k[0]/1000), open: parseFloat(k[1]), high: parseFloat(k[2]), low: parseFloat(k[3]), close: parseFloat(k[4]) }));
+
+ // fiyatın ondalık basamak sayısını ilk kapanış fiyatından türet
+ if (candles.length) {
+ const sample = data[data.length - 1][4]; // son kapanış string olarak
+ const dotIdx = sample.indexOf('.');
+ const decimals = dotIdx >= 0 ? sample.length - dotIdx - 1 : 0;
+ const minMove = decimals > 0 ? parseFloat('0.' + '0'.repeat(decimals - 1) + '1') : 1;
+ candleSeries.applyOptions({ priceFormat: { type: 'price', precision: decimals, minMove } });
+ }
+
candleSeries.setData(candles);
chart.timeScale().scrollToRealTime();
chart.timeScale().setVisibleLogicalRange({ from: candles.length - 80, to: candles.length + 5 });