File size: 72,482 Bytes
bfe8887 | 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 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 | {
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"gpuType": "T4"
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "code",
"source": [
"!pip -q install numpy matplotlib warp-lang torch"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "6nCegUGTE8jg",
"outputId": "f5a7ce52-8c68-4867-f906-f6a572caf491"
},
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m136.4/136.4 MB\u001b[0m \u001b[31m8.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25h"
]
}
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "OhI3LExdEd0t",
"outputId": "28967416-10ef-4f44-e3ad-e4743cfdc491"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"==========================================================================\n",
" TopoDevPOC β Developing POC Pattern Enumerator\n",
" n = 39 candles | 38 transitions | device = cuda\n",
" GPU = Tesla T4\n",
"==========================================================================\n",
"\n",
"[THEOREM] Total unique developing POC patterns for n=39\n",
" Bullish (non-increasing) : 2^38 = 274,877,906,944\n",
" Bearish (non-decreasing) : 2^38 = 274,877,906,944\n",
" Total (2^39) : 549,755,813,888\n",
"\n",
"[MATRIX] A = [[1,1],[1,1]] | v_0 = [1,1]^T\n",
" A^37 = [[68719476736, 68719476736],\n",
" [68719476736, 68719476736]]\n",
" B_39 = 1^T Β· A^37 Β· v_0 = 274,877,906,944\n",
" Expected 2^{n-1} = 274,877,906,944\n",
" [OK] 2 Γ 274,877,906,944 = 549,755,813,888 β\n",
"\n",
"[SAMPLE] 100 patterns sampled on GPU (torch.randint)\n",
" Sampling time: 276.10 ms\n",
"\n",
"==========================================================================\n",
" OUTPUT 1 β TERNARY MATRICES (1Γ38, values β {-1,0,+1})\n",
" Format: [#] Direction | PatternID | M = [m_0 β¦ m_37]\n",
"==========================================================================\n",
" [ 1] Bullish | ID= 167790361200 | M=[0,0,0,1,1,1,0,0,1,0,1,1,1,0,1,1,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0,1,1,1,0,0,1,0]\n",
" [ 2] Bearish | ID= 112296131307 | M=[-1, 0,-1, 0,-1,-1,-1, 0,-1, 0,-1,-1,-1,-1,-1, 0,-1,-1,-1,-1, 0,-1, 0,-1, 0,-1, 0, 0,-1, 0, 0, 0,-1, 0,-1,-1, 0, 0]\n",
" [ 3] Bullish | ID= 369064015028 | M=[0,1,0,1,1,0,1,0,0,1,0,1,1,1,1,1,0,1,1,0,1,1,1,1,0,1,1,0,1,1,1,1,0,1,0,1,0,1]\n",
" [ 4] Bearish | ID= 397679224723 | M=[-1, 0, 0,-1, 0, 0,-1,-1,-1,-1, 0, 0,-1,-1, 0,-1,-1,-1, 0, 0, 0, 0,-1,-1,-1,-1, 0,-1, 0, 0,-1, 0, 0,-1,-1,-1, 0,-1]\n",
" [ 5] Bullish | ID= 37927295500 | M=[0,1,1,0,0,0,0,0,1,0,1,1,0,0,1,0,0,1,0,0,1,0,1,0,0,1,0,1,0,1,1,0,0,0,1,0,0,0]\n",
" [ 6] Bullish | ID= 286312365648 | M=[0,0,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,1,0,0,0,1,1,0,0,1,0,1,0,1,0,1,0,0,0,0,1]\n",
" [ 7] Bearish | ID= 299333570369 | M=[ 0, 0, 0, 0, 0,-1, 0,-1,-1,-1,-1, 0, 0,-1,-1,-1,-1, 0,-1, 0,-1, 0,-1,-1, 0, 0, 0,-1,-1, 0,-1,-1, 0,-1, 0, 0, 0,-1]\n",
" [ 8] Bearish | ID= 180886373753 | M=[ 0, 0,-1,-1,-1,-1, 0,-1, 0,-1, 0, 0, 0, 0, 0,-1,-1, 0,-1, 0,-1, 0,-1,-1, 0,-1,-1,-1, 0, 0, 0, 0,-1, 0,-1, 0,-1, 0]\n",
" [ 9] Bullish | ID= 367632183586 | M=[1,0,0,0,1,0,0,1,0,0,0,1,1,1,1,1,0,1,0,1,0,0,1,0,0,0,1,1,0,0,1,1,0,1,0,1,0,1]\n",
" [ 10] Bullish | ID= 524916622536 | M=[0,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,0,1,1,0,0,0,1,0,1,1,1,1]\n",
" [ 11] Bullish | ID= 31775345360 | M=[0,0,0,1,0,1,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,0,0,0]\n",
" [ 12] Bullish | ID= 425035078904 | M=[0,0,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,0,0,1,0,0,0,0,1,1,0,1,1,1,1,0,1,0,0,0,1,1]\n",
" [ 13] Bullish | ID= 220258295520 | M=[0,0,0,0,1,1,1,0,1,1,1,1,0,1,1,0,1,0,1,0,1,1,0,0,0,0,1,0,0,1,0,1,1,0,0,1,1,0]\n",
" [ 14] Bearish | ID= 369470979075 | M=[-1, 0, 0, 0, 0, 0, 0, 0, 0,-1,-1,-1,-1, 0,-1,-1,-1,-1,-1, 0,-1, 0, 0, 0,-1,-1, 0, 0, 0, 0, 0, 0,-1,-1, 0,-1, 0,-1]\n",
" [ 15] Bearish | ID= 318324601329 | M=[ 0, 0, 0,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0,-1,-1, 0,-1,-1,-1, 0, 0, 0, 0,-1, 0,-1, 0, 0,-1]\n",
" [ 16] Bearish | ID= 147404907673 | M=[ 0, 0,-1,-1, 0, 0,-1, 0, 0,-1, 0, 0,-1,-1, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0,-1, 0, 0,-1, 0,-1, 0, 0,-1, 0, 0, 0,-1, 0]\n",
" [ 17] Bearish | ID= 371069085929 | M=[ 0, 0,-1, 0,-1,-1,-1, 0, 0, 0,-1, 0,-1,-1,-1, 0, 0, 0, 0,-1,-1,-1, 0,-1, 0,-1, 0, 0,-1,-1, 0, 0,-1,-1, 0,-1, 0,-1]\n",
" [ 18] Bearish | ID= 2330012161 | M=[ 0, 0, 0, 0, 0, 0, 0, 0,-1, 0,-1, 0,-1, 0, 0,-1, 0, 0, 0, 0,-1,-1,-1, 0,-1, 0,-1, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0]\n",
" [ 19] Bearish | ID= 419107634965 | M=[ 0,-1, 0,-1, 0, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1, 0,-1, 0, 0, 0, 0,-1,-1, 0, 0,-1, 0,-1, 0, 0,-1,-1, 0, 0, 0, 0,-1,-1]\n",
" [ 20] Bullish | ID= 479318507150 | M=[1,1,1,0,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,1,1,1,0,1,1]\n",
" [ 21] Bearish | ID= 319608669591 | M=[-1,-1, 0,-1, 0, 0,-1,-1, 0,-1, 0, 0, 0,-1, 0,-1, 0, 0,-1, 0,-1, 0, 0, 0,-1, 0,-1, 0,-1,-1, 0, 0,-1, 0,-1, 0, 0,-1]\n",
" [ 22] Bullish | ID= 534756389730 | M=[1,0,0,0,1,1,0,1,1,0,0,1,1,1,1,0,1,1,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,1,1,1,1,1]\n",
" [ 23] Bullish | ID= 234063416010 | M=[1,0,1,0,0,1,1,0,1,0,1,0,0,1,0,0,0,1,0,0,0,1,0,1,1,1,1,1,1,1,0,0,1,1,0,1,1,0]\n",
" [ 24] Bullish | ID= 259589951898 | M=[1,0,1,1,0,0,1,1,0,0,0,1,0,1,0,0,0,1,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0]\n",
" [ 25] Bullish | ID= 33069957648 | M=[0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,1,1,0,1,1,1,1,0,0,0,0]\n",
" [ 26] Bullish | ID= 386376948582 | M=[1,1,0,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,0,0,1,1,0,1]\n",
" [ 27] Bearish | ID= 137526752343 | M=[-1,-1, 0,-1, 0,-1, 0, 0, 0,-1, 0,-1,-1, 0,-1,-1,-1, 0,-1,-1,-1, 0, 0,-1, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1, 0]\n",
" [ 28] Bearish | ID= 466989440093 | M=[ 0,-1,-1,-1, 0,-1, 0, 0, 0,-1,-1,-1, 0,-1, 0,-1, 0,-1,-1,-1,-1, 0,-1, 0,-1, 0,-1,-1,-1, 0,-1, 0, 0,-1,-1, 0,-1,-1]\n",
" [ 29] Bearish | ID= 30541739875 | M=[-1, 0, 0, 0,-1,-1, 0,-1,-1,-1, 0,-1,-1,-1,-1,-1, 0,-1,-1, 0,-1,-1, 0, 0, 0,-1,-1,-1, 0, 0, 0,-1,-1,-1, 0, 0, 0, 0]\n",
" [ 30] Bullish | ID= 256289197764 | M=[0,1,0,0,0,1,1,0,1,1,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,1,1,0,1,0,1,1,1,0,1,1,1,0]\n",
" [ 31] Bullish | ID= 463423679574 | M=[1,1,0,1,0,1,0,0,0,1,1,0,1,0,0,0,0,1,0,1,1,0,0,0,1,1,0,0,1,1,1,1,1,0,1,0,1,1]\n",
" [ 32] Bearish | ID= 269170438337 | M=[ 0, 0, 0, 0, 0,-1,-1, 0, 0, 0, 0,-1,-1,-1,-1, 0,-1,-1,-1, 0, 0,-1,-1,-1,-1, 0,-1, 0,-1, 0,-1, 0,-1,-1,-1,-1,-1, 0]\n",
" [ 33] Bearish | ID= 535223428555 | M=[-1, 0,-1, 0, 0,-1,-1,-1, 0,-1, 0, 0,-1,-1, 0,-1, 0,-1,-1, 0, 0,-1,-1,-1, 0,-1,-1,-1, 0, 0,-1, 0, 0,-1,-1,-1,-1,-1]\n",
" [ 34] Bearish | ID= 295288782235 | M=[-1, 0,-1,-1, 0, 0,-1,-1, 0,-1,-1,-1,-1, 0, 0,-1, 0,-1, 0,-1, 0, 0,-1, 0, 0, 0, 0, 0, 0,-1,-1, 0, 0,-1, 0, 0, 0,-1]\n",
" [ 35] Bearish | ID= 343554777039 | M=[-1,-1,-1, 0, 0,-1,-1,-1,-1,-1,-1,-1, 0,-1,-1,-1, 0,-1, 0,-1,-1,-1, 0,-1, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0,-1]\n",
" [ 36] Bearish | ID= 547418250595 | M=[-1, 0, 0, 0,-1,-1, 0,-1, 0,-1,-1,-1, 0, 0,-1,-1,-1, 0,-1, 0,-1, 0,-1, 0, 0,-1, 0,-1,-1,-1, 0,-1,-1,-1,-1,-1,-1,-1]\n",
" [ 37] Bullish | ID= 177868470766 | M=[1,1,1,0,1,1,1,1,0,0,1,1,1,1,0,1,0,0,1,0,0,1,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0]\n",
" [ 38] Bullish | ID= 294601994596 | M=[0,1,0,0,1,1,0,1,0,0,0,1,1,0,1,1,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,0,1,0,0,0,1]\n",
" [ 39] Bullish | ID= 57969416624 | M=[0,0,0,1,1,0,1,1,0,0,1,1,0,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,0,1,0,1,1,0,0,0]\n",
" [ 40] Bullish | ID= 27863637690 | M=[1,0,1,1,1,0,1,0,1,1,1,1,0,1,0,1,0,1,1,0,0,1,1,0,0,1,1,1,1,1,0,0,1,1,0,0,0,0]\n",
" [ 41] Bullish | ID= 224985691976 | M=[0,0,1,0,0,1,0,1,1,1,0,1,1,0,0,1,0,0,0,1,1,0,0,0,1,0,0,0,1,1,0,0,0,1,0,1,1,0]\n",
" [ 42] Bearish | ID= 487090078369 | M=[ 0, 0, 0, 0,-1, 0,-1, 0,-1, 0, 0, 0, 0,-1,-1, 0, 0,-1, 0,-1, 0,-1,-1, 0, 0, 0,-1, 0,-1,-1, 0,-1, 0, 0, 0,-1,-1,-1]\n",
" [ 43] Bullish | ID= 4141515848 | M=[0,0,1,0,0,1,0,0,0,1,0,0,0,0,1,0,1,0,1,1,0,1,1,0,1,1,0,1,1,1,1,0,0,0,0,0,0,0]\n",
" [ 44] Bullish | ID= 197888556010 | M=[1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,0,1,0,0,0,1,1,0,0,1,0,0,0,0,1,1,1,0,1,0]\n",
" [ 45] Bearish | ID= 434117278173 | M=[ 0,-1,-1,-1, 0,-1,-1,-1, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0,-1,-1, 0,-1,-1, 0, 0,-1, 0, 0, 0,-1, 0,-1, 0, 0,-1,-1]\n",
" [ 46] Bullish | ID= 538864504842 | M=[1,0,1,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,1,0,1,1,0,1,1,0,1,1,1,0,1,0,1,1,1,1,1]\n",
" [ 47] Bullish | ID= 95860229666 | M=[1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,1,1,1,0,1,1,0,1,1,0,0,0,1,0,1,0,0,1,1,0,1,0,0]\n",
" [ 48] Bearish | ID= 175140355631 | M=[-1,-1,-1, 0,-1, 0, 0, 0,-1,-1,-1,-1,-1, 0,-1,-1, 0,-1,-1, 0,-1, 0, 0,-1,-1,-1, 0, 0, 0,-1,-1, 0, 0, 0,-1, 0,-1, 0]\n",
" [ 49] Bearish | ID= 229634663885 | M=[ 0,-1,-1, 0, 0,-1,-1,-1, 0,-1, 0, 0,-1,-1,-1, 0,-1, 0,-1, 0, 0,-1, 0,-1,-1,-1, 0,-1,-1,-1, 0,-1, 0,-1, 0,-1,-1, 0]\n",
" [ 50] Bearish | ID= 215659952263 | M=[-1,-1, 0, 0, 0, 0,-1, 0, 0, 0,-1,-1,-1, 0,-1,-1, 0,-1, 0,-1, 0,-1, 0, 0,-1,-1, 0,-1,-1, 0, 0, 0,-1, 0, 0,-1,-1, 0]\n",
" [ 51] Bearish | ID= 88951779299 | M=[-1, 0, 0, 0,-1,-1,-1,-1,-1,-1,-1, 0,-1,-1, 0, 0, 0, 0, 0,-1,-1,-1,-1,-1, 0,-1, 0,-1,-1, 0,-1, 0, 0,-1, 0,-1, 0, 0]\n",
" [ 52] Bearish | ID= 93340530549 | M=[ 0,-1, 0,-1,-1,-1, 0,-1,-1,-1, 0,-1,-1,-1, 0,-1,-1,-1, 0, 0, 0, 0,-1,-1,-1, 0,-1,-1,-1, 0,-1,-1, 0,-1, 0,-1, 0, 0]\n",
" [ 53] Bearish | ID= 520761088879 | M=[-1,-1,-1, 0,-1,-1, 0,-1,-1, 0,-1,-1, 0, 0,-1,-1,-1,-1, 0, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0,-1, 0, 0,-1,-1,-1,-1]\n",
" [ 54] Bullish | ID= 427826220636 | M=[0,1,1,1,0,1,0,0,1,1,1,0,0,0,0,0,1,1,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1]\n",
" [ 55] Bullish | ID= 483254597582 | M=[1,1,1,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1]\n",
" [ 56] Bullish | ID= 99519992790 | M=[1,1,0,1,0,1,1,1,1,0,0,1,0,0,1,0,1,0,1,1,0,1,1,1,1,0,1,0,1,0,0,1,1,1,0,1,0,0]\n",
" [ 57] Bullish | ID= 318036678048 | M=[0,0,0,0,1,0,1,1,0,1,0,1,0,0,1,0,1,1,0,1,1,1,0,0,0,1,1,0,0,0,0,0,1,0,1,0,0,1]\n",
" [ 58] Bullish | ID= 465354264024 | M=[0,0,1,1,0,1,1,1,0,1,1,0,0,0,1,0,1,1,0,0,0,1,0,1,0,0,1,1,0,1,0,0,0,1,1,0,1,1]\n",
" [ 59] Bearish | ID= 257366456073 | M=[ 0, 0,-1, 0, 0, 0, 0,-1,-1,-1, 0,-1,-1,-1, 0, 0, 0,-1,-1,-1,-1, 0, 0, 0, 0,-1,-1, 0,-1,-1,-1,-1,-1, 0,-1,-1,-1, 0]\n",
" [ 60] Bearish | ID= 438801001563 | M=[-1, 0,-1,-1, 0,-1, 0, 0, 0,-1,-1, 0,-1,-1,-1,-1,-1, 0, 0,-1, 0, 0,-1, 0,-1, 0,-1, 0,-1, 0, 0, 0,-1,-1, 0, 0,-1,-1]\n",
" [ 61] Bullish | ID= 524444180016 | M=[0,0,0,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,1,0,1,1,0,1,1,0,0,0,0,1,0,1,1,1,1]\n",
" [ 62] Bearish | ID= 326267911843 | M=[-1, 0, 0, 0,-1, 0,-1, 0,-1,-1,-1,-1,-1, 0, 0,-1, 0,-1, 0,-1, 0, 0, 0,-1,-1,-1, 0,-1,-1,-1,-1,-1,-1, 0,-1, 0, 0,-1]\n",
" [ 63] Bullish | ID= 79552418304 | M=[0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,1,0,0,0,0,1,0,1,0,0,1,0,0]\n",
" [ 64] Bearish | ID= 47263338937 | M=[ 0, 0,-1,-1,-1, 0,-1,-1, 0, 0, 0,-1, 0,-1, 0,-1, 0,-1,-1,-1, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0,-1,-1, 0,-1, 0, 0, 0]\n",
" [ 65] Bearish | ID= 175808306983 | M=[-1,-1, 0, 0,-1, 0, 0,-1,-1,-1,-1,-1, 0,-1,-1,-1, 0,-1,-1,-1,-1,-1,-1, 0,-1,-1,-1, 0,-1,-1,-1, 0, 0, 0,-1, 0,-1, 0]\n",
" [ 66] Bullish | ID= 482859874250 | M=[1,0,1,0,0,1,1,1,1,1,0,1,1,1,1,0,0,0,0,1,1,0,1,0,0,1,1,0,1,1,0,0,0,0,0,1,1,1]\n",
" [ 67] Bullish | ID= 437378623348 | M=[0,1,0,1,1,1,0,1,1,1,0,0,1,0,0,0,0,1,1,0,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,0,1,1]\n",
" [ 68] Bearish | ID= 400478158341 | M=[ 0,-1, 0, 0, 0, 0, 0, 0,-1,-1,-1,-1,-1, 0,-1,-1,-1, 0,-1,-1, 0,-1, 0, 0,-1,-1,-1,-1,-1, 0, 0,-1, 0,-1,-1,-1, 0,-1]\n",
" [ 69] Bearish | ID= 401295312607 | M=[-1,-1,-1,-1, 0,-1,-1, 0,-1,-1, 0, 0, 0, 0,-1, 0, 0, 0, 0,-1, 0, 0, 0,-1,-1,-1,-1, 0,-1,-1, 0,-1, 0,-1,-1,-1, 0,-1]\n",
" [ 70] Bullish | ID= 418612558654 | M=[1,1,1,1,1,0,0,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,0,1,1,1,0,1,1,1,0,1,0,0,0,0,1,1]\n",
" [ 71] Bullish | ID= 85827056944 | M=[0,0,0,1,1,0,0,1,0,1,0,1,1,1,1,0,0,0,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,0]\n",
" [ 72] Bullish | ID= 128616350616 | M=[0,0,1,1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,1,0,0,1,1,1,1,1,0,1,1,1,0,0]\n",
" [ 73] Bearish | ID= 314776501053 | M=[ 0,-1,-1,-1,-1, 0, 0,-1,-1, 0,-1,-1,-1, 0, 0, 0, 0,-1, 0, 0,-1, 0, 0, 0,-1, 0,-1, 0, 0,-1, 0,-1, 0, 0,-1, 0, 0,-1]\n",
" [ 74] Bullish | ID= 210744214082 | M=[1,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0,1,1,0]\n",
" [ 75] Bearish | ID= 231440688619 | M=[-1, 0,-1, 0,-1,-1,-1,-1, 0,-1, 0, 0,-1, 0,-1, 0, 0, 0, 0,-1,-1,-1,-1, 0,-1, 0, 0, 0,-1,-1,-1,-1, 0,-1, 0,-1,-1, 0]\n",
" [ 76] Bearish | ID= 266647084447 | M=[-1,-1,-1,-1, 0, 0,-1,-1, 0,-1,-1,-1, 0, 0,-1,-1,-1,-1, 0, 0,-1,-1, 0,-1, 0,-1, 0,-1, 0, 0, 0, 0,-1,-1,-1,-1,-1, 0]\n",
" [ 77] Bullish | ID= 198293842838 | M=[1,1,0,1,0,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,0,1,0,1,0,0,0,1,1,1,0,1,0]\n",
" [ 78] Bearish | ID= 357662675445 | M=[ 0,-1, 0,-1,-1,-1,-1,-1, 0, 0, 0,-1, 0,-1, 0,-1,-1, 0,-1,-1, 0,-1, 0, 0,-1,-1, 0, 0, 0,-1, 0,-1,-1, 0, 0,-1, 0,-1]\n",
" [ 79] Bullish | ID= 273125219496 | M=[0,0,1,0,1,0,1,0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,0]\n",
" [ 80] Bullish | ID= 75425469868 | M=[0,1,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,1,1,0,0,0,1,1,0,0,0,1,0,0]\n",
" [ 81] Bearish | ID= 195189967611 | M=[-1, 0,-1,-1,-1,-1,-1, 0,-1, 0,-1, 0, 0, 0,-1, 0,-1, 0,-1,-1,-1, 0, 0, 0,-1, 0, 0,-1,-1,-1, 0,-1, 0,-1,-1, 0,-1, 0]\n",
" [ 82] Bearish | ID= 225512663559 | M=[-1,-1, 0, 0, 0, 0, 0, 0,-1, 0,-1, 0,-1, 0, 0, 0,-1, 0,-1,-1, 0, 0,-1,-1, 0, 0, 0, 0, 0, 0,-1, 0, 0,-1, 0,-1,-1, 0]\n",
" [ 83] Bearish | ID= 78254493955 | M=[-1, 0, 0, 0, 0, 0, 0,-1, 0, 0, 0,-1, 0,-1,-1, 0, 0,-1, 0,-1, 0,-1, 0, 0, 0, 0,-1,-1,-1, 0, 0, 0,-1, 0, 0,-1, 0, 0]\n",
" [ 84] Bullish | ID= 389605294658 | M=[1,0,0,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,1,1,0,1,1,0,1,0,1,0,1,1,0,1]\n",
" [ 85] Bearish | ID= 373561087563 | M=[-1, 0,-1, 0, 0,-1, 0, 0,-1,-1, 0,-1, 0,-1,-1,-1, 0, 0,-1,-1,-1,-1,-1,-1, 0, 0,-1,-1,-1,-1,-1, 0,-1,-1, 0,-1, 0,-1]\n",
" [ 86] Bullish | ID= 444857134536 | M=[0,0,1,0,0,1,1,1,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,0,0,1,1,1,1,0,0,1,1]\n",
" [ 87] Bearish | ID= 490743440237 | M=[ 0,-1,-1, 0,-1,-1, 0,-1,-1, 0, 0, 0,-1, 0,-1, 0,-1,-1, 0,-1, 0, 0,-1, 0,-1, 0, 0, 0, 0,-1, 0, 0,-1, 0, 0,-1,-1,-1]\n",
" [ 88] Bearish | ID= 379217567217 | M=[ 0, 0, 0,-1,-1,-1,-1,-1, 0,-1,-1,-1, 0,-1,-1, 0, 0, 0, 0, 0,-1, 0, 0,-1,-1, 0,-1, 0, 0,-1, 0, 0, 0, 0,-1,-1, 0,-1]\n",
" [ 89] Bullish | ID= 225620347090 | M=[1,0,0,1,0,1,1,0,0,0,1,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,1,1,0]\n",
" [ 90] Bearish | ID= 222579730557 | M=[ 0,-1,-1,-1,-1,-1, 0, 0, 0, 0,-1, 0,-1, 0, 0,-1, 0, 0,-1, 0, 0,-1,-1, 0,-1, 0, 0,-1, 0,-1,-1,-1,-1, 0, 0,-1,-1, 0]\n",
" [ 91] Bearish | ID= 191729915761 | M=[ 0, 0, 0,-1,-1,-1, 0,-1,-1,-1, 0,-1, 0,-1, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1, 0,-1, 0, 0,-1,-1, 0,-1, 0]\n",
" [ 92] Bearish | ID= 119739270581 | M=[ 0,-1, 0,-1,-1, 0,-1,-1, 0,-1, 0, 0, 0,-1, 0, 0, 0,-1, 0, 0, 0, 0, 0,-1, 0, 0, 0, 0,-1,-1,-1,-1,-1, 0,-1,-1, 0, 0]\n",
" [ 93] Bullish | ID= 485971249076 | M=[0,1,0,1,1,0,1,1,1,1,0,0,0,1,1,0,0,1,0,0,1,0,0,0,1,1,0,0,1,0,0,1,0,0,0,1,1,1]\n",
" [ 94] Bearish | ID= 216427290349 | M=[ 0,-1,-1, 0,-1,-1,-1, 0,-1,-1,-1,-1, 0,-1, 0, 0,-1, 0, 0,-1, 0, 0, 0, 0, 0,-1, 0, 0,-1,-1, 0, 0,-1, 0, 0,-1,-1, 0]\n",
" [ 95] Bearish | ID= 425495675577 | M=[ 0, 0,-1,-1,-1, 0,-1, 0,-1, 0, 0, 0, 0,-1,-1, 0, 0,-1, 0, 0, 0, 0,-1,-1, 0, 0, 0,-1, 0, 0, 0,-1,-1, 0, 0, 0,-1,-1]\n",
" [ 96] Bearish | ID= 63855804407 | M=[-1,-1, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1, 0,-1,-1, 0, 0, 0, 0,-1,-1,-1,-1, 0,-1,-1, 0,-1,-1,-1, 0, 0, 0]\n",
" [ 97] Bearish | ID= 69480015969 | M=[ 0, 0, 0, 0,-1,-1, 0, 0, 0, 0,-1, 0,-1,-1,-1, 0, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1,-1, 0,-1, 0, 0, 0, 0, 0, 0,-1, 0, 0]\n",
" [ 98] Bearish | ID= 256615250465 | M=[ 0, 0, 0, 0,-1, 0, 0, 0,-1, 0,-1,-1,-1,-1,-1,-1, 0,-1, 0,-1,-1,-1, 0,-1,-1,-1,-1,-1,-1, 0,-1,-1,-1, 0,-1,-1,-1, 0]\n",
" [ 99] Bullish | ID= 488221437982 | M=[1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,0,0,0,1,1,0,1,0,1,1,0,0,0,1,1,1]\n",
" [100] Bearish | ID= 89681994059 | M=[-1, 0,-1, 0, 0,-1, 0,-1, 0, 0, 0, 0,-1, 0,-1, 0,-1,-1, 0,-1,-1,-1, 0,-1, 0, 0, 0, 0,-1,-1,-1, 0, 0,-1, 0,-1, 0, 0]\n",
"\n",
"==========================================================================\n",
" OUTPUT 2 β SYMBOLIC SEQUENCES (Ξ£, length 38)\n",
" Format: [#] Direction | PatternID | Ξ£ = Ο_0 Ο_1 β¦ Ο_37\n",
"==========================================================================\n",
" [ 1] Bullish | ID= 167790361200 | Ξ£ = = = = > > > = = > = > > > = > > = > = > = = = > = = = > = = = > > > = = > =\n",
" [ 2] Bearish | ID= 112296131307 | Ξ£ = < = < = < < < = < = < < < < < = < < < < = < = < = < = = < = = = < = < < = =\n",
" [ 3] Bullish | ID= 369064015028 | Ξ£ = = > = > > = > = = > = > > > > > = > > = > > > > = > > = > > > > = > = > = >\n",
" [ 4] Bearish | ID= 397679224723 | Ξ£ = < = = < = = < < < < = = < < = < < < = = = = < < < < = < = = < = = < < < = <\n",
" [ 5] Bullish | ID= 37927295500 | Ξ£ = = > > = = = = = > = > > = = > = = > = = > = > = = > = > = > > = = = > = = =\n",
" [ 6] Bullish | ID= 286312365648 | Ξ£ = = = = > = > = = > > > > > > > > > = > = = = > > = = > = > = > = > = = = = >\n",
" [ 7] Bearish | ID= 299333570369 | Ξ£ = = = = = = < = < < < < = = < < < < = < = < = < < = = = < < = < < = < = = = <\n",
" [ 8] Bearish | ID= 180886373753 | Ξ£ = = = < < < < = < = < = = = = = < < = < = < = < < = < < < = = = = < = < = < =\n",
" [ 9] Bullish | ID= 367632183586 | Ξ£ = > = = = > = = > = = = > > > > > = > = > = = > = = = > > = = > > = > = > = >\n",
" [ 10] Bullish | ID= 524916622536 | Ξ£ = = = > = = > > = = > = = = = = = = = > > > > = > > > = > > = = = > = > > > >\n",
" [ 11] Bullish | ID= 31775345360 | Ξ£ = = = = > = > > = > = > = = > = > = > = > > > > > = > = = > > = > > > = = = =\n",
" [ 12] Bullish | ID= 425035078904 | Ξ£ = = = > > > > > = = > > > = = > = = = = > = = = = > > = > > > > = > = = = > >\n",
" [ 13] Bullish | ID= 220258295520 | Ξ£ = = = = = > > > = > > > > = > > = > = > = > > = = = = > = = > = > > = = > > =\n",
" [ 14] Bearish | ID= 369470979075 | Ξ£ = < = = = = = = = = < < < < = < < < < < = < = = = < < = = = = = = < < = < = <\n",
" [ 15] Bearish | ID= 318324601329 | Ξ£ = = = = < < < < < = = = < < < < < < < < < = = < < = < < < = = = = < = < = = <\n",
" [ 16] Bearish | ID= 147404907673 | Ξ£ = = = < < = = < = = < = = < < = = = < = = = = = = < = = < = < = = < = = = < =\n",
" [ 17] Bearish | ID= 371069085929 | Ξ£ = = = < = < < < = = = < = < < < = = = = < < < = < = < = = < < = = < < = < = <\n",
" [ 18] Bearish | ID= 2330012161 | Ξ£ = = = = = = = = = < = < = < = = < = = = = < < < = < = < = = = < = = = = = = =\n",
" [ 19] Bearish | ID= 419107634965 | Ξ£ = = < = < = = = < < < < < < < < = < = = = = < < = = < = < = = < < = = = = < <\n",
" [ 20] Bullish | ID= 479318507150 | Ξ£ = > > > = = = > = > > > > > > > > > = > > = = > > = = > > = = > > > > > = > >\n",
" [ 21] Bearish | ID= 319608669591 | Ξ£ = < < = < = = < < = < = = = < = < = = < = < = = = < = < = < < = = < = < = = <\n",
" [ 22] Bullish | ID= 534756389730 | Ξ£ = > = = = > > = > > = = > > > > = > > = > > > > > = = = = = = > = = > > > > >\n",
" [ 23] Bullish | ID= 234063416010 | Ξ£ = > = > = = > > = > = > = = > = = = > = = = > = > > > > > > > = = > > = > > =\n",
" [ 24] Bullish | ID= 259589951898 | Ξ£ = > = > > = = > > = = = > = > = = = > = = = > > = = = = > > > = = = > > > > =\n",
" [ 25] Bullish | ID= 33069957648 | Ξ£ = = = = > = = = = > = = = = = > > > > > > = = = > > = = > > = > > > > = = = =\n",
" [ 26] Bullish | ID= 386376948582 | Ξ£ = > > = = > > = > > = > > = > = = = > > > = > > > = > = > > > > > = = > > = >\n",
" [ 27] Bearish | ID= 137526752343 | Ξ£ = < < = < = < = = = < = < < = < < < = < < < = = < = < = = = = = = = = = = < =\n",
" [ 28] Bearish | ID= 466989440093 | Ξ£ = = < < < = < = = = < < < = < = < = < < < < = < = < = < < < = < = = < < = < <\n",
" [ 29] Bearish | ID= 30541739875 | Ξ£ = < = = = < < = < < < = < < < < < = < < = < < = = = < < < = = = < < < = = = =\n",
" [ 30] Bullish | ID= 256289197764 | Ξ£ = = > = = = > > = > > > = = > > = > > = = = = = = = > > = > = > > > = > > > =\n",
" [ 31] Bullish | ID= 463423679574 | Ξ£ = > > = > = > = = = > > = > = = = = > = > > = = = > > = = > > > > > = > = > >\n",
" [ 32] Bearish | ID= 269170438337 | Ξ£ = = = = = = < < = = = = < < < < = < < < = = < < < < = < = < = < = < < < < < =\n",
" [ 33] Bearish | ID= 535223428555 | Ξ£ = < = < = = < < < = < = = < < = < = < < = = < < < = < < < = = < = = < < < < <\n",
" [ 34] Bearish | ID= 295288782235 | Ξ£ = < = < < = = < < = < < < < = = < = < = < = = < = = = = = = < < = = < = = = <\n",
" [ 35] Bearish | ID= 343554777039 | Ξ£ = < < < = = < < < < < < < = < < < = < = < < < = < = < < < < < < < < < < = = <\n",
" [ 36] Bearish | ID= 547418250595 | Ξ£ = < = = = < < = < = < < < = = < < < = < = < = < = = < = < < < = < < < < < < <\n",
" [ 37] Bullish | ID= 177868470766 | Ξ£ = > > > = > > > > = = > > > > = > = = > = = > > > = = > = > > = > = = > = > =\n",
" [ 38] Bullish | ID= 294601994596 | Ξ£ = = > = = > > = > = = = > > = > > = > = = > = > > > > = > = = > = = > = = = >\n",
" [ 39] Bullish | ID= 57969416624 | Ξ£ = = = = > > = > > = = > > = = = > > > > > > = = > > > > > > > = > = > > = = =\n",
" [ 40] Bullish | ID= 27863637690 | Ξ£ = > = > > > = > = > > > > = > = > = > > = = > > = = > > > > > = = > > = = = =\n",
" [ 41] Bullish | ID= 224985691976 | Ξ£ = = = > = = > = > > > = > > = = > = = = > > = = = > = = = > > = = = > = > > =\n",
" [ 42] Bearish | ID= 487090078369 | Ξ£ = = = = = < = < = < = = = = < < = = < = < = < < = = = < = < < = < = = = < < <\n",
" [ 43] Bullish | ID= 4141515848 | Ξ£ = = = > = = > = = = > = = = = > = > = > > = > > = > > = > > > > = = = = = = =\n",
" [ 44] Bullish | ID= 197888556010 | Ξ£ = > = > = > > > > > = > > > = > > > = = > = = = > > = = > = = = = > > > = > =\n",
" [ 45] Bearish | ID= 434117278173 | Ξ£ = = < < < = < < < = = < < < < < < < < = = < < = < < = = < = = = < = < = = < <\n",
" [ 46] Bullish | ID= 538864504842 | Ξ£ = > = > = = = = = = = = > = > > > > = = > = > > = > > = > > > = > = > > > > >\n",
" [ 47] Bullish | ID= 95860229666 | Ξ£ = > = = = > = = = > > = = = = = > > > = > > = > > = = = > = > = = > > = > = =\n",
" [ 48] Bearish | ID= 175140355631 | Ξ£ = < < < = < = = = < < < < < = < < = < < = < = = < < < = = = < < = = = < = < =\n",
" [ 49] Bearish | ID= 229634663885 | Ξ£ = = < < = = < < < = < = = < < < = < = < = = < = < < < = < < < = < = < = < < =\n",
" [ 50] Bearish | ID= 215659952263 | Ξ£ = < < = = = = < = = = < < < = < < = < = < = < = = < < = < < = = = < = = < < =\n",
" [ 51] Bearish | ID= 88951779299 | Ξ£ = < = = = < < < < < < < = < < = = = = = < < < < < = < = < < = < = = < = < = =\n",
" [ 52] Bearish | ID= 93340530549 | Ξ£ = = < = < < < = < < < = < < < = < < < = = = = < < < = < < < = < < = < = < = =\n",
" [ 53] Bearish | ID= 520761088879 | Ξ£ = < < < = < < = < < = < < = = < < < < = = = < < < < < < < < = = < = = < < < <\n",
" [ 54] Bullish | ID= 427826220636 | Ξ£ = = > > > = > = = > > > = = = = = > > > = > > = = = > > > = = > > > = = = > >\n",
" [ 55] Bullish | ID= 483254597582 | Ξ£ = > > > = = > > > > > = > > > > > > > = > > = = = = > = = = = > = = = = > > >\n",
" [ 56] Bullish | ID= 99519992790 | Ξ£ = > > = > = > > > > = = > = = > = > = > > = > > > > = > = > = = > > > = > = =\n",
" [ 57] Bullish | ID= 318036678048 | Ξ£ = = = = = > = > > = > = > = = > = > > = > > > = = = > > = = = = = > = > = = >\n",
" [ 58] Bullish | ID= 465354264024 | Ξ£ = = = > > = > > > = > > = = = > = > > = = = > = > = = > > = > = = = > > = > >\n",
" [ 59] Bearish | ID= 257366456073 | Ξ£ = = = < = = = = < < < = < < < = = = < < < < = = = = < < = < < < < < = < < < =\n",
" [ 60] Bearish | ID= 438801001563 | Ξ£ = < = < < = < = = = < < = < < < < < = = < = = < = < = < = < = = = < < = = < <\n",
" [ 61] Bullish | ID= 524444180016 | Ξ£ = = = = > > = = = > > > > = = = > > > > = = > = > > = > > = = = = > = > > > >\n",
" [ 62] Bearish | ID= 326267911843 | Ξ£ = < = = = < = < = < < < < < = = < = < = < = = = < < < = < < < < < < = < = = <\n",
" [ 63] Bullish | ID= 79552418304 | Ξ£ = = = = = = = = = > = = > = = > > = = = > > = > > = > = = = = > = > = = > = =\n",
" [ 64] Bearish | ID= 47263338937 | Ξ£ = = = < < < = < < = = = < = < = < = < < < = = = < = = = = = = = < < = < = = =\n",
" [ 65] Bearish | ID= 175808306983 | Ξ£ = < < = = < = = < < < < < = < < < = < < < < < < = < < < = < < < = = = < = < =\n",
" [ 66] Bullish | ID= 482859874250 | Ξ£ = > = > = = > > > > > = > > > > = = = = > > = > = = > > = > > = = = = = > > >\n",
" [ 67] Bullish | ID= 437378623348 | Ξ£ = = > = > > > = > > > = = > = = = = > > = = > > > = > = > = > > > = > = = > >\n",
" [ 68] Bearish | ID= 400478158341 | Ξ£ = = < = = = = = = < < < < < = < < < = < < = < = = < < < < < = = < = < < < = <\n",
" [ 69] Bearish | ID= 401295312607 | Ξ£ = < < < < = < < = < < = = = = < = = = = < = = = < < < < = < < = < = < < < = <\n",
" [ 70] Bullish | ID= 418612558654 | Ξ£ = > > > > > = = > > = > > > = > = = = = = = > = > > > = > > > = > = = = = > >\n",
" [ 71] Bullish | ID= 85827056944 | Ξ£ = = = = > > = = > = > = > > > > = = = = > > = > > > = > > > > > > > = = > = =\n",
" [ 72] Bullish | ID= 128616350616 | Ξ£ = = = > > = = > > > = = = = > > > = = = = > = = = > = = > > > > > = > > > = =\n",
" [ 73] Bearish | ID= 314776501053 | Ξ£ = = < < < < = = < < = < < < = = = = < = = < = = = < = < = = < = < = = < = = <\n",
" [ 74] Bullish | ID= 210744214082 | Ξ£ = > = = = = > = = > = = = = = > > = > = > = > = > = = = > = = = > = = = > > =\n",
" [ 75] Bearish | ID= 231440688619 | Ξ£ = < = < = < < < < = < = = < = < = = = = < < < < = < = = = < < < < = < = < < =\n",
" [ 76] Bearish | ID= 266647084447 | Ξ£ = < < < < = = < < = < < < = = < < < < = = < < = < = < = < = = = = < < < < < =\n",
" [ 77] Bullish | ID= 198293842838 | Ξ£ = > > = > = = > > > = > = > > > > > = > > > = = > > = > = > = = = > > > = > =\n",
" [ 78] Bearish | ID= 357662675445 | Ξ£ = = < = < < < < < = = = < = < = < < = < < = < = = < < = = = < = < < = = < = <\n",
" [ 79] Bullish | ID= 273125219496 | Ξ£ = = = > = > = > = = > > > = = = = = = > = = = > > > > = > = = > > > > > > > =\n",
" [ 80] Bullish | ID= 75425469868 | Ξ£ = = > > = > = > > = > = > = > = > = > = > > = > > > > > = = = > > = = = > = =\n",
" [ 81] Bearish | ID= 195189967611 | Ξ£ = < = < < < < < = < = < = = = < = < = < < < = = = < = = < < < = < = < < = < =\n",
" [ 82] Bearish | ID= 225512663559 | Ξ£ = < < = = = = = = < = < = < = = = < = < < = = < < = = = = = = < = = < = < < =\n",
" [ 83] Bearish | ID= 78254493955 | Ξ£ = < = = = = = = < = = = < = < < = = < = < = < = = = = < < < = = = < = = < = =\n",
" [ 84] Bullish | ID= 389605294658 | Ξ£ = > = = = = > = = > = = = = = = > = = > = = > = = > > = > > = > = > = > > = >\n",
" [ 85] Bearish | ID= 373561087563 | Ξ£ = < = < = = < = = < < = < = < < < = = < < < < < < = = < < < < < = < < = < = <\n",
" [ 86] Bullish | ID= 444857134536 | Ξ£ = = = > = = > > > = > > = > = = > = > > = = = > > > = = > = = > > > > = = > >\n",
" [ 87] Bearish | ID= 490743440237 | Ξ£ = = < < = < < = < < = = = < = < = < < = < = = < = < = = = = < = = < = = < < <\n",
" [ 88] Bearish | ID= 379217567217 | Ξ£ = = = = < < < < < = < < < = < < = = = = = < = = < < = < = = < = = = = < < = <\n",
" [ 89] Bullish | ID= 225620347090 | Ξ£ = > = = > = > > = = = > = = > = > = > = = = = = = = = > = = = > = = > = > > =\n",
" [ 90] Bearish | ID= 222579730557 | Ξ£ = = < < < < < = = = = < = < = = < = = < = = < < = < = = < = < < < < = = < < =\n",
" [ 91] Bearish | ID= 191729915761 | Ξ£ = = = = < < < = < < < = < = < = = < < < < < < < < < = = = < = < = = < < = < =\n",
" [ 92] Bearish | ID= 119739270581 | Ξ£ = = < = < < = < < = < = = = < = = = < = = = = = < = = = = < < < < < = < < = =\n",
" [ 93] Bullish | ID= 485971249076 | Ξ£ = = > = > > = > > > > = = = > > = = > = = > = = = > > = = > = = > = = = > > >\n",
" [ 94] Bearish | ID= 216427290349 | Ξ£ = = < < = < < < = < < < < = < = = < = = < = = = = = < = = < < = = < = = < < =\n",
" [ 95] Bearish | ID= 425495675577 | Ξ£ = = = < < < = < = < = = = = < < = = < = = = = < < = = = < = = = < < = = = < <\n",
" [ 96] Bearish | ID= 63855804407 | Ξ£ = < < = < < < < < < < < < < = = = < = < < = = = = < < < < = < < = < < < = = =\n",
" [ 97] Bearish | ID= 69480015969 | Ξ£ = = = = = < < = = = = < = < < < = = < = < = < = < = < < = < = = = = = = < = =\n",
" [ 98] Bearish | ID= 256615250465 | Ξ£ = = = = = < = = = < = < < < < < < = < = < < < = < < < < < < = < < < = < < < =\n",
" [ 99] Bullish | ID= 488221437982 | Ξ£ = > > > > = = = = = = = > > > > > > = = = = > = = = > > = > = > > = = = > > >\n",
" [100] Bearish | ID= 89681994059 | Ξ£ = < = < = = < = < = = = = < = < = < < = < < < = < = = = = < < < = = < = < = =\n",
"\n",
"==========================================================================\n",
" OUTPUT 3 β DEVELOPING POC CHARTS (100 patterns)\n",
"==========================================================================\n",
" [SAVED] TopoDevPOC_n39_100samples.png\n",
"\n",
" ASCII CLI Charts β first 10 samples (right side = C_0 = newest)\n",
"\n",
" [ 1] Bullish | ID=167790361200 | strict_moves=17/38\n",
" POC range: oldest=50 β newest=67\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" β βΒ·Β·Β·Β·β\n",
" β Β·βΒ·Β·ββ β\n",
" β Β·βββ β\n",
" β Β·ββ β\n",
" β Β·Β·Β·βΒ·Β·Β·βΒ·β β\n",
" β ββΒ·Β·Β·β β\n",
" βΒ·βΒ·Β·β β\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" Ξ£ (first 12): = = = > > > = = > = > > β¦\n",
"\n",
" [ 2] Bearish | ID=112296131307 | strict_moves=22/38\n",
" POC range: oldest=50 β newest=28\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" βΒ·Β·ββ β\n",
" β Β·βΒ·Β·Β·βΒ·Β·βΒ·β β\n",
" β Β·βΒ·βββ β\n",
" β βΒ·ββ β\n",
" β βββΒ·β β\n",
" β Β·βββΒ·β β\n",
" β Β·βΒ·β\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" Ξ£ (first 12): < = < = < < < = < = < < β¦\n",
"\n",
" [ 3] Bullish | ID=369064015028 | strict_moves=25/38\n",
" POC range: oldest=50 β newest=75\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" β βΒ·βΒ·Β·β\n",
" β βΒ·βΒ·Β·βΒ·β β\n",
" β Β·ββββ β\n",
" β ββΒ·ββ β\n",
" β Β·ββΒ·ββ β\n",
" β Β·ββββ β\n",
" ββΒ·βΒ·β β\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" Ξ£ (first 12): = > = > > = > = = > = > β¦\n",
"\n",
" [ 4] Bearish | ID=397679224723 | strict_moves=21/38\n",
" POC range: oldest=50 β newest=29\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" ββΒ·β β\n",
" β ββΒ·Β·βΒ·Β·β β\n",
" β Β·βββ β\n",
" β βΒ·Β·Β·Β·βββ β\n",
" β Β·ββΒ·Β·β β\n",
" β βββΒ·Β·β β\n",
" β Β·Β·βΒ·β\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" Ξ£ (first 12): < = = < = = < < < < = = β¦\n",
"\n",
" [ 5] Bullish | ID=37927295500 | strict_moves=14/38\n",
" POC range: oldest=50 β newest=64\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" β βΒ·Β·β\n",
" β Β·βΒ·Β·Β·Β·Β·β β\n",
" β Β·Β·ββ β\n",
" β Β·βΒ·Β·βΒ·Β·β β\n",
" β Β·βΒ·Β·β β\n",
" β βΒ·β β\n",
" βΒ·Β·Β·βΒ·Β·Β·β β\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" Ξ£ (first 12): = > > = = = = = > = > > β¦\n",
"\n",
" [ 6] Bullish | ID=286312365648 | strict_moves=19/38\n",
" POC range: oldest=50 β newest=69\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" β Β·βΒ·Β·Β·Β·β\n",
" β ββΒ·Β·β β\n",
" β βββ β\n",
" β Β·ββββ β\n",
" β Β·Β·ββΒ·Β·Β·β β\n",
" β Β·βΒ·βΒ·β β\n",
" ββΒ·Β·Β·Β·β β\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" Ξ£ (first 12): = = = > = > = = > > > > β¦\n",
"\n",
" [ 7] Bearish | ID=299333570369 | strict_moves=19/38\n",
" POC range: oldest=50 β newest=31\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" ββΒ·Β·Β·β β\n",
" β Β·ββΒ·β β\n",
" β βΒ·Β·Β·ββ β\n",
" β Β·βΒ·βΒ·ββ β\n",
" β ββΒ·Β·β β\n",
" β βββ β\n",
" β Β·βΒ·Β·Β·Β·Β·Β·β\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" Ξ£ (first 12): = = = = = < = < < < < = β¦\n",
"\n",
" [ 8] Bearish | ID=180886373753 | strict_moves=18/38\n",
" POC range: oldest=50 β newest=32\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" βΒ·βΒ·β β\n",
" β Β·βΒ·Β·Β·Β·ββ β\n",
" β βΒ·ββ β\n",
" β Β·βΒ·βΒ·β β\n",
" β βΒ·Β·Β·Β·Β·βΒ·β β\n",
" β Β·βββ β\n",
" β βΒ·Β·Β·β\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" Ξ£ (first 12): = = < < < < = < = < = = β¦\n",
"\n",
" [ 9] Bullish | ID=367632183586 | strict_moves=18/38\n",
" POC range: oldest=50 β newest=68\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" β Β·Β·Β·βΒ·β\n",
" β βΒ·Β·Β·βΒ·Β·β β\n",
" β βββ β\n",
" β Β·Β·βΒ·βΒ·β β\n",
" β Β·Β·ββΒ·Β·Β·β β\n",
" β Β·βΒ·ββ β\n",
" ββΒ·β β\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" Ξ£ (first 12): > = = = > = = > = = = > β¦\n",
"\n",
" [10] Bullish | ID=524916622536 | strict_moves=18/38\n",
" POC range: oldest=50 β newest=68\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" β Β·Β·βΒ·Β·Β·β\n",
" β Β·Β·Β·Β·Β·Β·Β·Β·βΒ·Β·ββ β\n",
" β βββ β\n",
" β ββΒ·β β\n",
" β Β·Β·Β·ββΒ·β β\n",
" β ββΒ·β β\n",
" βββ β\n",
" βββββββββββββββββββββββββββββββββββββββββ\n",
" Ξ£ (first 12): = = > = = > > = = > = = β¦\n",
"\n",
"==========================================================================\n",
" SUMMARY\n",
"==========================================================================\n",
" n (candles) = 39\n",
" Transitions per pattern = 38\n",
" Total patterns [2^39] = 549,755,813,888\n",
" Bullish [2^38] = 274,877,906,944\n",
" Bearish [2^38] = 274,877,906,944\n",
" Matrix B_n validated = 274,877,906,944 β\n",
" Samples generated = 100\n",
" Chart file = TopoDevPOC_n39_100samples.png\n",
" Compute device = cuda\n",
" Wall-clock (sample+decode) = 13032.35 ms\n",
"==========================================================================\n",
"\n",
" CONVERSION FORMULAS (tex Sec. V)\n",
" Symbolic β Ternary:\n",
" Bullish: '>' β +1, '=' β 0\n",
" Bearish: '<' β -1, '=' β 0\n",
" Ternary β Symbolic:\n",
" +1 β '>', 0 β '=', -1 β '<'\n",
"\n",
" TEMPORAL CONVENTION:\n",
" Chart x-axis: left = C_{-38} (oldest) β right = C_0 (newest)\n",
" Bullish pattern: POC non-increasing toward right (higher on left)\n",
" Bearish pattern: POC non-decreasing toward right (lower on left)\n",
"==========================================================================\n"
]
}
],
"source": [
"#!/usr/bin/env python3\n",
"\"\"\"\n",
"TopoDevPOC_n39.py\n",
"Topologically Unique Developing Point of Control Patterns\n",
"Pre-market K-Lines, n = 39 three-minute candlesticks\n",
"\n",
"Paper : TopoDevPOC.tex (ConQ Research Team, Continual Quasars)\n",
"Compute: Vectorized NumPy + GPU Torch (T4) + Warp branchless ops\n",
" Architectural patterns from core_engine_v11.py (Hyper-Warp Edition)\n",
"\n",
"Outputs (CLI):\n",
" 1. Total combination count for n=39\n",
" 2. Matrix state-transition validation\n",
" 3. 100 random ternary matrices (1Γ38 each)\n",
" 4. 100 random symbolic sequences (length-38 strings)\n",
" 5. 100 developing_poc charts saved as PNG + ASCII CLI preview\n",
"\n",
"Run on Google Colab T4:\n",
" !python TopoDevPOC_n39.py\n",
"\"\"\"\n",
"\n",
"# ββ stdlib ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"import os, sys, time, math\n",
"import numpy as np\n",
"\n",
"# ββ matplotlib (non-interactive for Colab CLI) ββββββββββββββββββββββββββββββββ\n",
"import matplotlib\n",
"matplotlib.use('Agg')\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib.ticker as mticker\n",
"\n",
"# ββ GPU setup (T4 Colab) βββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"try:\n",
" import torch\n",
" HAS_CUDA = torch.cuda.is_available()\n",
" DEVICE = 'cuda' if HAS_CUDA else 'cpu'\n",
"except ImportError:\n",
" HAS_CUDA = False\n",
" DEVICE = 'cpu'\n",
" torch = None\n",
"\n",
"# Optional Warp (core_engine_v11.py pattern) βββββββββββββββββββββββββββββββββ\n",
"HAS_WARP = False\n",
"try:\n",
" import warp as wp\n",
" wp.init()\n",
" wp.set_module_options({\"enable_backward\": False, \"fast_math\": True, \"max_unroll\": 8})\n",
" HAS_WARP = bool(wp.get_cuda_devices())\n",
"except Exception:\n",
" pass\n",
"\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"# CONSTANTS (tex Section II)\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"N = 39 # pre-market 3-min candles (C_0 β¦ C_{-(n-1)})\n",
"N_TRANS = N - 1 # 38 adjacent-pair relations\n",
"N_SAMPLES = 100\n",
"SEED = int(time.time() * 1000) & 0x7FFFFFFF\n",
"\n",
"SEP = \"=\" * 74\n",
"\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"# 0. HEADER\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"print(SEP)\n",
"print(\" TopoDevPOC β Developing POC Pattern Enumerator\")\n",
"print(f\" n = {N} candles | {N_TRANS} transitions | device = {DEVICE}\")\n",
"if HAS_CUDA and torch:\n",
" print(f\" GPU = {torch.cuda.get_device_name(0)}\")\n",
"if HAS_WARP:\n",
" print(f\" Warp = enabled (branchless kernel path)\")\n",
"print(SEP)\n",
"\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"# SECTION 1 β COMBINATORIAL ENUMERATION (tex Theorem, Sec. III)\n",
"#\n",
"# Bullish: each of (n-1) transitions β {>, =} β 2^(n-1) patterns\n",
"# Bearish: each of (n-1) transitions β {<, =} β 2^(n-1) patterns\n",
"# Total : 2^(n-1) + 2^(n-1) = 2^n (disjoint families)\n",
"# n=39 : 2^39 = 549,755,813,888\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"TOTAL = 1 << N # exact Python int (arbitrary precision)\n",
"HALF = 1 << (N - 1)\n",
"\n",
"print(f\"\\n[THEOREM] Total unique developing POC patterns for n={N}\")\n",
"print(f\" Bullish (non-increasing) : 2^{N-1} = {HALF:,}\")\n",
"print(f\" Bearish (non-decreasing) : 2^{N-1} = {HALF:,}\")\n",
"print(f\" Total (2^{N}) : {TOTAL:,}\")\n",
"\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"# SECTION 2 β MATRIX STATE-TRANSITION VALIDATION (tex Sec. IV)\n",
"#\n",
"# States : S_0 (equality), S_Β± (strict move)\n",
"# A = [[1,1],[1,1]] (fully-connected 2-state digraph)\n",
"# v_0 = [1,1]^T (both states reachable initially)\n",
"#\n",
"# B_n = 1^T Β· A^(n-2) Β· v_0\n",
"# = 2^(n-3) Β· 1^T Β· A Β· 1 (using A^k = 2^(k-1)Β·A for kβ₯1)\n",
"# = 2^(n-3) Β· 4 = 2^(n-1) per direction\n",
"#\n",
"# Implementation: exact Python-int matrix exponentiation (no float rounding)\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"\n",
"def _mm2(A, B):\n",
" \"\"\"Exact 2Γ2 matrix multiply with Python arbitrary-precision ints.\"\"\"\n",
" return [\n",
" [A[0][0]*B[0][0] + A[0][1]*B[1][0], A[0][0]*B[0][1] + A[0][1]*B[1][1]],\n",
" [A[1][0]*B[0][0] + A[1][1]*B[1][0], A[1][0]*B[0][1] + A[1][1]*B[1][1]],\n",
" ]\n",
"\n",
"def _mpow2(M, k):\n",
" \"\"\"Fast 2Γ2 matrix power, exact ints, O(log k).\"\"\"\n",
" if k == 0: return [[1,0],[0,1]]\n",
" if k == 1: return M\n",
" h = _mpow2(M, k >> 1)\n",
" s = _mm2(h, h)\n",
" return s if (k & 1) == 0 else _mm2(s, M)\n",
"\n",
"A_mat = [[1,1],[1,1]]\n",
"v0 = [1, 1]\n",
"A_pow = _mpow2(A_mat, N - 2)\n",
"# 1^T Β· A^(n-2) Β· v0\n",
"Av0_0 = A_pow[0][0]*v0[0] + A_pow[0][1]*v0[1]\n",
"Av0_1 = A_pow[1][0]*v0[0] + A_pow[1][1]*v0[1]\n",
"B_n = Av0_0 + Av0_1 # = 1^T Β· (A^(n-2)Β·v0)\n",
"\n",
"print(f\"\\n[MATRIX] A = [[1,1],[1,1]] | v_0 = [1,1]^T\")\n",
"print(f\" A^{N-2} = [[{A_pow[0][0]}, {A_pow[0][1]}],\")\n",
"print(f\" [{A_pow[1][0]}, {A_pow[1][1]}]]\")\n",
"print(f\" B_{N} = 1^T Β· A^{N-2} Β· v_0 = {B_n:,}\")\n",
"print(f\" Expected 2^{{n-1}} = {HALF:,}\")\n",
"assert B_n == HALF, f\"Matrix B_n mismatch: {B_n} β {HALF}\"\n",
"assert 2 * B_n == TOTAL, f\"Total mismatch: {2*B_n} β {TOTAL}\"\n",
"print(f\" [OK] 2 Γ {B_n:,} = {TOTAL:,} β\")\n",
"\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"# SECTION 3 β PATTERN ENCODING SCHEME\n",
"#\n",
"# Each of the 2^39 patterns maps bijectively to a 39-bit integer:\n",
"# bit 0 : direction (0 = Bullish, 1 = Bearish)\n",
"# bits 1 β¦ N-1 : transitions (1 = strict move, 0 = equality)\n",
"#\n",
"# pattern_id β [0, 2^39) uniquely identifies every valid pattern.\n",
"#\n",
"# Ternary matrix m β {+1,0}^(n-1) for bullish,\n",
"# m β {-1,0}^(n-1) for bearish.\n",
"# Bijection: m_k = sign(direction) Γ trans_bit_k\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"# SECTION 4 β GPU-ACCELERATED RANDOM SAMPLING\n",
"# Generate (N_SAMPLES Γ N) binary matrix at once on T4 GPU.\n",
"# Inspired by core_engine_v11.py XOR-shift PRNG kernel design.\n",
"# bits[:,0] = direction flags\n",
"# bits[:,1:] = N_TRANS transition flags per pattern\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"\n",
"t_sample = time.perf_counter()\n",
"\n",
"if HAS_WARP:\n",
" # ββ Warp branchless path (core_engine_v11.py style) βββββββββββββββββββββ\n",
" # Launch one thread per sample; XOR-shift fills N bits per thread.\n",
" _seed_wp = SEED\n",
"\n",
" @wp.kernel\n",
" def k_rng_bits(seed: int, N_cols: int,\n",
" out: wp.array(dtype=wp.int8)):\n",
" tid = wp.tid()\n",
" rng = wp.uint32(seed) ^ wp.uint32(tid)\n",
" if rng == wp.uint32(0):\n",
" rng = wp.uint32(123456789)\n",
" base = tid * N_cols\n",
" for col in range(N_cols):\n",
" rng = rng ^ (rng << wp.uint32(13))\n",
" rng = rng ^ (rng >> wp.uint32(17))\n",
" rng = rng ^ (rng << wp.uint32(5))\n",
" out[base + col] = wp.int8(int(rng) & 1)\n",
"\n",
" out_wp = wp.zeros(N_SAMPLES * N, dtype=wp.int8, device='cuda')\n",
" wp.launch(k_rng_bits, dim=N_SAMPLES, block_dim=128,\n",
" inputs=[_seed_wp, N, out_wp], device='cuda')\n",
" wp.synchronize()\n",
" bits_np = out_wp.numpy().reshape(N_SAMPLES, N)\n",
" print(f\"\\n[SAMPLE] {N_SAMPLES} patterns sampled via Warp XOR-shift kernel\")\n",
"\n",
"elif HAS_CUDA and torch is not None:\n",
" # ββ Torch GPU path βββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
" gen = torch.Generator(device='cuda')\n",
" gen.manual_seed(SEED)\n",
" bits_t = torch.randint(0, 2, (N_SAMPLES, N), device='cuda',\n",
" generator=gen, dtype=torch.int8)\n",
" bits_np = bits_t.cpu().numpy()\n",
" print(f\"\\n[SAMPLE] {N_SAMPLES} patterns sampled on GPU (torch.randint)\")\n",
"\n",
"else:\n",
" # ββ CPU NumPy fallback ββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
" rng_cpu = np.random.default_rng(SEED)\n",
" bits_np = rng_cpu.integers(0, 2, size=(N_SAMPLES, N), dtype=np.int8)\n",
" print(f\"\\n[SAMPLE] {N_SAMPLES} patterns sampled on CPU (NumPy)\")\n",
"\n",
"sample_ms = (time.perf_counter() - t_sample) * 1e3\n",
"print(f\" Sampling time: {sample_ms:.2f} ms\")\n",
"\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"# SECTION 5 β VECTORISED DECODING (NumPy, no Python loops over patterns)\n",
"#\n",
"# bits[:,0] β direction array (0=Bullish, 1=Bearish), shape (100,)\n",
"# bits[:,1:] β trans array, shape (100, 38)\n",
"# ternary_mat: +trans if Bullish, -trans if Bearish β shape (100, 38)\n",
"# sign: Bullishβ+1, Bearishβ-1, broadcast multiply\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"\n",
"dir_bits = bits_np[:, 0].astype(np.int8) # 0 or 1\n",
"trans = bits_np[:, 1:].astype(np.int8) # (100,38), values 0 or 1\n",
"signs = 1 - 2 * dir_bits # 0β+1 (bull), 1β-1 (bear)\n",
"ternary = (signs[:, None] * trans).astype(np.int8) # (100,38): +1/0/-1\n",
"\n",
"# Compact 39-bit pattern IDs\n",
"pows64 = (np.uint64(1) << np.arange(N, dtype=np.uint64))\n",
"pat_ids = (bits_np.astype(np.uint64) * pows64[None, :]).sum(axis=1)\n",
"\n",
"# Symbolic sequences: vectorised char lookup\n",
"# Bullish (sign=+1): trans=1 β '>', trans=0 β '='\n",
"# Bearish (sign=-1): trans=1 β '<', trans=0 β '='\n",
"SYM_BULL = np.array(['=', '>'], dtype='<U1') # index by trans bit\n",
"SYM_BEAR = np.array(['=', '<'], dtype='<U1')\n",
"sym_matrix = np.where(dir_bits[:, None] == 0,\n",
" SYM_BULL[trans],\n",
" SYM_BEAR[trans]) # (100, 38)\n",
"\n",
"# POC price sequence (right-to-left: p[0]=C_0=newest, p[N-1]=C_{-(N-1)}=oldest)\n",
"# p_raw[i, k] = POC of candle C_{-k} for sample i\n",
"# Transition k: p[k] = p[k+1] + ternary[k]\n",
"# Build by cumsum from oldestβnewest: p_raw[:, N-1] = 50, then forward\n",
"BASE = 50.0\n",
"step = 1.0\n",
"p_raw = np.zeros((N_SAMPLES, N), dtype=np.float32)\n",
"p_raw[:, N-1] = BASE\n",
"# Vectorised: cumulative sum of ternary (columns N-2 down to 0)\n",
"for k in range(N-2, -1, -1):\n",
" p_raw[:, k] = p_raw[:, k+1] + ternary[:, k].astype(np.float32) * step\n",
"\n",
"# Display order: oldest(left) β newest(right)\n",
"# poc_disp[:, j] = p_raw[:, N-1-j]\n",
"poc_disp = p_raw[:, ::-1].copy() # (100, 39), column 0=oldest, col N-1=newest\n",
"\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"# OUTPUT 1 β TERNARY MATRICES (100 Γ 38)\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"print(f\"\\n{SEP}\")\n",
"print(f\" OUTPUT 1 β TERNARY MATRICES (1Γ{N_TRANS}, values β {{-1,0,+1}})\")\n",
"print(f\" Format: [#] Direction | PatternID | M = [m_0 β¦ m_37]\")\n",
"print(SEP)\n",
"\n",
"for i in range(N_SAMPLES):\n",
" d_label = \"Bullish\" if dir_bits[i] == 0 else \"Bearish\"\n",
" pid = int(pat_ids[i])\n",
" row_str = np.array2string(ternary[i], separator=',',\n",
" max_line_width=400).replace('\\n','')\n",
" print(f\" [{i+1:3d}] {d_label:7s} | ID={pid:>15d} | M={row_str}\")\n",
"\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"# OUTPUT 2 β SYMBOLIC SEQUENCES (length 38)\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"print(f\"\\n{SEP}\")\n",
"print(f\" OUTPUT 2 β SYMBOLIC SEQUENCES (Ξ£, length {N_TRANS})\")\n",
"print(f\" Format: [#] Direction | PatternID | Ξ£ = Ο_0 Ο_1 β¦ Ο_37\")\n",
"print(SEP)\n",
"\n",
"for i in range(N_SAMPLES):\n",
" d_label = \"Bullish\" if dir_bits[i] == 0 else \"Bearish\"\n",
" pid = int(pat_ids[i])\n",
" seq_str = ' '.join(sym_matrix[i])\n",
" print(f\" [{i+1:3d}] {d_label:7s} | ID={pid:>15d} | Ξ£ = {seq_str}\")\n",
"\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"# OUTPUT 3 β CHARTS\n",
"# (a) Full matplotlib figure: 10Γ10 grid, saved to PNG\n",
"# (b) ASCII CLI preview for first 10 patterns\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"print(f\"\\n{SEP}\")\n",
"print(f\" OUTPUT 3 β DEVELOPING POC CHARTS (100 patterns)\")\n",
"print(SEP)\n",
"\n",
"# ββ x-axis: position 0=oldest C_{-(N-1)}, N-1=newest C_0 ββββββββββββββββββ\n",
"x_pos = np.arange(N, dtype=np.float32)\n",
"x_tick_pos = [0, 9, 19, 29, N-1]\n",
"x_tick_lbl = [f'C_{{-{N-1}}}', f'C_{{-29}}', f'C_{{-19}}', f'C_{{-9}}', 'C_0']\n",
"\n",
"ROWS, COLS = 10, 10\n",
"fig = plt.figure(figsize=(COLS * 3.2, ROWS * 2.0))\n",
"fig.suptitle(\n",
" f\"TopoDevPOC β 100 Random Developing POC Patterns \"\n",
" f\"n={N} pre-market 3-min K-lines\\n\"\n",
" f\"Total pattern space: 2^{N} = {TOTAL:,} \"\n",
" f\"(Bullish: {HALF:,} | Bearish: {HALF:,})\",\n",
" fontsize=10, y=1.005\n",
")\n",
"\n",
"for i in range(N_SAMPLES):\n",
" ax = fig.add_subplot(ROWS, COLS, i + 1)\n",
" poc = poc_disp[i]\n",
" is_bull = (dir_bits[i] == 0)\n",
" color = '#1a6eb5' if is_bull else '#c0392b'\n",
" label = 'Bβ' if is_bull else 'Bβ'\n",
"\n",
" # Background shade\n",
" ax.set_facecolor('#f7f9fc' if is_bull else '#fdf4f4')\n",
"\n",
" # POC line\n",
" ax.plot(x_pos, poc, color=color, linewidth=1.2, zorder=3)\n",
"\n",
" # Mark strict-move positions (non-zero ternary in display coords)\n",
" # Transition k corresponds to display segment [N-2-k, N-1-k]\n",
" # Highlight the newer-side node at display index N-1-k = N-1-k\n",
" strict_k = np.where(ternary[i] != 0)[0] # transition indices\n",
" strict_disp = (N - 1 - strict_k).astype(int) # display x-positions\n",
" if strict_disp.size > 0:\n",
" ax.scatter(strict_disp, poc[strict_disp],\n",
" color=color, s=5, zorder=5, linewidths=0)\n",
"\n",
" # Flat segments (equality)\n",
" flat_k = np.where(ternary[i] == 0)[0]\n",
" flat_disp = (N - 1 - flat_k).astype(int)\n",
" if flat_disp.size > 0:\n",
" ax.scatter(flat_disp, poc[flat_disp],\n",
" color='gray', s=3, zorder=4, linewidths=0, alpha=0.5)\n",
"\n",
" n_strict = int(np.abs(ternary[i]).sum())\n",
" pid_short = int(pat_ids[i]) % 10**9 # last 9 digits for readability\n",
" ax.set_title(f\"#{i+1} {label} mv={n_strict} β¦{pid_short:09d}\",\n",
" fontsize=5.5, pad=2, color=color)\n",
"\n",
" ax.set_xlim(-0.5, N - 0.5)\n",
" ax.set_xticks(x_tick_pos)\n",
" ax.set_xticklabels(['βold', '', '', '', 'newβ'], fontsize=3.5)\n",
" ax.tick_params(axis='y', labelsize=3.5)\n",
" ax.yaxis.set_major_locator(mticker.MaxNLocator(4))\n",
" for sp in ('top', 'right'):\n",
" ax.spines[sp].set_visible(False)\n",
" ax.spines['left'].set_color(color)\n",
" ax.spines['left'].set_linewidth(1.5)\n",
" ax.spines['bottom'].set_color('#cccccc')\n",
"\n",
"plt.tight_layout(rect=[0, 0, 1, 1])\n",
"chart_path = \"TopoDevPOC_n39_100samples.png\"\n",
"plt.savefig(chart_path, dpi=110, bbox_inches='tight')\n",
"plt.close(fig)\n",
"print(f\" [SAVED] {chart_path}\")\n",
"\n",
"# ββ ASCII CLI chart for first 10 patterns ββββββββββββββββββββββββββββββββββββ\n",
"H = 7 # chart height in rows\n",
"W = 39 # chart width = N\n",
"\n",
"print(f\"\\n ASCII CLI Charts β first 10 samples (right side = C_0 = newest)\\n\")\n",
"for i in range(10):\n",
" poc = poc_disp[i]\n",
" d_lbl = \"Bullish\" if dir_bits[i] == 0 else \"Bearish\"\n",
" pid = int(pat_ids[i])\n",
" n_mv = int(np.abs(ternary[i]).sum())\n",
" pmin, pmax = poc.min(), poc.max()\n",
" span = pmax - pmin if pmax != pmin else 1.0\n",
"\n",
" # Map each x-position to a row\n",
" rows = (H - 1 - ((poc - pmin) / span * (H - 1))).round().astype(int)\n",
" rows = np.clip(rows, 0, H - 1)\n",
"\n",
" grid = [[' '] * W for _ in range(H)]\n",
" for j in range(W):\n",
" r = rows[j]\n",
" # Strict-move node in the pair ending at display j:\n",
" # transition index k = N-1-j (if j < N-1)\n",
" is_strict = (j < N - 1) and (ternary[i, N - 2 - j] != 0)\n",
" grid[r][j] = 'β' if is_strict else 'Β·'\n",
" # Connect with horizontal dash where poc is flat\n",
" for row_idx in range(H):\n",
" line = grid[row_idx]\n",
" for j in range(1, W):\n",
" if line[j] == ' ' and rows[j] == row_idx:\n",
" line[j] = '-'\n",
"\n",
" print(f\" [{i+1:2d}] {d_lbl:7s} | ID={pid} | strict_moves={n_mv}/{N_TRANS}\")\n",
" poc_hi = poc[N-1]; poc_lo = poc[0]\n",
" print(f\" POC range: oldest={poc_lo:.0f} β newest={poc_hi:.0f}\")\n",
" print(f\" β{'β'*W}β\")\n",
" for row_idx in range(H):\n",
" print(f\" β{''.join(grid[row_idx])}β\")\n",
" print(f\" β{'β'*W}β\")\n",
" sym_preview = ' '.join(sym_matrix[i, :12]) + ' β¦'\n",
" print(f\" Ξ£ (first 12): {sym_preview}\\n\")\n",
"\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"# FINAL SUMMARY\n",
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
"total_ms = (time.perf_counter() - t_sample) * 1e3\n",
"print(SEP)\n",
"print(\" SUMMARY\")\n",
"print(SEP)\n",
"print(f\" n (candles) = {N}\")\n",
"print(f\" Transitions per pattern = {N_TRANS}\")\n",
"print(f\" Total patterns [2^{N}] = {TOTAL:,}\")\n",
"print(f\" Bullish [2^{N-1}] = {HALF:,}\")\n",
"print(f\" Bearish [2^{N-1}] = {HALF:,}\")\n",
"print(f\" Matrix B_n validated = {B_n:,} β\")\n",
"print(f\" Samples generated = {N_SAMPLES}\")\n",
"print(f\" Chart file = {chart_path}\")\n",
"print(f\" Compute device = {DEVICE}\")\n",
"print(f\" Wall-clock (sample+decode) = {total_ms:.2f} ms\")\n",
"print(SEP)\n",
"print()\n",
"print(\" CONVERSION FORMULAS (tex Sec. V)\")\n",
"print(\" Symbolic β Ternary:\")\n",
"print(\" Bullish: '>' β +1, '=' β 0\")\n",
"print(\" Bearish: '<' β -1, '=' β 0\")\n",
"print(\" Ternary β Symbolic:\")\n",
"print(\" +1 β '>', 0 β '=', -1 β '<'\")\n",
"print()\n",
"print(\" TEMPORAL CONVENTION:\")\n",
"print(f\" Chart x-axis: left = C_{{-{N-1}}} (oldest) β right = C_0 (newest)\")\n",
"print(\" Bullish pattern: POC non-increasing toward right (higher on left)\")\n",
"print(\" Bearish pattern: POC non-decreasing toward right (lower on left)\")\n",
"print(SEP)"
]
}
]
} |