File size: 44,244 Bytes
4cfa876 5df8d73 4cfa876 5df8d73 4cfa876 5df8d73 4cfa876 5df8d73 4cfa876 5df8d73 4cfa876 5df8d73 4cfa876 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 |
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Top 500 Sociétés Américaines - Stratégies d'Options</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">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.fade-in {
animation: fadeIn 0.5s ease-in;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.company-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
.strategy-card {
transition: all 0.3s ease;
}
.strategy-card:hover {
transform: scale(1.03);
}
.dark-mode {
background-color: #1a202c;
color: #f7fafc;
}
.dark-mode .card-bg {
background-color: #2d3748;
}
.modal {
transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-content {
transform: translateY(20px);
transition: transform 0.3s ease;
}
.modal.active {
opacity: 1;
visibility: visible;
}
.modal.active .modal-content {
transform: translateY(0);
}
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<header class="bg-blue-600 text-white shadow-lg">
<div class="container mx-auto px-4 py-6">
<div class="flex justify-between items-center">
<div>
<h1 class="text-3xl font-bold">SP500 Trader</h1>
<p class="text-blue-100">Les 500 plus grosses sociétés américaines et stratégies d'options</p>
</div>
<div class="flex items-center space-x-4">
<button id="darkModeToggle" class="p-2 rounded-full hover:bg-blue-700">
<i class="fas fa-moon"></i>
</button>
<div class="relative">
<input type="text" id="searchInput" placeholder="Rechercher une entreprise..."
class="px-4 py-2 rounded-full text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-400">
<button class="absolute right-3 top-2 text-gray-500">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</div>
</div>
</header>
<main class="container mx-auto px-4 py-8">
<section class="mb-12">
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold text-gray-800 dark:text-white">Top 10 des Sociétés du SP500</h2>
<div class="flex space-x-2">
<button id="sortPrice" class="px-4 py-2 bg-blue-100 text-blue-800 rounded-lg hover:bg-blue-200 dark:bg-blue-900 dark:text-blue-100">
<i class="fas fa-sort-amount-down mr-2"></i>Par Prix
</button>
<button id="sortChange" class="px-4 py-2 bg-blue-100 text-blue-800 rounded-lg hover:bg-blue-200 dark:bg-blue-900 dark:text-blue-100">
<i class="fas fa-chart-line mr-2"></i>Par Variation
</button>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-6" id="topCompaniesContainer">
<!-- Les cartes des entreprises seront chargées ici par JavaScript -->
<div class="text-center py-10">
<i class="fas fa-spinner fa-spin text-4xl text-blue-500"></i>
<p class="mt-4">Chargement des données...</p>
</div>
</div>
</section>
<section class="mb-12">
<h2 class="text-2xl font-bold mb-6 text-gray-800 dark:text-white">Indice SP500</h2>
<div class="bg-white rounded-xl shadow-md overflow-hidden dark:card-bg">
<div class="p-4">
<div class="flex justify-between items-center">
<div>
<h3 class="text-xl font-semibold">SP500</h3>
<p class="text-gray-600 dark:text-gray-300">Indice des 500 plus grandes entreprises américaines</p>
</div>
<div class="text-right">
<p class="text-2xl font-bold" id="sp500Price">4,500.00</p>
<p class="text-green-500" id="sp500Change">+0.50%</p>
</div>
</div>
<div class="mt-4 h-64">
<canvas id="sp500Chart"></canvas>
</div>
</div>
</div>
</section>
<section class="mb-12">
<h2 class="text-2xl font-bold mb-6 text-gray-800 dark:text-white">Stratégies d'Options Populaires</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="strategy-card bg-white rounded-xl shadow-md overflow-hidden dark:card-bg">
<div class="p-6">
<div class="flex items-center mb-4">
<div class="bg-green-100 p-3 rounded-full mr-4 dark:bg-green-900">
<i class="fas fa-chart-line text-green-600 text-xl dark:text-green-300"></i>
</div>
<h3 class="text-xl font-semibold">Covered Call</h3>
</div>
<p class="text-gray-600 mb-4 dark:text-gray-300">
Achetez des actions et vendez des calls pour générer un revenu supplémentaire. Idéal pour les marchés plats ou légèrement haussiers.
</p>
<div class="bg-blue-50 p-4 rounded-lg dark:bg-blue-900 dark:text-blue-100">
<h4 class="font-medium mb-2">Exemple avec AAPL:</h4>
<p>- Achetez 100 actions AAPL à $180</p>
<p>- Vendez 1 call $185 à $3.50</p>
<p class="mt-2 font-medium">Profit potentiel: $3.50 (1.94%) en 1 mois</p>
</div>
</div>
</div>
<div class="strategy-card bg-white rounded-xl shadow-md overflow-hidden dark:card-bg">
<div class="p-6">
<div class="flex items-center mb-4">
<div class="bg-red-100 p-3 rounded-full mr-4 dark:bg-red-900">
<i class="fas fa-shield-alt text-red-600 text-xl dark:text-red-300"></i>
</div>
<h3 class="text-xl font-semibold">Protective Put</h3>
</div>
<p class="text-gray-600 mb-4 dark:text-gray-300">
Achetez des actions et des puts pour vous protéger contre les baisses. Limite les pertes tout en permettant une hausse illimitée.
</p>
<div class="bg-blue-50 p-4 rounded-lg dark:bg-blue-900 dark:text-blue-100">
<h4 class="font-medium mb-2">Exemple avec MSFT:</h4>
<p>- Achetez 100 actions MSFT à $320</p>
<p>- Achetez 1 put $310 à $5.20</p>
<p class="mt-2 font-medium">Protection: Perte limitée à $1,520 (-4.75%)</p>
</div>
</div>
</div>
<div class="strategy-card bg-white rounded-xl shadow-md overflow-hidden dark:card-bg">
<div class="p-6">
<div class="flex items-center mb-4">
<div class="bg-purple-100 p-3 rounded-full mr-4 dark:bg-purple-900">
<i class="fas fa-arrows-alt-h text-purple-600 text-xl dark:text-purple-300"></i>
</div>
<h3 class="text-xl font-semibold">Straddle</h3>
</div>
<p class="text-gray-600 mb-4 dark:text-gray-300">
Achetez un call et un put au même strike pour profiter d'une forte volatilité. Idéal avant des annonces importantes.
</p>
<div class="bg-blue-50 p-4 rounded-lg dark:bg-blue-900 dark:text-blue-100">
<h4 class="font-medium mb-2">Exemple avec TSLA:</h4>
<p>- Achetez 1 call $250 à $12.50</p>
<p>- Achetez 1 put $250 à $10.50</p>
<p class="mt-2 font-medium">Profit si TSLA > $273 ou < $227</p>
</div>
</div>
</div>
</div>
</section>
<section>
<h2 class="text-2xl font-bold mb-6 text-gray-800 dark:text-white">Toutes les Sociétés du SP500</h2>
<div class="bg-white rounded-xl shadow-md overflow-hidden dark:card-bg">
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
<thead class="bg-gray-50 dark:bg-gray-800">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:text-gray-300">Société</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:text-gray-300">Symbole</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:text-gray-300">Secteur</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:text-gray-300">Prix</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:text-gray-300">Variation</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:text-gray-300">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200 dark:bg-gray-800 dark:divide-gray-700" id="companiesTableBody">
<!-- Les données du tableau seront chargées ici par JavaScript -->
<tr>
<td colspan="6" class="text-center py-10">
<i class="fas fa-spinner fa-spin text-4xl text-blue-500"></i>
<p class="mt-4">Chargement des données...</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="px-6 py-4 bg-gray-50 border-t border-gray-200 dark:bg-gray-800 dark:border-gray-700 flex items-center justify-between">
<div class="flex-1 flex justify-between sm:hidden">
<button class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 dark:text-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600">
Précédent
</button>
<button class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 dark:text-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600">
Suivant
</button>
</div>
<div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
<div>
<p class="text-sm text-gray-700 dark:text-gray-300">
Affichage de <span class="font-medium">1</span> à <span class="font-medium">10</span> sur <span class="font-medium">500</span> résultats
</p>
</div>
<div>
<nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination">
<button class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600">
<span class="sr-only">Précédent</span>
<i class="fas fa-chevron-left"></i>
</button>
<button aria-current="page" class="z-10 bg-blue-50 border-blue-500 text-blue-600 relative inline-flex items-center px-4 py-2 border text-sm font-medium dark:bg-blue-900 dark:text-blue-100 dark:border-blue-700">
1
</button>
<button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600">
2
</button>
<button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600">
3
</button>
<span class="relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700 dark:bg-gray-700 dark:text-gray-300">
...
</span>
<button class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600">
50
</button>
<button class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600">
<span class="sr-only">Suivant</span>
<i class="fas fa-chevron-right"></i>
</button>
</nav>
</div>
</div>
</div>
</div>
</section>
</main>
<!-- Modal pour les stratégies d'options -->
<div id="strategiesModal" class="modal fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 opacity-0 invisible">
<div class="modal-content bg-white rounded-xl shadow-xl w-full max-w-3xl max-h-[90vh] overflow-y-auto dark:card-bg">
<div class="p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold text-gray-800 dark:text-white" id="modalCompanyName">Stratégies d'Options pour <span id="modalSymbol"></span></h2>
<button id="closeModal" class="text-gray-500 hover:text-gray-700 dark:text-gray-300 dark:hover:text-gray-100">
<i class="fas fa-times text-2xl"></i>
</button>
</div>
<div class="grid grid-cols-1 gap-6" id="strategiesContainer">
<!-- Les stratégies seront chargées ici dynamiquement -->
</div>
<div class="mt-8">
<h3 class="text-xl font-semibold mb-4 text-gray-800 dark:text-white">Calculateur de Profit</h3>
<div class="bg-blue-50 p-6 rounded-lg dark:bg-blue-900 dark:text-blue-100">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium mb-2">Stratégie</label>
<select class="w-full px-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600">
<option>Covered Call</option>
<option>Protective Put</option>
<option>Straddle</option>
<option>Strangle</option>
<option>Iron Condor</option>
</select>
</div>
<div>
<label class="block text-sm font-medium mb-2">Strike Price</label>
<input type="number" class="w-full px-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600" placeholder="e.g. 185">
</div>
<div>
<label class="block text-sm font-medium mb-2">Premium</label>
<input type="number" step="0.01" class="w-full px-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600" placeholder="e.g. 3.50">
</div>
<div>
<label class="block text-sm font-medium mb-2">Expiration</label>
<select class="w-full px-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600">
<option>1 semaine</option>
<option>2 semaines</option>
<option>1 mois</option>
<option>3 mois</option>
</select>
</div>
</div>
<button class="mt-6 w-full bg-blue-600 hover:bg-blue-700 text-white py-3 px-4 rounded-lg transition duration-300">
Calculer le Profit Potentiel
</button>
</div>
</div>
</div>
</div>
</div>
<footer class="bg-gray-800 text-white py-8">
<div class="container mx-auto px-4">
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<div>
<h3 class="text-xl font-bold mb-4">SP500 Trader</h3>
<p class="text-gray-400">
Plateforme d'analyse des entreprises du S&P 500 et stratégies d'options associées.
</p>
</div>
<div>
<h3 class="text-xl font-bold mb-4">Liens Utiles</h3>
<ul class="space-y-2">
<li><a href="#" class="text-gray-400 hover:text-white">Documentation Options</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Glossaire Boursier</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Calculateur de Profit</a></li>
</ul>
</div>
<div>
<h3 class="text-xl font-bold mb-4">Contact</h3>
<p class="text-gray-400 mb-2"><i class="fas fa-envelope mr-2"></i> contact@sp500trader.com</p>
<p class="text-gray-400"><i class="fas fa-phone mr-2"></i> +1 (555) 123-4567</p>
</div>
</div>
<div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400">
<p>© 2023 SP500 Trader. Tous droits réservés.</p>
<p class="mt-2 text-sm">Les données sont fournies à titre informatif seulement et ne constituent pas un conseil en investissement.</p>
</div>
</div>
</footer>
<script>
// Mode sombre
const darkModeToggle = document.getElementById('darkModeToggle');
const body = document.body;
darkModeToggle.addEventListener('click', () => {
body.classList.toggle('dark-mode');
if (body.classList.contains('dark-mode')) {
darkModeToggle.innerHTML = '<i class="fas fa-sun"></i>';
localStorage.setItem('darkMode', 'enabled');
} else {
darkModeToggle.innerHTML = '<i class="fas fa-moon"></i>';
localStorage.setItem('darkMode', 'disabled');
}
});
// Vérifier le mode au chargement
if (localStorage.getItem('darkMode') === 'enabled') {
body.classList.add('dark-mode');
darkModeToggle.innerHTML = '<i class="fas fa-sun"></i>';
}
// Données simulées pour le prototype
const sp500Companies = [
{ symbol: "AAPL", name: "Apple Inc.", sector: "Technology", price: 187.56, change: 1.25, volume: "45.2M" },
{ symbol: "MSFT", name: "Microsoft Corporation", sector: "Technology", price: 324.01, change: 0.78, volume: "22.1M" },
{ symbol: "AMZN", name: "Amazon.com Inc.", sector: "Consumer Cyclical", price: 128.45, change: -0.65, volume: "38.7M" },
{ symbol: "GOOGL", name: "Alphabet Inc.", sector: "Communication Services", price: 125.34, change: 0.92, volume: "19.3M" },
{ symbol: "META", name: "Meta Platforms Inc.", sector: "Communication Services", price: 298.61, change: 2.15, volume: "15.8M" },
{ symbol: "TSLA", name: "Tesla Inc.", sector: "Consumer Cyclical", price: 248.50, change: -3.45, volume: "112.5M" },
{ symbol: "NVDA", name: "NVIDIA Corporation", sector: "Technology", price: 422.86, change: 5.23, volume: "48.9M" },
{ symbol: "JPM", name: "JPMorgan Chase & Co.", sector: "Financial Services", price: 158.23, change: 0.34, volume: "8.7M" },
{ symbol: "V", name: "Visa Inc.", sector: "Financial Services", price: 245.67, change: -0.89, volume: "6.5M" },
{ symbol: "WMT", name: "Walmart Inc.", sector: "Consumer Defensive", price: 159.72, change: 0.45, volume: "12.3M" },
{ symbol: "PG", name: "Procter & Gamble", sector: "Consumer Defensive", price: 146.89, change: 0.23, volume: "5.8M" },
{ symbol: "MA", name: "Mastercard Incorporated", sector: "Financial Services", price: 389.12, change: 1.56, volume: "3.9M" },
{ symbol: "HD", name: "Home Depot", sector: "Consumer Cyclical", price: 315.45, change: -1.23, volume: "4.2M" },
{ symbol: "DIS", name: "Walt Disney Company", sector: "Communication Services", price: 88.34, change: 0.78, volume: "15.6M" },
{ symbol: "BAC", name: "Bank of America", sector: "Financial Services", price: 32.56, change: -0.45, volume: "42.3M" }
];
// Stratégies d'options par entreprise
const companyStrategies = {
"AAPL": [
{
name: "Covered Call",
description: "Vendez des calls OTM pour générer un revenu sur votre position longue.",
example: "Achetez 100 AAPL @ $185, vendez 1 call $195 @ $2.50",
risk: "Modéré",
reward: "Limité",
bestFor: "Marchés plats ou légèrement haussiers"
},
{
name: "Bull Put Spread",
description: "Vendez un put et achetez un put à un strike inférieur pour limiter le risque.",
example: "Vendez 1 put $180 @ $3.00, achetez 1 put $175 @ $1.50",
risk: "Limité",
reward: "Limité",
bestFor: "Marchés neutres à haussiers"
}
],
"MSFT": [
{
name: "Protective Put",
description: "Achetez des puts pour protéger votre position longue contre les baisses.",
example: "Achetez 100 MSFT @ $320, achetez 1 put $310 @ $5.20",
risk: "Limité",
reward: "Illimité",
bestFor: "Investisseurs longs cherchant une protection"
},
{
name: "Iron Condor",
description: "Stratégie de vente d'options qui profite de la faible volatilité.",
example: "Vendez 1 call $340 @ $2.00, achetez 1 call $350 @ $0.50, vendez 1 put $300 @ $3.00, achetez 1 put $290 @ $1.00",
risk: "Limité",
reward: "Limité",
bestFor: "Marchés plats avec faible volatilité"
}
],
"TSLA": [
{
name: "Straddle",
description: "Achetez un call et un put au même strike pour profiter d'une forte volatilité.",
example: "Achetez 1 call $250 @ $12.50, achetez 1 put $250 @ $10.50",
risk: "Limité à la prime payée",
reward: "Illimité",
bestFor: "Avant des annonces importantes (résultats, etc.)"
},
{
name: "Strangle",
description: "Achetez un call OTM et un put OTM pour profiter de gros mouvements.",
example: "Achetez 1 call $270 @ $8.00, achetez 1 put $230 @ $7.50",
risk: "Limité à la prime payée",
reward: "Illimité",
bestFor: "Volatilité attendue mais direction incertaine"
}
]
};
// Gestion de la modale
const strategiesModal = document.getElementById('strategiesModal');
const closeModal = document.getElementById('closeModal');
const modalSymbol = document.getElementById('modalSymbol');
const modalCompanyName = document.getElementById('modalCompanyName');
const strategiesContainer = document.getElementById('strategiesContainer');
function openModal(symbol, name) {
modalSymbol.textContent = symbol;
modalCompanyName.textContent = `Stratégies d'Options pour ${symbol} - ${name}`;
// Charger les stratégies pour cette entreprise
strategiesContainer.innerHTML = '';
const strategies = companyStrategies[symbol] || [
{
name: "Covered Call",
description: "Stratégie standard applicable à toutes les actions.",
example: `Achetez 100 ${symbol}, vendez 1 call OTM`,
risk: "Modéré",
reward: "Limité",
bestFor: "Marchés plats ou légèrement haussiers"
},
{
name: "Protective Put",
description: "Protégez votre position longue contre les baisses.",
example: `Achetez 100 ${symbol}, achetez 1 put ATM ou légèrement OTM`,
risk: "Limité",
reward: "Illimité",
bestFor: "Investisseurs longs cherchant une protection"
}
];
strategies.forEach(strategy => {
const strategyCard = document.createElement('div');
strategyCard.className = 'strategy-card bg-white rounded-xl shadow-md overflow-hidden dark:card-bg';
strategyCard.innerHTML = `
<div class="p-6">
<div class="flex items-center mb-4">
<div class="bg-blue-100 p-3 rounded-full mr-4 dark:bg-blue-900">
<i class="fas fa-chess-knight text-blue-600 text-xl dark:text-blue-300"></i>
</div>
<h3 class="text-xl font-semibold">${strategy.name}</h3>
</div>
<p class="text-gray-600 mb-4 dark:text-gray-300">${strategy.description}</p>
<div class="bg-gray-50 p-4 rounded-lg dark:bg-gray-700 dark:text-gray-300">
<h4 class="font-medium mb-2">Exemple:</h4>
<p>${strategy.example}</p>
<div class="grid grid-cols-2 gap-4 mt-4">
<div>
<p class="text-sm text-gray-500 dark:text-gray-400">Risque</p>
<p class="font-medium">${strategy.risk}</p>
</div>
<div>
<p class="text-sm text-gray-500 dark:text-gray-400">Reward</p>
<p class="font-medium">${strategy.reward}</p>
</div>
<div>
<p class="text-sm text-gray-500 dark:text-gray-400">Idéal pour</p>
<p class="font-medium">${strategy.bestFor}</p>
</div>
</div>
</div>
</div>
`;
strategiesContainer.appendChild(strategyCard);
});
strategiesModal.classList.add('active');
}
function closeModalHandler() {
strategiesModal.classList.remove('active');
}
closeModal.addEventListener('click', closeModalHandler);
strategiesModal.addEventListener('click', (e) => {
if (e.target === strategiesModal) {
closeModalHandler();
}
});
// Gestion du clic sur les boutons "Stratégies d'Options"
function handleStrategyButtonClick(symbol, name) {
openModal(symbol, name);
}
// Générer des données pour le graphique SP500
const generateChartData = () => {
const labels = [];
const data = [];
let currentPrice = 4500;
for (let i = 30; i >= 0; i--) {
const date = new Date();
date.setDate(date.getDate() - i);
labels.push(date.toLocaleDateString('fr-FR', { month: 'short', day: 'numeric' }));
// Variation aléatoire entre -1.5% et +1.5%
const change = (Math.random() * 3 - 1.5) / 100;
currentPrice = currentPrice * (1 + change);
data.push(currentPrice.toFixed(2));
}
return { labels, data };
};
// Afficher les entreprises dans le tableau
const displayCompaniesTable = () => {
const tableBody = document.getElementById('companiesTableBody');
tableBody.innerHTML = '';
sp500Companies.forEach(company => {
const changeClass = company.change >= 0 ? 'text-green-500' : 'text-red-500';
const changeIcon = company.change >= 0 ? 'fa-arrow-up' : 'fa-arrow-down';
const row = document.createElement('tr');
row.className = 'hover:bg-gray-50 dark:hover:bg-gray-700 fade-in';
row.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10 bg-blue-100 rounded-full flex items-center justify-center dark:bg-blue-900">
<span class="text-blue-600 font-medium dark:text-blue-300">${company.symbol[0]}</span>
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900 dark:text-white">${company.name}</div>
<div class="text-sm text-gray-500 dark:text-gray-400">${company.sector}</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm font-medium text-gray-900 dark:text-white">${company.symbol}</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200">
${company.sector}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-white">
$${company.price.toFixed(2)}
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="${changeClass}">
<i class="fas ${changeIcon} mr-1"></i> ${Math.abs(company.change).toFixed(2)}%
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-blue-600 hover:text-blue-900 mr-3 dark:text-blue-400 dark:hover:text-blue-300">
<i class="fas fa-chart-line"></i>
</button>
<button class="text-green-600 hover:text-green-900 dark:text-green-400 dark:hover:text-green-300" onclick="handleStrategyButtonClick('${company.symbol}', '${company.name}')">
<i class="fas fa-info-circle"></i>
</button>
</td>
`;
tableBody.appendChild(row);
});
};
// Afficher les top entreprises dans les cartes
const displayTopCompanies = () => {
const container = document.getElementById('topCompaniesContainer');
container.innerHTML = '';
// Trier par capitalisation (prix * volume)
const sortedCompanies = [...sp500Companies].sort((a, b) => {
const aVolume = parseFloat(a.volume.replace('M', '')) * 1000000;
const bVolume = parseFloat(b.volume.replace('M', '')) * 1000000;
return (b.price * bVolume) - (a.price * aVolume);
}).slice(0, 10);
sortedCompanies.forEach(company => {
const changeClass = company.change >= 0 ? 'text-green-500' : 'text-red-500';
const changeIcon = company.change >= 0 ? 'fa-arrow-up' : 'fa-arrow-down';
const card = document.createElement('div');
card.className = 'company-card bg-white rounded-xl shadow-md overflow-hidden dark:card-bg transition-all duration-300 fade-in';
card.innerHTML = `
<div class="p-6">
<div class="flex items-center mb-4">
<div class="flex-shrink-0 h-12 w-12 bg-blue-100 rounded-full flex items-center justify-center dark:bg-blue-900">
<span class="text-blue-600 text-xl font-medium dark:text-blue-300">${company.symbol[0]}</span>
</div>
<div class="ml-4">
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">${company.symbol}</h3>
<p class="text-sm text-gray-500 dark:text-gray-400">${company.name}</p>
</div>
</div>
<div class="flex justify-between items-center mt-6">
<div>
<p class="text-sm text-gray-500 dark:text-gray-400">Prix</p>
<p class="text-xl font-bold text-gray-900 dark:text-white">$${company.price.toFixed(2)}</p>
</div>
<div class="text-right">
<p class="text-sm text-gray-500 dark:text-gray-400">Variation</p>
<p class="${changeClass} font-semibold">
<i class="fas ${changeIcon} mr-1"></i> ${Math.abs(company.change).toFixed(2)}%
</p>
</div>
</div>
<div class="mt-6 pt-4 border-t border-gray-200 dark:border-gray-700">
<button class="w-full bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded-lg transition duration-300 flex items-center justify-center" onclick="handleStrategyButtonClick('${company.symbol}', '${company.name}')">
<i class="fas fa-chart-simple mr-2"></i> Stratégies d'Options
</button>
</div>
</div>
`;
container.appendChild(card);
});
};
// Initialiser le graphique SP500
const initSP500Chart = () => {
const { labels, data } = generateChartData();
const ctx = document.getElementById('sp500Chart').getContext('2d');
// Mettre à jour les valeurs affichées
const lastPrice = parseFloat(data[data.length - 1]);
const prevPrice = parseFloat(data[data.length - 2]);
const change = ((lastPrice - prevPrice) / prevPrice * 100).toFixed(2);
document.getElementById('sp500Price').textContent = lastPrice.toLocaleString('fr-FR', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
document.getElementById('sp500Change').textContent = `${change >= 0 ? '+' : ''}${change}%`;
document.getElementById('sp500Change').className = change >= 0 ? 'text-green-500' : 'text-red-500';
new Chart(ctx, {
type: 'line',
data: {
labels: labels,
datasets: [{
label: 'SP500',
data: data,
backgroundColor: 'rgba(37, 99, 235, 0.1)',
borderColor: 'rgba(37, 99, 235, 1)',
borderWidth: 2,
tension: 0.3,
fill: true,
pointBackgroundColor: 'rgba(37, 99, 235, 1)',
pointBorderColor: '#fff',
pointHoverRadius: 5,
pointHoverBackgroundColor: 'rgba(37, 99, 235, 1)',
pointHoverBorderColor: '#fff',
pointHitRadius: 10,
pointBorderWidth: 2
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
},
tooltip: {
mode: 'index',
intersect: false,
callbacks: {
label: function(context) {
return 'SP500: ' + context.parsed.y.toLocaleString('fr-FR', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
}
}
}
},
scales: {
x: {
grid: {
display: false
}
},
y: {
grid: {
color: 'rgba(0, 0, 0, 0.05)'
},
ticks: {
callback: function(value) {
return value.toLocaleString('fr-FR');
}
}
}
}
}
});
};
// Trier les entreprises par prix
document.getElementById('sortPrice').addEventListener('click', () => {
sp500Companies.sort((a, b) => b.price - a.price);
displayCompaniesTable();
displayTopCompanies();
});
// Trier les entreprises par variation
document.getElementById('sortChange').addEventListener('click', () => {
sp500Companies.sort((a, b) => b.change - a.change);
displayCompaniesTable();
displayTopCompanies();
});
// Recherche d'entreprises
document.getElementById('searchInput').addEventListener('input', (e) => {
const searchTerm = e.target.value.toLowerCase();
const rows = document.querySelectorAll('#companiesTableBody tr');
rows.forEach(row => {
const companyName = row.querySelector('td:first-child div div:first-child').textContent.toLowerCase();
const symbol = row.querySelector('td:nth-child(2) div').textContent.toLowerCase();
if (companyName.includes(searchTerm) || symbol.includes(searchTerm)) {
row.style.display = '';
} else {
row.style.display = 'none';
}
});
});
// Exposer la fonction pour les boutons
window.handleStrategyButtonClick = handleStrategyButtonClick;
// Initialisation
document.addEventListener('DOMContentLoaded', () => {
displayCompaniesTable();
displayTopCompanies();
initSP500Chart();
// Simuler un chargement
setTimeout(() => {
document.querySelectorAll('.fade-in').forEach(el => {
el.style.opacity = '1';
});
}, 300);
});
</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=Alainponcelas/sp500-trader-alain-poncelas" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |