btc / index.html
AqaHamedi's picture
Add 2 files
0512686 verified
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>تحلیل پیشرفته بیت‌کوین</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;500;600;700&display=swap');
body {
font-family: 'Noto Naskh Arabic', serif;
background-color: #f3f4f6;
}
.positive {
color: #10b981;
}
.negative {
color: #ef4444;
}
.neutral {
color: #3b82f6;
}
.chart-container {
height: 400px;
position: relative;
}
.tooltip {
position: absolute;
background: rgba(0, 0, 0, 0.7);
color: white;
padding: 5px 10px;
border-radius: 5px;
font-size: 12px;
pointer-events: none;
z-index: 10;
display: none;
}
.loading-spinner {
border: 4px solid rgba(0, 0, 0, 0.1);
border-radius: 50%;
border-top: 4px solid #3b82f6;
width: 40px;
height: 40px;
animation: spin 1s linear infinite;
margin: 20px auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body class="bg-gray-100">
<div class="container mx-auto px-4 py-8">
<!-- Header -->
<header class="bg-gradient-to-r from-blue-600 to-blue-800 text-white rounded-xl shadow-lg p-6 mb-8">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="flex items-center mb-4 md:mb-0">
<i class="fab fa-bitcoin text-4xl mr-3"></i>
<div>
<h1 class="text-2xl md:text-3xl font-bold">تحلیل پیشرفته بیت‌کوین</h1>
<p class="text-blue-100">نسخه 2.0 - تحلیل تکنیکال و فعالیت نهنگ‌ها</p>
</div>
</div>
<div class="bg-white/20 rounded-lg p-3 text-center">
<div class="text-sm text-blue-100">آخرین بروزرسانی</div>
<div class="font-bold" id="current-date">--/--/----</div>
</div>
</div>
</header>
<!-- Input Section -->
<section class="bg-white rounded-xl shadow-md p-6 mb-8">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<i class="fas fa-calendar-alt ml-2"></i>
انتخاب تاریخ تحلیل
</h2>
<div class="flex flex-col md:flex-row gap-4">
<div class="flex-1">
<label for="analysis-date" class="block text-sm font-medium text-gray-700 mb-1">تاریخ مورد نظر (YYYY-MM-DD)</label>
<input type="text" id="analysis-date" placeholder="برای استفاده از آخرین تاریخ خالی بگذارید"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
<div class="flex items-end">
<button id="analyze-btn" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg transition duration-200 flex items-center">
<i class="fas fa-chart-line ml-2"></i>
شروع تحلیل
</button>
</div>
</div>
</section>
<!-- Loading Indicator -->
<div id="loading-indicator" class="hidden">
<div class="bg-white rounded-xl shadow-md p-6 mb-8 text-center">
<div class="loading-spinner"></div>
<p class="text-gray-700 mt-2">در حال پردازش داده‌ها و انجام تحلیل‌ها...</p>
</div>
</div>
<!-- Analysis Results -->
<div id="analysis-results" class="hidden">
<!-- Summary Section -->
<section class="bg-white rounded-xl shadow-md p-6 mb-8">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<i class="fas fa-chart-pie ml-2"></i>
خلاصه آماری
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-6" id="summary-stats">
<!-- Filled by JavaScript -->
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">معیار</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">مقدار</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="summary-table">
<!-- Filled by JavaScript -->
</tbody>
</table>
</div>
</section>
<!-- Charts Section -->
<section class="bg-white rounded-xl shadow-md p-6 mb-8">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<i class="fas fa-chart-bar ml-2"></i>
نمودارهای تحلیلی
</h2>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div class="bg-gray-50 rounded-lg p-4">
<h3 class="font-medium text-gray-700 mb-2">قیمت و حجم معاملات</h3>
<div class="chart-container">
<canvas id="price-volume-chart"></canvas>
<div class="tooltip" id="price-tooltip"></div>
</div>
</div>
<div class="bg-gray-50 rounded-lg p-4">
<h3 class="font-medium text-gray-700 mb-2">شاخص قدرت نسبی (RSI)</h3>
<div class="chart-container">
<canvas id="rsi-chart"></canvas>
<div class="tooltip" id="rsi-tooltip"></div>
</div>
</div>
<div class="bg-gray-50 rounded-lg p-4">
<h3 class="font-medium text-gray-700 mb-2">میانگین متحرک همگرایی/واگرایی (MACD)</h3>
<div class="chart-container">
<canvas id="macd-chart"></canvas>
<div class="tooltip" id="macd-tooltip"></div>
</div>
</div>
<div class="bg-gray-50 rounded-lg p-4">
<h3 class="font-medium text-gray-700 mb-2">باندهای بولینگر</h3>
<div class="chart-container">
<canvas id="bollinger-chart"></canvas>
<div class="tooltip" id="bollinger-tooltip"></div>
</div>
</div>
</div>
</section>
<!-- Signals Section -->
<section class="bg-white rounded-xl shadow-md p-6 mb-8">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<i class="fas fa-bell ml-2"></i>
سیگنال‌های معاملاتی
</h2>
<div class="mb-6">
<h3 class="font-medium text-green-600 mb-2 flex items-center">
<i class="fas fa-arrow-up ml-2"></i>
سیگنال‌های برتر خرید
</h3>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-green-50">
<tr>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">زمان</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">قیمت</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">نوع سیگنال</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">توضیحات</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">قدرت سیگنال</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="buy-signals">
<!-- Filled by JavaScript -->
</tbody>
</table>
</div>
</div>
<div>
<h3 class="font-medium text-red-600 mb-2 flex items-center">
<i class="fas fa-arrow-down ml-2"></i>
سیگنال‌های برتر فروش
</h3>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-red-50">
<tr>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">زمان</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">قیمت</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">نوع سیگنال</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">توضیحات</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">قدرت سیگنال</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="sell-signals">
<!-- Filled by JavaScript -->
</tbody>
</table>
</div>
</div>
</section>
<!-- Whale Activity Section -->
<section class="bg-white rounded-xl shadow-md p-6 mb-8">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<i class="fas fa-whale ml-2"></i>
فعالیت نهنگ‌ها
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6" id="whale-stats">
<!-- Filled by JavaScript -->
</div>
<div class="mb-6">
<h3 class="font-medium text-gray-700 mb-2">استراتژی‌های نهنگ‌ها</h3>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">زمان</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">قیمت</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">نوع استراتژی</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">توضیحات</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">حجم معاملات</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">احتمال موفقیت</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="whale-strategies">
<!-- Filled by JavaScript -->
</tbody>
</table>
</div>
</div>
<div>
<h3 class="font-medium text-gray-700 mb-2">وایپ‌اوت‌ها و شکاف‌های نقدینگی</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="bg-gray-50 rounded-lg p-4">
<h4 class="font-medium text-purple-600 mb-2">وایپ‌اوت‌های شناسایی شده</h4>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-purple-50">
<tr>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">نوع وایپ‌اوت</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">تعداد</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="wipeouts">
<!-- Filled by JavaScript -->
</tbody>
</table>
</div>
</div>
<div class="bg-gray-50 rounded-lg p-4">
<h4 class="font-medium text-blue-600 mb-2">شکاف‌های نقدینگی</h4>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-blue-50">
<tr>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">نوع شکاف</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">تعداد</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="liquidity-gaps">
<!-- Filled by JavaScript -->
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
<!-- Candle Patterns Section -->
<section class="bg-white rounded-xl shadow-md p-6 mb-8">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<i class="fas fa-fire ml-2"></i>
الگوهای کندلی
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الگوی کندلی</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">تعداد</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="candle-patterns">
<!-- Filled by JavaScript -->
</tbody>
</table>
</div>
</div>
<div class="bg-gray-50 rounded-lg p-4">
<h4 class="font-medium text-gray-700 mb-2">توضیحات الگوهای کندلی</h4>
<div class="space-y-3" id="candle-explanations">
<!-- Filled by JavaScript -->
</div>
</div>
</div>
</section>
<!-- Export Section -->
<section class="bg-white rounded-xl shadow-md p-6">
<h2 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
<i class="fas fa-file-export ml-2"></i>
خروجی نتایج
</h2>
<div class="flex flex-col md:flex-row gap-4">
<button id="export-excel" class="bg-green-600 hover:bg-green-700 text-white px-6 py-3 rounded-lg transition duration-200 flex-1 flex items-center justify-center">
<i class="fas fa-file-excel ml-2"></i>
دانلود گزارش اکسل
</button>
<button id="export-pdf" class="bg-red-600 hover:bg-red-700 text-white px-6 py-3 rounded-lg transition duration-200 flex-1 flex items-center justify-center">
<i class="fas fa-file-pdf ml-2"></i>
دانلود گزارش PDF
</button>
<button id="export-charts" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-lg transition duration-200 flex-1 flex items-center justify-center">
<i class="fas fa-image ml-2"></i>
دانلود نمودارها
</button>
</div>
</section>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// Set current date
document.addEventListener('DOMContentLoaded', function() {
const now = new Date();
const formattedDate = now.toLocaleDateString('fa-IR');
document.getElementById('current-date').textContent = formattedDate;
// Set default date to yesterday
const yesterday = new Date(now);
yesterday.setDate(now.getDate() - 1);
const formattedYesterday = yesterday.toISOString().split('T')[0];
document.getElementById('analysis-date').placeholder = `مثال: ${formattedYesterday}`;
});
// Sample data for demonstration
const sampleData = {
date: "2023-06-15",
summary: {
open: 24500,
close: 25280,
high: 25350,
low: 24320,
avgPrice: 24850,
totalVolume: 125000000,
avgVolume: 5200000,
stdDev: 320,
dailyChange: 3.18,
negativeMinutes: 210,
positiveMinutes: 270
},
technical: {
lastRSI: 62.5,
avgRSI: 58.3,
maxRSI: 72.1,
minRSI: 42.8,
lastMACD: 125.4,
lastSignal: 118.7,
lastHistogram: 6.7
},
patterns: {
doji: 12,
hammer: 8,
invertedHammer: 5,
shootingStar: 6,
hangingMan: 4,
pinBar: 3,
standard: 442
},
whale: {
accumulations: 7,
distributions: 5,
totalPower: 48,
avgPower: 6.8,
maxPower: 12,
minPower: -9
},
wipeouts: [
{ type: "وایپ‌اوت کوتاه‌مدت خفیف", count: 2 },
{ type: "وایپ‌اوت میان‌مدت متوسط", count: 1 }
],
gaps: [
{ type: "شکاف صعودی متوسط", count: 3 },
{ type: "شکاف نزولی خفیف", count: 1 }
],
buySignals: [
{ time: "10:15", price: 24650, type: "خرید - RSI اشباع فروش", description: "RSI = 28.5 (احتمال برگشت صعودی)", strength: 8.5 },
{ time: "12:30", price: 24820, type: "خرید - انباشت نهنگ", description: "انباشت نهنگ با قدرت 12 (سیگنال صعودی قوی)", strength: 9.0 },
{ time: "14:45", price: 24980, type: "خرید - الگوی کندلی صعودی", description: "الگوی کندلی چکش (نشانگر احتمال برگشت صعودی)", strength: 7.5 },
{ time: "16:20", price: 24750, type: "خرید - نزدیک به حمایت", description: "قیمت 0.8٪ بالاتر از سطح حمایت", strength: 8.0 },
{ time: "18:10", price: 24350, type: "خرید - پس از وایپ‌اوت", description: "فرصت خرید پس از وایپ‌اوت میان‌مدت متوسط", strength: 7.5 }
],
sellSignals: [
{ time: "11:25", price: 25180, type: "فروش - RSI اشباع خرید", description: "RSI = 72.1 (احتمال برگشت نزولی)", strength: 8.5 },
{ time: "13:40", price: 25300, type: "فروش - توزیع نهنگ", description: "توزیع نهنگ با قدرت 9 (سیگنال نزولی قوی)", strength: 9.0 },
{ time: "15:55", price: 25250, type: "فروش - الگوی کندلی نزولی", description: "الگوی کندلی ستاره تیرانداز (نشانگر احتمال برگشت نزولی)", strength: 7.5 },
{ time: "17:30", price: 25280, type: "فروش - نزدیک به مقاومت", description: "قیمت 0.5٪ پایین‌تر از سطح مقاومت", strength: 8.0 },
{ time: "19:15", price: 25330, type: "فروش - شکاف نقدینگی صعودی", description: "شکاف نقدینگی صعودی قوی (احتمال پر شدن شکاف)", strength: 8.5 }
],
whaleStrategies: [
{ time: "10:45", price: 24680, type: "انباشت پس از وایپ‌اوت", description: "انباشت نهنگ 3 کندل پس از وایپ‌اوت کوتاه‌مدت خفیف", volume: 8500000, ratio: 1.9, probability: 85 },
{ time: "12:30", price: 24820, type: "انباشت در نزدیکی حمایت", description: "انباشت نهنگ در فاصله 0.8٪ از حمایت 24500", volume: 9200000, ratio: 2.1, probability: 88 },
{ time: "13:40", price: 25300, type: "توزیع در نزدیکی مقاومت", description: "توزیع نهنگ در فاصله 0.5٪ از مقاومت 25400", volume: 7800000, ratio: 1.8, probability: 82 },
{ time: "15:20", price: 25150, type: "توزیع در RSI بالا", description: "توزیع نهنگ در RSI = 70.5 (اشباع خرید)", volume: 6500000, ratio: 1.6, probability: 75 }
],
candleExplanations: [
{ pattern: "دوجی", description: "نشانگر تردید بازار و احتمال تغییر روند" },
{ pattern: "چکش", description: "نشانگر پایان روند نزولی و برگشت صعودی" },
{ pattern: "چکش وارونه", description: "نشانگر احتمال برگشت صعودی" },
{ pattern: "ستاره تیرانداز", description: "نشانگر پایان روند صعودی و برگشت نزولی" },
{ pattern: "مرد آویزان", description: "نشانگر احتمال برگشت نزولی" },
{ pattern: "سنجاق", description: "نشانگر بازگشت قوی در خلاف جهت سایه بلند" },
{ pattern: "استاندارد", description: "کندل معمولی بدون الگوی خاص" }
]
};
// Generate time series data for charts
function generateTimeSeriesData() {
const times = [];
const prices = [];
const volumes = [];
const rsiValues = [];
const macdValues = [];
const signalValues = [];
const histogramValues = [];
const bbUpper = [];
const bbMiddle = [];
const bbLower = [];
// Generate 24 hours of data (1440 minutes)
const basePrice = 24500;
for (let i = 0; i < 1440; i += 5) {
const hour = Math.floor(i / 60);
const minute = i % 60;
const timeStr = `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;
times.push(timeStr);
// Simulate price movement
const price = basePrice + Math.sin(i / 100) * 500 + Math.random() * 200 - 100;
prices.push(price);
// Simulate volume
const volume = 3000000 + Math.sin(i / 50) * 2000000 + Math.random() * 1000000;
volumes.push(volume);
// Simulate RSI
const rsi = 50 + Math.sin(i / 80) * 30 + Math.random() * 5;
rsiValues.push(rsi);
// Simulate MACD
const macd = Math.sin(i / 60) * 150 + Math.random() * 20;
macdValues.push(macd);
const signal = macd - 30 + Math.random() * 15;
signalValues.push(signal);
histogramValues.push(macd - signal);
// Simulate Bollinger Bands
const bbMid = price;
const bbUp = price + 200 + Math.random() * 100;
const bbLow = price - 200 - Math.random() * 100;
bbUpper.push(bbUp);
bbMiddle.push(bbMid);
bbLower.push(bbLow);
}
return {
times,
prices,
volumes,
rsiValues,
macdValues,
signalValues,
histogramValues,
bbUpper,
bbMiddle,
bbLower
};
}
// Create charts
function createCharts() {
const chartData = generateTimeSeriesData();
// Price and Volume Chart
const priceCtx = document.getElementById('price-volume-chart').getContext('2d');
const priceChart = new Chart(priceCtx, {
type: 'line',
data: {
labels: chartData.times,
datasets: [
{
label: 'قیمت بسته‌شدن',
data: chartData.prices,
borderColor: 'rgba(59, 130, 246, 1)',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
borderWidth: 2,
tension: 0.1,
yAxisID: 'y'
},
{
label: 'حجم معاملات',
data: chartData.volumes,
backgroundColor: 'rgba(107, 114, 128, 0.5)',
borderColor: 'rgba(107, 114, 128, 1)',
borderWidth: 1,
type: 'bar',
yAxisID: 'y1'
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
interaction: {
mode: 'index',
intersect: false,
},
plugins: {
tooltip: {
enabled: false,
external: function(context) {
const tooltip = document.getElementById('price-tooltip');
if (context.tooltip.opacity === 0) {
tooltip.style.display = 'none';
return;
}
const dataIndex = context.tooltip.dataPoints[0].dataIndex;
const price = context.tooltip.dataPoints[0].raw.toLocaleString();
const volume = context.tooltip.dataPoints[1].raw.toLocaleString();
tooltip.innerHTML = `
<div>زمان: ${chartData.times[dataIndex]}</div>
<div>قیمت: ${price} USDT</div>
<div>حجم: ${volume} USDT</div>
`;
tooltip.style.display = 'block';
tooltip.style.left = context.tooltip.caretX + 'px';
tooltip.style.top = context.tooltip.caretY + 'px';
}
},
legend: {
position: 'top',
rtl: true
}
},
scales: {
x: {
grid: {
display: false
}
},
y: {
type: 'linear',
display: true,
position: 'left',
title: {
display: true,
text: 'قیمت (USDT)'
}
},
y1: {
type: 'linear',
display: true,
position: 'right',
grid: {
drawOnChartArea: false
},
title: {
display: true,
text: 'حجم (USDT)'
}
}
}
}
});
// RSI Chart
const rsiCtx = document.getElementById('rsi-chart').getContext('2d');
const rsiChart = new Chart(rsiCtx, {
type: 'line',
data: {
labels: chartData.times,
datasets: [
{
label: 'RSI',
data: chartData.rsiValues,
borderColor: 'rgba(124, 58, 237, 1)',
backgroundColor: 'rgba(124, 58, 237, 0.1)',
borderWidth: 2,
tension: 0.1
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
tooltip: {
enabled: false,
external: function(context) {
const tooltip = document.getElementById('rsi-tooltip');
if (context.tooltip.opacity === 0) {
tooltip.style.display = 'none';
return;
}
const dataIndex = context.tooltip.dataPoints[0].dataIndex;
const rsi = context.tooltip.dataPoints[0].raw.toFixed(2);
let status = '';
if (rsi > 70) status = '(اشباع خرید)';
if (rsi < 30) status = '(اشباع فروش)';
tooltip.innerHTML = `
<div>زمان: ${chartData.times[dataIndex]}</div>
<div>RSI: ${rsi} ${status}</div>
`;
tooltip.style.display = 'block';
tooltip.style.left = context.tooltip.caretX + 'px';
tooltip.style.top = context.tooltip.caretY + 'px';
}
},
legend: {
position: 'top',
rtl: true
},
annotation: {
annotations: {
overbought: {
type: 'line',
yMin: 70,
yMax: 70,
borderColor: 'rgba(239, 68, 68, 0.7)',
borderWidth: 1,
borderDash: [6, 6],
label: {
content: 'اشباع خرید',
enabled: true,
position: 'left'
}
},
oversold: {
type: 'line',
yMin: 30,
yMax: 30,
borderColor: 'rgba(16, 185, 129, 0.7)',
borderWidth: 1,
borderDash: [6, 6],
label: {
content: 'اشباع فروش',
enabled: true,
position: 'left'
}
}
}
}
},
scales: {
x: {
grid: {
display: false
}
},
y: {
min: 0,
max: 100,
ticks: {
stepSize: 10
}
}
}
}
});
// MACD Chart
const macdCtx = document.getElementById('macd-chart').getContext('2d');
const macdChart = new Chart(macdCtx, {
type: 'line',
data: {
labels: chartData.times,
datasets: [
{
label: 'MACD',
data: chartData.macdValues,
borderColor: 'rgba(59, 130, 246, 1)',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
borderWidth: 2,
tension: 0.1
},
{
label: 'سیگنال',
data: chartData.signalValues,
borderColor: 'rgba(239, 68, 68, 1)',
backgroundColor: 'rgba(239, 68, 68, 0.1)',
borderWidth: 2,
tension: 0.1
},
{
label: 'هیستوگرام',
data: chartData.histogramValues,
backgroundColor: chartData.histogramValues.map(val =>
val >= 0 ? 'rgba(16, 185, 129, 0.7)' : 'rgba(239, 68, 68, 0.7)'
),
borderColor: chartData.histogramValues.map(val =>
val >= 0 ? 'rgba(16, 185, 129, 1)' : 'rgba(239, 68, 68, 1)'
),
borderWidth: 1,
type: 'bar'
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
tooltip: {
enabled: false,
external: function(context) {
const tooltip = document.getElementById('macd-tooltip');
if (context.tooltip.opacity === 0) {
tooltip.style.display = 'none';
return;
}
const dataIndex = context.tooltip.dataPoints[0].dataIndex;
const macd = context.tooltip.dataPoints[0].raw.toFixed(2);
const signal = context.tooltip.dataPoints[1].raw.toFixed(2);
const hist = context.tooltip.dataPoints[2].raw.toFixed(2);
let signalType = '';
if (macd > signal) signalType = '(سیگنال صعودی)';
if (macd < signal) signalType = '(سیگنال نزولی)';
tooltip.innerHTML = `
<div>زمان: ${chartData.times[dataIndex]}</div>
<div>MACD: ${macd}</div>
<div>سیگنال: ${signal}</div>
<div>هیستوگرام: ${hist} ${signalType}</div>
`;
tooltip.style.display = 'block';
tooltip.style.left = context.tooltip.caretX + 'px';
tooltip.style.top = context.tooltip.caretY + 'px';
}
},
legend: {
position: 'top',
rtl: true
}
},
scales: {
x: {
grid: {
display: false
}
}
}
}
});
// Bollinger Bands Chart
const bbCtx = document.getElementById('bollinger-chart').getContext('2d');
const bbChart = new Chart(bbCtx, {
type: 'line',
data: {
labels: chartData.times,
datasets: [
{
label: 'قیمت',
data: chartData.prices,
borderColor: 'rgba(59, 130, 246, 1)',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
borderWidth: 2,
tension: 0.1
},
{
label: 'باند بالا',
data: chartData.bbUpper,
borderColor: 'rgba(239, 68, 68, 1)',
backgroundColor: 'rgba(239, 68, 68, 0.1)',
borderWidth: 1,
borderDash: [5, 5],
tension: 0.1
},
{
label: 'باند میانی',
data: chartData.bbMiddle,
borderColor: 'rgba(156, 163, 175, 1)',
backgroundColor: 'rgba(156, 163, 175, 0.1)',
borderWidth: 1,
tension: 0.1
},
{
label: 'باند پایین',
data: chartData.bbLower,
borderColor: 'rgba(16, 185, 129, 1)',
backgroundColor: 'rgba(16, 185, 129, 0.1)',
borderWidth: 1,
borderDash: [5, 5],
tension: 0.1
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
tooltip: {
enabled: false,
external: function(context) {
const tooltip = document.getElementById('bollinger-tooltip');
if (context.tooltip.opacity === 0) {
tooltip.style.display = 'none';
return;
}
const dataIndex = context.tooltip.dataPoints[0].dataIndex;
const price = context.tooltip.dataPoints[0].raw.toLocaleString();
const upper = context.tooltip.dataPoints[1].raw.toLocaleString();
const middle = context.tooltip.dataPoints[2].raw.toLocaleString();
const lower = context.tooltip.dataPoints[3].raw.toLocaleString();
tooltip.innerHTML = `
<div>زمان: ${chartData.times[dataIndex]}</div>
<div>قیمت: ${price} USDT</div>
<div>باند بالا: ${upper} USDT</div>
<div>باند میانی: ${middle} USDT</div>
<div>باند پایین: ${lower} USDT</div>
`;
tooltip.style.display = 'block';
tooltip.style.left = context.tooltip.caretX + 'px';
tooltip.style.top = context.tooltip.caretY + 'px';
}
},
legend: {
position: 'top',
rtl: true
}
},
scales: {
x: {
grid: {
display: false
}
}
}
}
});
}
// Format numbers with commas
function formatNumber(num) {
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
// Render summary stats
function renderSummaryStats(data) {
const summaryStats = document.getElementById('summary-stats');
const summaryTable = document.getElementById('summary-table');
// Summary cards
summaryStats.innerHTML = `
<div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
<div class="text-blue-800 text-sm font-medium">قیمت بازشدن</div>
<div class="text-2xl font-bold text-blue-900">${formatNumber(data.summary.open)} USDT</div>
</div>
<div class="bg-green-50 border border-green-200 rounded-lg p-4">
<div class="text-green-800 text-sm font-medium">قیمت بسته‌شدن</div>
<div class="text-2xl font-bold text-green-900">${formatNumber(data.summary.close)} USDT</div>
</div>
<div class="bg-purple-50 border border-purple-200 rounded-lg p-4">
<div class="text-purple-800 text-sm font-medium">تغییرات روزانه</div>
<div class="text-2xl font-bold ${data.summary.dailyChange >= 0 ? 'text-green-600' : 'text-red-600'}">
${data.summary.dailyChange >= 0 ? '+' : ''}${data.summary.dailyChange}%
</div>
</div>
`;
// Summary table
summaryTable.innerHTML = `
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">بالاترین قیمت روز</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatNumber(data.summary.high)} USDT</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">پایین‌ترین قیمت روز</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatNumber(data.summary.low)} USDT</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">میانگین قیمت روز</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatNumber(data.summary.avgPrice)} USDT</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">مجموع حجم روز</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatNumber(data.summary.totalVolume)} USDT</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">میانگین حجم</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatNumber(data.summary.avgVolume)} USDT</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">انحراف معیار قیمت</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatNumber(data.summary.stdDev)} USDT</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">تعداد دقایق منفی</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${data.summary.negativeMinutes}</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">تعداد دقایق مثبت</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${data.summary.positiveMinutes}</td>
</tr>
`;
}
// Render signals
function renderSignals(data) {
const buySignalsTable = document.getElementById('buy-signals');
const sellSignalsTable = document.getElementById('sell-signals');
// Buy signals
buySignalsTable.innerHTML = data.buySignals.map(signal => `
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${signal.time}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatNumber(signal.price)} USDT</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${signal.type}</td>
<td class="px-6 py-4 text-sm text-gray-500">${signal.description}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-bold ${signal.strength >= 8 ? 'text-green-600' : signal.strength >= 5 ? 'text-blue-600' : 'text-gray-600'}">
${signal.strength}/10
</td>
</tr>
`).join('');
// Sell signals
sellSignalsTable.innerHTML = data.sellSignals.map(signal => `
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${signal.time}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatNumber(signal.price)} USDT</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${signal.type}</td>
<td class="px-6 py-4 text-sm text-gray-500">${signal.description}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-bold ${signal.strength >= 8 ? 'text-red-600' : signal.strength >= 5 ? 'text-blue-600' : 'text-gray-600'}">
${signal.strength}/10
</td>
</tr>
`).join('');
}
// Render whale activity
function renderWhaleActivity(data) {
const whaleStats = document.getElementById('whale-stats');
const whaleStrategiesTable = document.getElementById('whale-strategies');
const wipeoutsTable = document.getElementById('wipeouts');
const gapsTable = document.getElementById('liquidity-gaps');
// Whale stats
whaleStats.innerHTML = `
<div class="bg-green-50 border border-green-200 rounded-lg p-4">
<div class="text-green-800 text-sm font-medium">انباشت نهنگ</div>
<div class="text-2xl font-bold text-green-900">${data.whale.accumulations}</div>
</div>
<div class="bg-red-50 border border-red-200 rounded-lg p-4">
<div class="text-red-800 text-sm font-medium">توزیع نهنگ</div>
<div class="text-2xl font-bold text-red-900">${data.whale.distributions}</div>
</div>
<div class="bg-purple-50 border border-purple-200 rounded-lg p-4">
<div class="text-purple-800 text-sm font-medium">قدرت نهنگ کل</div>
<div class="text-2xl font-bold ${data.whale.totalPower >= 0 ? 'text-green-600' : 'text-red-600'}">
${data.whale.totalPower >= 0 ? '+' : ''}${data.whale.totalPower}
</div>
</div>
<div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
<div class="text-blue-800 text-sm font-medium">میانگین قدرت نهنگ</div>
<div class="text-2xl font-bold ${data.whale.avgPower >= 0 ? 'text-green-600' : 'text-red-600'}">
${data.whale.avgPower >= 0 ? '+' : ''}${data.whale.avgPower.toFixed(1)}
</div>
</div>
`;
// Whale strategies
whaleStrategiesTable.innerHTML = data.whaleStrategies.map(strategy => `
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${strategy.time}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatNumber(strategy.price)} USDT</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${strategy.type}</td>
<td class="px-6 py-4 text-sm text-gray-500">${strategy.description}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatNumber(strategy.volume)} USDT</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-bold ${strategy.probability >= 80 ? 'text-green-600' : strategy.probability >= 60 ? 'text-blue-600' : 'text-red-600'}">
${strategy.probability}%
</td>
</tr>
`).join('');
// Wipeouts
wipeoutsTable.innerHTML = data.wipeouts.map(wipeout => `
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${wipeout.type}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${wipeout.count}</td>
</tr>
`).join('');
// Liquidity gaps
gapsTable.innerHTML = data.gaps.map(gap => `
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${gap.type}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${gap.count}</td>
</tr>
`).join('');
}
// Render candle patterns
function renderCandlePatterns(data) {
const candlePatternsTable = document.getElementById('candle-patterns');
const candleExplanationsDiv = document.getElementById('candle-explanations');
// Candle patterns
candlePatternsTable.innerHTML = `
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">دوجی</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${data.patterns.doji}</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">چکش</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${data.patterns.hammer}</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">چکش وارونه</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${data.patterns.invertedHammer}</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">ستاره تیرانداز</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${data.patterns.shootingStar}</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">مرد آویزان</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${data.patterns.hangingMan}</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">سنجاق</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${data.patterns.pinBar}</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">استاندارد</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${data.patterns.standard}</td>
</tr>
`;
// Candle explanations
candleExplanationsDiv.innerHTML = data.candleExplanations.map(exp => `
<div class="flex items-start">
<div class="flex-shrink-0 h-5 w-5 text-blue-500 mt-0.5">
<i class="fas fa-info-circle"></i>
</div>
<div class="ml-2">
<span class="font-medium">${exp.pattern}:</span> ${exp.description}
</div>
</div>
`).join('');
}
// Analyze button click handler
document.getElementById('analyze-btn').addEventListener('click', function() {
const dateInput = document.getElementById('analysis-date').value;
// Show loading indicator
document.getElementById('loading-indicator').classList.remove('hidden');
document.getElementById('analysis-results').classList.add('hidden');
// Simulate analysis delay
setTimeout(function() {
// Hide loading indicator
document.getElementById('loading-indicator').classList.add('hidden');
// Show results
document.getElementById('analysis-results').classList.remove('hidden');
// Render data
renderSummaryStats(sampleData);
renderSignals(sampleData);
renderWhaleActivity(sampleData);
renderCandlePatterns(sampleData);
createCharts();
// Scroll to results
document.getElementById('analysis-results').scrollIntoView({
behavior: 'smooth'
});
}, 2000);
});
// Export buttons (just for demo)
document.getElementById('export-excel').addEventListener('click', function() {
alert('در حال دانلود گزارش اکسل... (این یک دمو است)');
});
document.getElementById('export-pdf').addEventListener('click', function() {
alert('در حال دانلود گزارش PDF... (این یک دمو است)');
});
document.getElementById('export-charts').addEventListener('click', function() {
alert('در حال دانلود نمودارها... (این یک دمو است)');
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=AqaHamedi/btc" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>