File size: 37,159 Bytes
a95fb51 |
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 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Candlestick Patterns Mastery</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>
.candle {
width: 30px;
height: 60px;
position: relative;
margin: 0 auto;
}
.candle-body {
width: 100%;
position: absolute;
border-radius: 2px;
}
.candle-wick {
width: 2px;
height: 10px;
background-color: #333;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.pattern-card:hover {
transform: translateY(-5px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.chart-container {
height: 300px;
background-color: #1f2937;
border-radius: 0.5rem;
position: relative;
overflow: hidden;
}
.chart-line {
position: absolute;
background-color: #e2e8f0;
width: 100%;
height: 1px;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
animation: fadeIn 0.5s ease-out forwards;
}
</style>
</head>
<body class="bg-black font-sans text-white">
<!-- Navigation -->
<nav class="bg-gray-900 text-white shadow-lg">
<div class="container mx-auto px-4 py-3 flex justify-between items-center">
<div class="flex items-center space-x-2">
<i class="fas fa-chart-line text-2xl"></i>
<span class="text-xl font-bold">CandleMaster</span>
</div>
<div class="hidden md:flex space-x-6">
<a href="#basics" class="hover:text-indigo-200 transition">Basics</a>
<a href="#patterns" class="hover:text-indigo-200 transition">Patterns</a>
<a href="#quiz" class="hover:text-indigo-200 transition">Quiz</a>
<a href="#resources" class="hover:text-indigo-200 transition">Resources</a>
</div>
<button class="md:hidden text-xl">
<i class="fas fa-bars"></i>
</button>
</div>
</nav>
<!-- Hero Section -->
<header class="bg-gradient-to-r from-gray-800 to-gray-700 text-white py-20">
<div class="container mx-auto px-4 text-center">
<h1 class="text-4xl md:text-6xl font-bold mb-6 animate-fade-in">Master Candlestick Patterns</h1>
<p class="text-xl md:text-2xl mb-8 max-w-3xl mx-auto animate-fade-in" style="animation-delay: 0.2s;">
Unlock the secrets of price action with our comprehensive guide to candlestick patterns
</p>
<div class="flex flex-col sm:flex-row justify-center gap-4 animate-fade-in" style="animation-delay: 0.4s;">
<a href="#patterns" class="bg-white text-indigo-800 font-bold py-3 px-6 rounded-lg hover:bg-indigo-100 transition duration-300">
Explore Patterns
</a>
<a href="#quiz" class="bg-transparent border-2 border-white text-white font-bold py-3 px-6 rounded-lg hover:bg-white hover:text-indigo-800 transition duration-300">
Test Your Knowledge
</a>
</div>
</div>
</header>
<!-- Basics Section -->
<section id="basics" class="py-16 bg-gray-900">
<div class="container mx-auto px-4">
<h2 class="text-3xl font-bold text-center mb-12 text-white">Candlestick Basics</h2>
<div class="grid md:grid-cols-2 gap-12 items-center">
<div>
<h3 class="text-2xl font-semibold mb-4 text-indigo-700">What Are Candlesticks?</h3>
<p class="text-gray-600 mb-6">
Candlestick charts originated in Japan over 300 years ago for tracking rice prices. Each candlestick represents price movement during a specific time period, showing the open, high, low, and close prices.
</p>
<p class="text-gray-600 mb-6">
The rectangular "body" shows the range between the opening and closing prices. The "wicks" or "shadows" show the highest and lowest prices during that period.
</p>
<div class="flex items-center space-x-4 mb-6">
<div class="flex items-center">
<div class="candle mr-3">
<div class="candle-wick top-0"></div>
<div class="candle-body bg-green-500 h-full"></div>
<div class="candle-wick bottom-0"></div>
</div>
<span>Bullish (Price rose)</span>
</div>
<div class="flex items-center">
<div class="candle mr-3">
<div class="candle-wick top-0"></div>
<div class="candle-body bg-red-500 h-full"></div>
<div class="candle-wick bottom-0"></div>
</div>
<span>Bearish (Price fell)</span>
</div>
</div>
</div>
<div class="chart-container p-4">
<div class="chart-line" style="top: 25%"></div>
<div class="chart-line" style="top: 50%"></div>
<div class="chart-line" style="top: 75%"></div>
<div class="flex justify-around items-end h-full">
<!-- Sample candles -->
<div class="flex flex-col items-center">
<div class="candle">
<div class="candle-wick" style="height: 15px; top: -15px;"></div>
<div class="candle-body bg-red-500" style="height: 40px;"></div>
<div class="candle-wick" style="height: 10px; bottom: -10px;"></div>
</div>
<span class="text-xs mt-2">Day 1</span>
</div>
<div class="flex flex-col items-center">
<div class="candle">
<div class="candle-wick" style="height: 5px; top: -5px;"></div>
<div class="candle-body bg-green-500" style="height: 60px;"></div>
<div class="candle-wick" style="height: 20px; bottom: -20px;"></div>
</div>
<span class="text-xs mt-2">Day 2</span>
</div>
<div class="flex flex-col items-center">
<div class="candle">
<div class="candle-wick" style="height: 25px; top: -25px;"></div>
<div class="candle-body bg-red-500" style="height: 30px;"></div>
<div class="candle-wick" style="height: 5px; bottom: -5px;"></div>
</div>
<span class="text-xs mt-2">Day 3</span>
</div>
<div class="flex flex-col items-center">
<div class="candle">
<div class="candle-wick" style="height: 10px; top: -10px;"></div>
<div class="candle-body bg-green-500" style="height: 70px;"></div>
<div class="candle-wick" style="height: 15px; bottom: -15px;"></div>
</div>
<span class="text-xs mt-2">Day 4</span>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Patterns Section -->
<section id="patterns" class="py-16 bg-gray-900">
<div class="container mx-auto px-4">
<h2 class="text-3xl font-bold text-center mb-12 text-white">Common Candlestick Patterns</h2>
<div class="grid md:grid-cols-2 lg:grid-cols-3 gap-8">
<!-- Pattern Card 1 -->
<div class="pattern-card bg-gray-800 rounded-lg overflow-hidden shadow-md transition duration-300">
<div class="p-6">
<h3 class="text-xl font-bold mb-2 text-indigo-700">Hammer</h3>
<div class="flex justify-center my-4">
<div class="candle">
<div class="candle-wick" style="height: 30px; top: -30px;"></div>
<div class="candle-body bg-green-500" style="height: 15px;"></div>
</div>
</div>
<p class="text-gray-600 mb-4">
A bullish reversal pattern that forms after a decline. It has a small body near the top and a long lower wick.
</p>
<div class="flex items-center text-sm text-gray-500">
<i class="fas fa-lightbulb mr-2 text-yellow-500"></i>
<span>Signals potential trend reversal upward</span>
</div>
</div>
</div>
<!-- Pattern Card 2 -->
<div class="pattern-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
<div class="p-6">
<h3 class="text-xl font-bold mb-2 text-indigo-700">Hanging Man</h3>
<div class="flex justify-center my-4">
<div class="candle">
<div class="candle-wick" style="height: 30px; top: -30px;"></div>
<div class="candle-body bg-red-500" style="height: 15px;"></div>
</div>
</div>
<p class="text-gray-600 mb-4">
A bearish reversal pattern that forms after an advance. Similar to a hammer but appears in an uptrend.
</p>
<div class="flex items-center text-sm text-gray-500">
<i class="fas fa-lightbulb mr-2 text-yellow-500"></i>
<span>Signals potential trend reversal downward</span>
</div>
</div>
</div>
<!-- Pattern Card 3 -->
<div class="pattern-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
<div class="p-6">
<h3 class="text-xl font-bold mb-2 text-indigo-700">Engulfing</h3>
<div class="flex justify-center my-4 space-x-2">
<div class="candle">
<div class="candle-wick" style="height: 10px; top: -10px;"></div>
<div class="candle-body bg-red-500" style="height: 30px;"></div>
<div class="candle-wick" style="height: 5px; bottom: -5px;"></div>
</div>
<div class="candle">
<div class="candle-wick" style="height: 5px; top: -5px;"></div>
<div class="candle-body bg-green-500" style="height: 50px;"></div>
<div class="candle-wick" style="height: 10px; bottom: -10px;"></div>
</div>
</div>
<p class="text-gray-600 mb-4">
A two-candle pattern where the second candle completely engulfs the body of the first.
</p>
<div class="flex items-center text-sm text-gray-500">
<i class="fas fa-lightbulb mr-2 text-yellow-500"></i>
<span>Bullish when after downtrend, bearish after uptrend</span>
</div>
</div>
</div>
<!-- Pattern Card 4 -->
<div class="pattern-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
<div class="p-6">
<h3 class="text-xl font-bold mb-2 text-indigo-700">Doji</h3>
<div class="flex justify-center my-4">
<div class="candle">
<div class="candle-wick" style="height: 20px; top: -20px;"></div>
<div class="candle-body bg-gray-400" style="height: 2px;"></div>
<div class="candle-wick" style="height: 20px; bottom: -20px;"></div>
</div>
</div>
<p class="text-gray-600 mb-4">
Occurs when opening and closing prices are virtually equal, showing market indecision.
</p>
<div class="flex items-center text-sm text-gray-500">
<i class="fas fa-lightbulb mr-2 text-yellow-500"></i>
<span>Often signals potential reversal when after strong trend</span>
</div>
</div>
</div>
<!-- Pattern Card 5 -->
<div class="pattern-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
<div class="p-6">
<h3 class="text-xl font-bold mb-2 text-indigo-700">Morning Star</h3>
<div class="flex justify-center my-4 space-x-1">
<div class="candle">
<div class="candle-wick" style="height: 10px; top: -10px;"></div>
<div class="candle-body bg-red-500" style="height: 40px;"></div>
<div class="candle-wick" style="height: 5px; bottom: -5px;"></div>
</div>
<div class="candle">
<div class="candle-wick" style="height: 5px; top: -5px;"></div>
<div class="candle-body bg-gray-400" style="height: 10px;"></div>
<div class="candle-wick" style="height: 5px; bottom: -5px;"></div>
</div>
<div class="candle">
<div class="candle-wick" style="height: 5px; top: -5px;"></div>
<div class="candle-body bg-green-500" style="height: 35px;"></div>
<div class="candle-wick" style="height: 10px; bottom: -10px;"></div>
</div>
</div>
<p class="text-gray-600 mb-4">
A three-candle bullish reversal pattern that appears after a downtrend.
</p>
<div class="flex items-center text-sm text-gray-500">
<i class="fas fa-lightbulb mr-2 text-yellow-500"></i>
<span>Strong signal of potential upward reversal</span>
</div>
</div>
</div>
<!-- Pattern Card 6 -->
<div class="pattern-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300">
<div class="p-6">
<h3 class="text-xl font-bold mb-2 text-indigo-700">Shooting Star</h3>
<div class="flex justify-center my-4">
<div class="candle">
<div class="candle-wick" style="height: 30px; top: -30px;"></div>
<div class="candle-body bg-red-500" style="height: 10px;"></div>
<div class="candle-wick" style="height: 5px; bottom: -5px;"></div>
</div>
</div>
<p class="text-gray-600 mb-4">
A bearish reversal pattern with a small lower body and long upper wick, appearing after an uptrend.
</p>
<div class="flex items-center text-sm text-gray-500">
<i class="fas fa-lightbulb mr-2 text-yellow-500"></i>
<span>Indicates potential trend reversal downward</span>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Quiz Section -->
<section id="quiz" class="py-16 bg-gray-800 text-white">
<div class="container mx-auto px-4">
<h2 class="text-3xl font-bold text-center mb-12">Test Your Knowledge</h2>
<div class="max-w-3xl mx-auto bg-gray-800 rounded-lg shadow-xl overflow-hidden">
<div class="p-8 text-white">
<div id="quiz-container">
<div id="question-container" class="mb-8">
<h3 class="text-xl font-semibold mb-4 text-indigo-700" id="question">What does a hammer candlestick pattern typically indicate?</h3>
<div class="space-y-3" id="options">
<label class="flex items-center space-x-3 p-3 border border-gray-700 rounded-lg hover:bg-gray-700 cursor-pointer">
<input type="radio" name="answer" value="0" class="h-4 w-4 text-indigo-600">
<span>A continuation of the current downtrend</span>
</label>
<label class="flex items-center space-x-3 p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer">
<input type="radio" name="answer" value="1" class="h-4 w-4 text-indigo-600">
<span>A potential bullish reversal after a downtrend</span>
</label>
<label class="flex items-center space-x-3 p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer">
<input type="radio" name="answer" value="2" class="h-4 w-4 text-indigo-600">
<span>Market indecision with no clear direction</span>
</label>
<label class="flex items-center space-x-3 p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer">
<input type="radio" name="answer" value="3" class="h-4 w-4 text-indigo-600">
<span>A strong bearish signal in an uptrend</span>
</label>
</div>
</div>
<div id="result" class="hidden p-4 mb-6 rounded-lg bg-indigo-100 text-indigo-800">
<p id="result-text"></p>
</div>
<div class="flex justify-between">
<button id="prev-btn" class="px-4 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300 transition disabled:opacity-50" disabled>
Previous
</button>
<button id="next-btn" class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition">
Next
</button>
<button id="submit-btn" class="hidden px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition">
Submit Quiz
</button>
</div>
</div>
<div id="quiz-complete" class="hidden text-center py-8">
<i class="fas fa-trophy text-5xl text-yellow-500 mb-4"></i>
<h3 class="text-2xl font-bold mb-2 text-indigo-700">Quiz Complete!</h3>
<p class="text-lg mb-6">Your score: <span id="score" class="font-bold">0</span>/<span id="total-questions">0</span></p>
<button id="restart-quiz" class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition">
Try Again
</button>
</div>
</div>
</div>
</div>
</section>
<!-- Resources Section -->
<section id="resources" class="py-16 bg-gray-900">
<div class="container mx-auto px-4">
<h2 class="text-3xl font-bold text-center mb-12 text-white">Learning Resources</h2>
<div class="grid md:grid-cols-3 gap-8">
<div class="bg-gray-800 p-6 rounded-lg border border-gray-700">
<div class="text-indigo-600 text-4xl mb-4">
<i class="fas fa-book"></i>
</div>
<h3 class="text-xl font-semibold mb-3">Recommended Books</h3>
<ul class="space-y-2 text-gray-600">
<li class="flex items-start">
<i class="fas fa-chevron-right text-indigo-500 mt-1 mr-2 text-xs"></i>
<span>"Japanese Candlestick Charting Techniques" by Steve Nison</span>
</li>
<li class="flex items-start">
<i class="fas fa-chevron-right text-indigo-500 mt-1 mr-2 text-xs"></i>
<span>"Encyclopedia of Candlestick Charts" by Thomas Bulkowski</span>
</li>
<li class="flex items-start">
<i class="fas fa-chevron-right text-indigo-500 mt-1 mr-2 text-xs"></i>
<span>"Candlestick Charting Explained" by Gregory Morris</span>
</li>
</ul>
</div>
<div class="bg-gray-50 p-6 rounded-lg border border-gray-200">
<div class="text-indigo-600 text-4xl mb-4">
<i class="fas fa-video"></i>
</div>
<h3 class="text-xl font-semibold mb-3">Video Courses</h3>
<ul class="space-y-2 text-gray-600">
<li class="flex items-start">
<i class="fas fa-chevron-right text-indigo-500 mt-1 mr-2 text-xs"></i>
<span>"Mastering Candlestick Patterns" on Udemy</span>
</li>
<li class="flex items-start">
<i class="fas fa-chevron-right text-indigo-500 mt-1 mr-2 text-xs"></i>
<span>"Technical Analysis Masterclass" on Coursera</span>
</li>
<li class="flex items-start">
<i class="fas fa-chevron-right text-indigo-500 mt-1 mr-2 text-xs"></i>
<span>"Price Action Trading Strategies" on YouTube</span>
</li>
</ul>
</div>
<div class="bg-gray-50 p-6 rounded-lg border border-gray-200">
<div class="text-indigo-600 text-4xl mb-4">
<i class="fas fa-tools"></i>
</div>
<h3 class="text-xl font-semibold mb-3">Practice Tools</h3>
<ul class="space-y-2 text-gray-600">
<li class="flex items-start">
<i class="fas fa-chevron-right text-indigo-500 mt-1 mr-2 text-xs"></i>
<span>TradingView charting platform</span>
</li>
<li class="flex items-start">
<i class="fas fa-chevron-right text-indigo-500 mt-1 mr-2 text-xs"></i>
<span>MetaTrader 4/5 with demo account</span>
</li>
<li class="flex items-start">
<i class="fas fa-chevron-right text-indigo-500 mt-1 mr-2 text-xs"></i>
<span>Investopedia's stock simulator</span>
</li>
</ul>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="bg-black text-white py-12">
<div class="container mx-auto px-4">
<div class="grid md:grid-cols-4 gap-8">
<div>
<h3 class="text-xl font-bold mb-4">CandleMaster</h3>
<p class="text-gray-400">
Your comprehensive guide to mastering candlestick patterns and technical analysis.
</p>
</div>
<div>
<h4 class="font-semibold mb-4">Quick Links</h4>
<ul class="space-y-2 text-gray-400">
<li><a href="#basics" class="hover:text-white transition">Basics</a></li>
<li><a href="#patterns" class="hover:text-white transition">Patterns</a></li>
<li><a href="#quiz" class="hover:text-white transition">Quiz</a></li>
<li><a href="#resources" class="hover:text-white transition">Resources</a></li>
</ul>
</div>
<div>
<h4 class="font-semibold mb-4">Contact</h4>
<ul class="space-y-2 text-gray-400">
<li class="flex items-center">
<i class="fas fa-envelope mr-2"></i>
<span>contact@candlemaster.com</span>
</li>
<li class="flex items-center">
<i class="fas fa-phone mr-2"></i>
<span>+1 (555) 123-4567</span>
</li>
</ul>
</div>
<div>
<h4 class="font-semibold mb-4">Follow Us</h4>
<div class="flex space-x-4">
<a href="#" class="text-gray-400 hover:text-white transition text-xl">
<i class="fab fa-twitter"></i>
</a>
<a href="#" class="text-gray-400 hover:text-white transition text-xl">
<i class="fab fa-facebook"></i>
</a>
<a href="#" class="text-gray-400 hover:text-white transition text-xl">
<i class="fab fa-instagram"></i>
</a>
<a href="#" class="text-gray-400 hover:text-white transition text-xl">
<i class="fab fa-linkedin"></i>
</a>
</div>
</div>
</div>
<div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-400">
<p>© 2023 CandleMaster. All rights reserved.</p>
</div>
</div>
</footer>
<script>
// Quiz functionality
const quizData = [
{
question: "What does a hammer candlestick pattern typically indicate?",
options: [
"A continuation of the current downtrend",
"A potential bullish reversal after a downtrend",
"Market indecision with no clear direction",
"A strong bearish signal in an uptrend"
],
answer: 1,
explanation: "The hammer is a bullish reversal pattern that forms after a price decline. It signals that the market is rejecting lower prices."
},
{
question: "Which of these is a bearish reversal pattern?",
options: [
"Hammer",
"Morning Star",
"Shooting Star",
"Bullish Engulfing"
],
answer: 2,
explanation: "The shooting star is a bearish reversal pattern with a small lower body and long upper wick, appearing after an uptrend."
},
{
question: "What does a doji candlestick represent?",
options: [
"Strong bullish momentum",
"Strong bearish momentum",
"Market indecision",
"Continuation of the current trend"
],
answer: 2,
explanation: "A doji occurs when opening and closing prices are virtually equal, showing that buyers and sellers are in equilibrium and the market is indecisive."
},
{
question: "Which pattern consists of three candles and signals a bullish reversal?",
options: [
"Hanging Man",
"Evening Star",
"Morning Star",
"Shooting Star"
],
answer: 2,
explanation: "The morning star is a three-candle bullish reversal pattern that appears after a downtrend, consisting of a long red candle, a small-bodied candle, and a long green candle."
},
{
question: "What is the key characteristic of an engulfing pattern?",
options: [
"Small body with long wicks on both sides",
"The second candle completely engulfs the body of the first",
"Three consecutive candles moving in the same direction",
"A candle with no wicks at all"
],
answer: 1,
explanation: "An engulfing pattern is a two-candle reversal pattern where the body of the second candle completely covers (engulfs) the body of the first candle."
}
];
const questionEl = document.getElementById('question');
const optionsEl = document.getElementById('options');
const resultEl = document.getElementById('result');
const resultTextEl = document.getElementById('result-text');
const prevBtn = document.getElementById('prev-btn');
const nextBtn = document.getElementById('next-btn');
const submitBtn = document.getElementById('submit-btn');
const quizContainer = document.getElementById('quiz-container');
const quizComplete = document.getElementById('quiz-complete');
const scoreEl = document.getElementById('score');
const totalQuestionsEl = document.getElementById('total-questions');
const restartQuizBtn = document.getElementById('restart-quiz');
let currentQuestion = 0;
let score = 0;
let selectedAnswers = Array(quizData.length).fill(null);
function loadQuestion(questionIndex) {
const question = quizData[questionIndex];
questionEl.textContent = question.question;
optionsEl.innerHTML = '';
question.options.forEach((option, index) => {
const optionElement = document.createElement('label');
optionElement.className = 'flex items-center space-x-3 p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer';
const radio = document.createElement('input');
radio.type = 'radio';
radio.name = 'answer';
radio.value = index;
radio.className = 'h-4 w-4 text-indigo-600';
if (selectedAnswers[questionIndex] === index) {
radio.checked = true;
}
optionElement.appendChild(radio);
optionElement.appendChild(document.createTextNode(option));
optionsEl.appendChild(optionElement);
});
prevBtn.disabled = questionIndex === 0;
nextBtn.style.display = questionIndex === quizData.length - 1 ? 'none' : 'block';
submitBtn.style.display = questionIndex === quizData.length - 1 ? 'block' : 'none';
resultEl.classList.add('hidden');
}
function showResult(isCorrect, explanation) {
resultEl.classList.remove('hidden');
if (isCorrect) {
resultEl.className = 'p-4 mb-6 rounded-lg bg-green-100 text-green-800';
resultTextEl.textContent = 'Correct! ' + explanation;
} else {
resultEl.className = 'p-4 mb-6 rounded-lg bg-red-100 text-red-800';
resultTextEl.textContent = 'Incorrect. ' + explanation;
}
}
function showQuizComplete() {
quizContainer.style.display = 'none';
quizComplete.style.display = 'block';
scoreEl.textContent = score;
totalQuestionsEl.textContent = quizData.length;
}
function restartQuiz() {
currentQuestion = 0;
score = 0;
selectedAnswers = Array(quizData.length).fill(null);
quizContainer.style.display = 'block';
quizComplete.style.display = 'none';
loadQuestion(0);
}
function checkAnswer() {
const selectedOption = document.querySelector('input[name="answer"]:checked');
if (!selectedOption) return false;
const answer = parseInt(selectedOption.value);
selectedAnswers[currentQuestion] = answer;
const isCorrect = answer === quizData[currentQuestion].answer;
if (isCorrect && selectedAnswers[currentQuestion] !== quizData[currentQuestion].answer) {
score++;
}
showResult(isCorrect, quizData[currentQuestion].explanation);
return isCorrect;
}
prevBtn.addEventListener('click', () => {
currentQuestion--;
loadQuestion(currentQuestion);
});
nextBtn.addEventListener('click', () => {
if (checkAnswer() || selectedAnswers[currentQuestion] !== null) {
currentQuestion++;
loadQuestion(currentQuestion);
} else {
alert('Please select an answer before proceeding.');
}
});
submitBtn.addEventListener('click', () => {
checkAnswer();
showQuizComplete();
});
restartQuizBtn.addEventListener('click', restartQuiz);
// Initialize quiz
loadQuestion(0);
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
</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=StevenGrant10/candlestick-pattern-guide" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |