Upload 5 files
Browse files- .gitattributes +2 -0
- TopoDevPOC.pdf +3 -0
- TopoDevPOC.tex +256 -0
- TopoDevPOC_n39.ipynb +882 -0
- TopoDevPOC_n39.py +423 -0
- TopoDevPOC_n39_100samples.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
TopoDevPOC_n39_100samples.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
TopoDevPOC.pdf filter=lfs diff=lfs merge=lfs -text
|
TopoDevPOC.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:437427eded07d75c64f043eef75d4431cb783c8fd66385da3fe66cb2f5f2696b
|
| 3 |
+
size 237270
|
TopoDevPOC.tex
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
\documentclass[conference]{IEEEtran}
|
| 2 |
+
\usepackage{amsmath, amssymb, amsthm}
|
| 3 |
+
\usepackage{graphicx}
|
| 4 |
+
\usepackage{array}
|
| 5 |
+
\usepackage{booktabs}
|
| 6 |
+
\usepackage{cite}
|
| 7 |
+
\usepackage{tikz}
|
| 8 |
+
\usepackage{xcolor}
|
| 9 |
+
|
| 10 |
+
% Theorem environments
|
| 11 |
+
\newtheorem{theorem}{Theorem}
|
| 12 |
+
\newtheorem{lemma}{Lemma}
|
| 13 |
+
\newtheorem{corollary}{Corollary}
|
| 14 |
+
\newtheorem{definition}{Definition}
|
| 15 |
+
\newtheorem{proposition}{Proposition}
|
| 16 |
+
|
| 17 |
+
\begin{document}
|
| 18 |
+
|
| 19 |
+
\title{TopoDevPOC: Topologically Unique Developing Poin of Control Patterns on Pre-market K-Lines}
|
| 20 |
+
|
| 21 |
+
\author{\IEEEauthorblockN{ConQ Research Team}\\
|
| 22 |
+
\IEEEauthorblockA{\textit{Continual Quasars}\\
|
| 23 |
+
\today}
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
\maketitle
|
| 27 |
+
|
| 28 |
+
\begin{abstract}
|
| 29 |
+
This paper establishes the exact combinatorial enumeration of all possible unique developing Point of Control (POC) line patterns observed during the pre-market session consisting of $n = 39$ three-minute candlesticks. Under the constraint of continuous directional movement (bullish: non-increasing; bearish: non-decreasing), we prove that the total number of distinct patterns is $2^n$. The derivation employs elementary combinatorics and a state-transition matrix formulation. Additionally, we provide explicit formulas for converting between symbolic sequence representations and ternary matrix encodings using values $+1$, $0$, and $-1$. Ten illustrative random patterns are presented in both symbolic and matrix formats, with a visual chart emphasizing the right-to-left temporal ordering. The results are purely theoretical and require no empirical simulation.
|
| 30 |
+
\end{abstract}
|
| 31 |
+
|
| 32 |
+
\begin{IEEEkeywords}
|
| 33 |
+
developing POC, combinatorial enumeration, candlestick patterns, monotonic sequences, transition matrix, pre-market analysis
|
| 34 |
+
\end{IEEEkeywords}
|
| 35 |
+
|
| 36 |
+
\section{Introduction}
|
| 37 |
+
|
| 38 |
+
The Point of Control (POC) is the price level at which the maximum volume is traded during a given time interval. In pre-market trading, where volume is often thin and directional conviction emerges gradually, the evolving POC exhibits a tendency toward monotonicity: it either trends upward (bullish) or downward (bearish) with possible flat segments, but seldom oscillates. This observation motivates the following combinatorial question: Given a sequence of $n$ consecutive pre-market candles, each associated with a developing POC value, how many distinct patterns of directional movement (strict or flat) exist under the constraint that the sequence is non-increasing (bullish) or non-decreasing (bearish)?
|
| 39 |
+
|
| 40 |
+
The present work provides a definitive answer to this question, with the following main contributions:
|
| 41 |
+
|
| 42 |
+
\begin{enumerate}
|
| 43 |
+
\item A closed-form enumeration showing that for $n$ candles there are exactly $2^n$ unique developing POC line patterns.
|
| 44 |
+
\item A matrix-based state-transition formulation that validates the combinatorial result.
|
| 45 |
+
\item Explicit formulas for converting a pattern between its symbolic sequence representation and a ternary matrix encoding using values $+1$ (strict up), $-1$ (strict down), and $0$ (equality).
|
| 46 |
+
\item A set of ten randomly generated pattern examples, displayed in both symbolic and ternary matrix forms, with a visual chart aligned to the correct right-to-left temporal order.
|
| 47 |
+
\end{enumerate}
|
| 48 |
+
|
| 49 |
+
The analysis is purely theoretical; no simulations, empirical data, or numerical approximations are employed.
|
| 50 |
+
|
| 51 |
+
\section{Problem Definition and Notation}
|
| 52 |
+
|
| 53 |
+
Let $n \in \mathbb{N}$ denote the number of candles. For the conventional pre-market session, $n = 39$. Index candles from most recent to oldest as
|
| 54 |
+
\begin{equation}
|
| 55 |
+
C_0, C_{-1}, C_{-2}, \dots, C_{-(n-1)}.
|
| 56 |
+
\end{equation}
|
| 57 |
+
The corresponding developing POC values form a sequence
|
| 58 |
+
\begin{equation}
|
| 59 |
+
\mathbf{p} = (p_0, p_1, \dots, p_{n-1}) \in \mathbb{R}^n,
|
| 60 |
+
\end{equation}
|
| 61 |
+
where $p_k$ denotes the POC value of candle $C_{-k}$.
|
| 62 |
+
|
| 63 |
+
\begin{definition}[Continuous Bullish Pattern]
|
| 64 |
+
A sequence $\mathbf{p}$ is a \emph{continuous bullish pattern} if for every $k = 0, 1, \dots, n-2$, the relation $R_k \in \{>, =\}$ holds between $p_k$ and $p_{k+1}$, i.e.,
|
| 65 |
+
\begin{equation}
|
| 66 |
+
p_k \geq p_{k+1}, \quad \text{with } p_k > p_{k+1} \text{ or } p_k = p_{k+1}.
|
| 67 |
+
\end{equation}
|
| 68 |
+
\end{definition}
|
| 69 |
+
|
| 70 |
+
\begin{definition}[Continuous Bearish Pattern]
|
| 71 |
+
A sequence $\mathbf{p}$ is a \emph{continuous bearish pattern} if for every $k = 0, 1, \dots, n-2$, the relation $R_k \in \{<, =\}$ holds between $p_k$ and $p_{k+1}$, i.e.,
|
| 72 |
+
\begin{equation}
|
| 73 |
+
p_k \leq p_{k+1}, \quad \text{with } p_k < p_{k+1} \text{ or } p_k = p_{k+1}.
|
| 74 |
+
\end{equation}
|
| 75 |
+
\end{definition}
|
| 76 |
+
|
| 77 |
+
A pattern is uniquely identified by the $(n-1)$-tuple of relations $(R_0, R_1, \dots, R_{n-2})$. Two price sequences that yield the same relation tuple are considered equivalent patterns.
|
| 78 |
+
|
| 79 |
+
\section{Combinatorial Enumeration}
|
| 80 |
+
|
| 81 |
+
\begin{theorem}
|
| 82 |
+
For any $n \ge 1$, the number of continuous bullish developing POC patterns of length $n$ is $2^{n-1}$. The number of continuous bearish patterns is also $2^{n-1}$. Consequently, the total number of distinct patterns is $2^n$.
|
| 83 |
+
\end{theorem}
|
| 84 |
+
|
| 85 |
+
\begin{proof}
|
| 86 |
+
For a bullish pattern, each adjacent pair $(p_k, p_{k+1})$ permits exactly two relations: $>$ or $=$. The $n-1$ choices are independent. Thus the number of bullish patterns is $2^{n-1}$. An identical argument applies to bearish patterns with relations $<$ and $=$. Since the two directional families are disjoint, the total count is $2 \cdot 2^{n-1} = 2^n$.
|
| 87 |
+
\end{proof}
|
| 88 |
+
|
| 89 |
+
For $n = 39$, the exact total number of unique patterns is
|
| 90 |
+
\begin{equation}
|
| 91 |
+
T_{39} = 2^{39}.
|
| 92 |
+
\end{equation}
|
| 93 |
+
|
| 94 |
+
\section{Matrix Formulation and State Transition}
|
| 95 |
+
|
| 96 |
+
Define a ternary state variable $m_k$ for each transition $k$ ($0 \le k \le n-2$) as follows:
|
| 97 |
+
\begin{itemize}
|
| 98 |
+
\item For a bullish pattern:
|
| 99 |
+
\begin{equation}
|
| 100 |
+
m_k = \begin{cases}
|
| 101 |
+
+1, & \text{if } R_k = \; >, \\
|
| 102 |
+
0, & \text{if } R_k = \; =.
|
| 103 |
+
\end{cases}
|
| 104 |
+
\end{equation}
|
| 105 |
+
\item For a bearish pattern:
|
| 106 |
+
\begin{equation}
|
| 107 |
+
m_k = \begin{cases}
|
| 108 |
+
-1, & \text{if } R_k = \; <, \\
|
| 109 |
+
0, & \text{if } R_k = \; =.
|
| 110 |
+
\end{cases}
|
| 111 |
+
\end{equation}
|
| 112 |
+
\end{itemize}
|
| 113 |
+
Note that in either directional family, the allowed values are either $\{+1, 0\}$ (bullish) or $\{-1, 0\}$ (bearish). Consequently, a pattern is equivalent to a ternary vector of length $n-1$:
|
| 114 |
+
\begin{equation}
|
| 115 |
+
\mathbf{m} = (m_0, m_1, \dots, m_{n-2}) \in \{-1,0,+1\}^{n-1},
|
| 116 |
+
\end{equation}
|
| 117 |
+
subject to the constraint that all nonzero entries share the same sign.
|
| 118 |
+
|
| 119 |
+
\subsection{Transition Matrix Representation}
|
| 120 |
+
|
| 121 |
+
Consider the directed graph with two states $\{S_0, S_{\pm}\}$ corresponding to the last observed relation being equality ($S_0$) or strict move ($S_{\pm}$, with sign determined by direction). Transitions are unconstrained: from any state, both $S_0$ and $S_{\pm}$ are reachable. The adjacency matrix is
|
| 122 |
+
\begin{equation}
|
| 123 |
+
\mathbf{A} = \begin{pmatrix}
|
| 124 |
+
1 & 1 \\
|
| 125 |
+
1 & 1
|
| 126 |
+
\end{pmatrix}.
|
| 127 |
+
\end{equation}
|
| 128 |
+
Let $\mathbf{v}_0 = (1,1)^\top$ be the initial vector (both states permissible before any comparison). The number of patterns with $n$ candles (i.e., $n-1$ transitions) is
|
| 129 |
+
\begin{equation}
|
| 130 |
+
B_n = \mathbf{1}^\top \mathbf{A}^{n-2} \mathbf{v}_0,
|
| 131 |
+
\end{equation}
|
| 132 |
+
where $\mathbf{1} = (1,1)^\top$. Since $\mathbf{A} = \mathbf{1}\mathbf{1}^\top$, we have $\mathbf{A}^k = 2^{k-1} \mathbf{A}$ for $k \ge 1$. Hence,
|
| 133 |
+
\begin{align}
|
| 134 |
+
B_n &= \mathbf{1}^\top \left( 2^{n-3} \mathbf{A} \right) \mathbf{v}_0 \nonumber \\
|
| 135 |
+
&= 2^{n-3} \mathbf{1}^\top \mathbf{A} \mathbf{1} \nonumber \\
|
| 136 |
+
&= 2^{n-3} \cdot 4 = 2^{n-1}.
|
| 137 |
+
\end{align}
|
| 138 |
+
This matrix derivation confirms the combinatorial count independently.
|
| 139 |
+
|
| 140 |
+
\section{Conversion Between Symbolic Sequence and Ternary Matrix}
|
| 141 |
+
|
| 142 |
+
We establish bidirectional conversion formulas between the symbolic sequence representation (a string of symbols $>$ and $=$, or $<$ and $=$) and the ternary matrix (row vector) encoding.
|
| 143 |
+
|
| 144 |
+
\subsection{Symbolic Sequence to Ternary Matrix}
|
| 145 |
+
|
| 146 |
+
Let $\Sigma$ be a string of length $n-1$ over alphabet $\{>, =\}$ for bullish, or $\{<, =\}$ for bearish. Define the mapping $f$:
|
| 147 |
+
\begin{align}
|
| 148 |
+
f_{\text{bullish}}(>) &= +1, & f_{\text{bullish}}(=) &= 0, \\
|
| 149 |
+
f_{\text{bearish}}(<) &= -1, & f_{\text{bearish}}(=) &= 0.
|
| 150 |
+
\end{align}
|
| 151 |
+
The ternary matrix $\mathbf{M}$ of size $1 \times (n-1)$ is given by
|
| 152 |
+
\begin{equation}
|
| 153 |
+
\mathbf{M}_{1,j+1} = f(\Sigma_j), \quad j = 0,1,\dots,n-2.
|
| 154 |
+
\end{equation}
|
| 155 |
+
That is, $\mathbf{M} = \begin{pmatrix} f(\Sigma_0) & f(\Sigma_1) & \cdots & f(\Sigma_{n-2}) \end{pmatrix}$.
|
| 156 |
+
|
| 157 |
+
\subsection{Ternary Matrix to Symbolic Sequence}
|
| 158 |
+
|
| 159 |
+
Conversely, given a ternary row matrix $\mathbf{M} = (m_0, m_1, \dots, m_{n-2})$ with $m_j \in \{+1,0\}$ for bullish or $\{-1,0\}$ for bearish, the symbolic sequence is obtained by applying the inverse mapping $g$:
|
| 160 |
+
\begin{align}
|
| 161 |
+
g_{\text{bullish}}(+1) &= >, & g_{\text{bullish}}(0) &= =, \\
|
| 162 |
+
g_{\text{bearish}}(-1) &= <, & g_{\text{bearish}}(0) &= =.
|
| 163 |
+
\end{align}
|
| 164 |
+
Formally,
|
| 165 |
+
\begin{equation}
|
| 166 |
+
\Sigma_j = g(m_j),
|
| 167 |
+
\end{equation}
|
| 168 |
+
and the sequence is $\Sigma = \Sigma_0 \Sigma_1 \cdots \Sigma_{n-2}$.
|
| 169 |
+
|
| 170 |
+
These conversions are one-to-one and preserve pattern identity.
|
| 171 |
+
|
| 172 |
+
\section{Illustrative Examples}
|
| 173 |
+
|
| 174 |
+
We present ten randomly generated continuous developing POC patterns. For compactness, we use $n = 6$ candles (5 transitions). Each pattern is displayed with its directional label, symbolic sequence, and the corresponding $1 \times 5$ ternary matrix.
|
| 175 |
+
|
| 176 |
+
\subsection{Example Patterns}
|
| 177 |
+
|
| 178 |
+
\begin{table}[h]
|
| 179 |
+
\centering
|
| 180 |
+
\caption{Ten Random Continuous Developing POC Patterns ($n=6$)}
|
| 181 |
+
\label{tab:examples}
|
| 182 |
+
\begin{tabular}{c c c c}
|
| 183 |
+
\toprule
|
| 184 |
+
\textbf{ID} & \textbf{Direction} & \textbf{Symbolic Sequence} & \textbf{Ternary Matrix ($1 \times 5$)} \\
|
| 185 |
+
\midrule
|
| 186 |
+
1 & Bullish & $> \; > \; = \; > \; =$ & $\begin{pmatrix}+1 & +1 & 0 & +1 & 0\end{pmatrix}$ \\
|
| 187 |
+
2 & Bullish & $= \; > \; = \; = \; >$ & $\begin{pmatrix}0 & +1 & 0 & 0 & +1\end{pmatrix}$ \\
|
| 188 |
+
3 & Bearish & $< \; = \; < \; < \; =$ & $\begin{pmatrix}-1 & 0 & -1 & -1 & 0\end{pmatrix}$ \\
|
| 189 |
+
4 & Bearish & $= \; = \; < \; = \; <$ & $\begin{pmatrix}0 & 0 & -1 & 0 & -1\end{pmatrix}$ \\
|
| 190 |
+
5 & Bullish & $> \; = \; = \; > \; >$ & $\begin{pmatrix}+1 & 0 & 0 & +1 & +1\end{pmatrix}$ \\
|
| 191 |
+
6 & Bullish & $= \; > \; > \; = \; >$ & $\begin{pmatrix}0 & +1 & +1 & 0 & +1\end{pmatrix}$ \\
|
| 192 |
+
7 & Bearish & $< \; < \; = \; = \; <$ & $\begin{pmatrix}-1 & -1 & 0 & 0 & -1\end{pmatrix}$ \\
|
| 193 |
+
8 & Bearish & $= \; < \; = \; < \; =$ & $\begin{pmatrix}0 & -1 & 0 & -1 & 0\end{pmatrix}$ \\
|
| 194 |
+
9 & Bullish & $> \; > \; > \; = \; =$ & $\begin{pmatrix}+1 & +1 & +1 & 0 & 0\end{pmatrix}$ \\
|
| 195 |
+
10 & Bearish & $< \; = \; = \; = \; <$ & $\begin{pmatrix}-1 & 0 & 0 & 0 & -1\end{pmatrix}$ \\
|
| 196 |
+
\bottomrule
|
| 197 |
+
\end{tabular}
|
| 198 |
+
\end{table}
|
| 199 |
+
|
| 200 |
+
\subsection{Visual Chart with Correct Temporal Ordering}
|
| 201 |
+
|
| 202 |
+
The temporal axis is oriented from right to left, aligning with the index convention $C_0$ (current candle, $t=0$) at the rightmost position, followed by $C_{-1}$, $C_{-2}$, etc., proceeding leftwards. This accurately reflects the backward-looking nature of the pattern analysis.
|
| 203 |
+
|
| 204 |
+
Figure~\ref{fig:pattern1} depicts Pattern 1 (Bullish: $> \; > \; = \; > \; =$) with this right-to-left orientation. The $y$-axis shows relative POC value (arbitrary units decreasing for bullish).
|
| 205 |
+
|
| 206 |
+
\begin{figure}[h]
|
| 207 |
+
\centering
|
| 208 |
+
\begin{tikzpicture}[scale=0.6]
|
| 209 |
+
% x-axis reversed: 0 on the right, negative indices to the left
|
| 210 |
+
\draw[->] (0,0) -- (6,0) node[right] {$t$ (candle index)};
|
| 211 |
+
\draw[->] (0,0) -- (0,5) node[above] {POC};
|
| 212 |
+
% Labels: C_0 at x=5, C_{-1} at x=4, ..., C_{-5} at x=0
|
| 213 |
+
\foreach \x in {0,1,2,3,4,5} {
|
| 214 |
+
\pgfmathtruncatemacro{\idx}{-\x}
|
| 215 |
+
\draw (5-\x,0.1) -- (5-\x,-0.1) node[below] {\small $C_{\idx}$};
|
| 216 |
+
}
|
| 217 |
+
% Pattern: > > = > =
|
| 218 |
+
% Starting value 5, then steps: -1, -1, 0, -1, 0
|
| 219 |
+
% Plot from right to left: C_0 (x=5, y=5), C_{-1} (x=4, y=4), ...
|
| 220 |
+
\draw[thick, blue] (5,5) -- (4,4) -- (3,3) -- (2,3) -- (1,2) -- (0,2);
|
| 221 |
+
\filldraw (5,5) circle (2pt) (4,4) circle (2pt) (3,3) circle (2pt) (2,3) circle (2pt) (1,2) circle (2pt) (0,2) circle (2pt);
|
| 222 |
+
% Annotate relations between points (placed near the line segment)
|
| 223 |
+
\node[anchor=south] at (4.5,4.5) {$>$};
|
| 224 |
+
\node[anchor=south] at (3.5,3.5) {$>$};
|
| 225 |
+
\node[anchor=south] at (2.5,3) {$=$};
|
| 226 |
+
\node[anchor=south] at (1.5,2.5) {$>$};
|
| 227 |
+
\node[anchor=south] at (0.5,2) {$=$};
|
| 228 |
+
\end{tikzpicture}
|
| 229 |
+
\caption{Visualization of Bullish Pattern 1: $> > = > =$. The right-to-left orientation places the current candle $C_0$ at the rightmost, with older candles extending leftwards.}
|
| 230 |
+
\label{fig:pattern1}
|
| 231 |
+
\end{figure}
|
| 232 |
+
|
| 233 |
+
\section{Discussion and Consistency Verification}
|
| 234 |
+
|
| 235 |
+
The enumeration $2^{39}$ demonstrates the vast theoretical space of possible continuous developing POC patterns during the pre-market session. Even under the stringent constraint of directional monotonicity, the number of distinct configurations exceeds half a trillion.
|
| 236 |
+
|
| 237 |
+
The ternary matrix representation using $+1$, $0$, and $-1$ provides a compact, signed encoding that inherently encodes both the direction (sign) and the presence of a strict move. This representation is fully consistent with the symbolic sequences and the combinatorial count. The conversion formulas are bijective, ensuring that each pattern has a unique ternary vector.
|
| 238 |
+
|
| 239 |
+
The state-transition matrix derivation independently confirms the count $2^{n-1}$ per direction, serving as a cross-check of the combinatorial proof. Moreover, the examples demonstrate that patterns may contain any number of equalities, including the extreme case of all $=$ symbols (ternary matrix of all zeros), which corresponds to a completely flat developing POC line.
|
| 240 |
+
|
| 241 |
+
The chart orientation (right to left) aligns with the temporal indexing convention and aids in intuitive interpretation by placing the most recent information at the viewer's natural scanning direction.
|
| 242 |
+
|
| 243 |
+
Extensions of this work may consider patterns where the number of consecutive equalities is bounded, or where transition probabilities are non-uniform. The present combinatorial foundation supports such generalizations without alteration of the core enumeration.
|
| 244 |
+
|
| 245 |
+
\section{Conclusion}
|
| 246 |
+
|
| 247 |
+
We have determined that the total number of unique continuous developing POC line patterns for a sequence of $n$ pre-market candlesticks is $2^n$, with exactly $2^{39}$ patterns for the conventional $n=39$ session. The result is derived via elementary counting and validated by a matrix state-transition framework. Formulas for interconversion between symbolic sequences and ternary matrices (using $+1$, $0$, $-1$) are provided, along with ten illustrative random patterns and a correctly oriented visual chart. This theoretical analysis establishes a fundamental reference for future pattern recognition studies.
|
| 248 |
+
|
| 249 |
+
\begin{thebibliography}{1}
|
| 250 |
+
\bibitem{marketprofile}
|
| 251 |
+
J. F. Dalton, \emph{Mind Over Markets: Power Trading with Market Generated Information}. Marketplace Books, 2013.
|
| 252 |
+
\bibitem{combinatorics}
|
| 253 |
+
R. P. Stanley, \emph{Enumerative Combinatorics}, vol. 1, 2nd ed. Cambridge University Press, 2011.
|
| 254 |
+
\end{thebibliography}
|
| 255 |
+
|
| 256 |
+
\end{document}
|
TopoDevPOC_n39.ipynb
ADDED
|
@@ -0,0 +1,882 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"nbformat": 4,
|
| 3 |
+
"nbformat_minor": 0,
|
| 4 |
+
"metadata": {
|
| 5 |
+
"colab": {
|
| 6 |
+
"provenance": [],
|
| 7 |
+
"gpuType": "T4"
|
| 8 |
+
},
|
| 9 |
+
"kernelspec": {
|
| 10 |
+
"name": "python3",
|
| 11 |
+
"display_name": "Python 3"
|
| 12 |
+
},
|
| 13 |
+
"language_info": {
|
| 14 |
+
"name": "python"
|
| 15 |
+
},
|
| 16 |
+
"accelerator": "GPU"
|
| 17 |
+
},
|
| 18 |
+
"cells": [
|
| 19 |
+
{
|
| 20 |
+
"cell_type": "code",
|
| 21 |
+
"source": [
|
| 22 |
+
"!pip -q install numpy matplotlib warp-lang torch"
|
| 23 |
+
],
|
| 24 |
+
"metadata": {
|
| 25 |
+
"colab": {
|
| 26 |
+
"base_uri": "https://localhost:8080/"
|
| 27 |
+
},
|
| 28 |
+
"id": "6nCegUGTE8jg",
|
| 29 |
+
"outputId": "f5a7ce52-8c68-4867-f906-f6a572caf491"
|
| 30 |
+
},
|
| 31 |
+
"execution_count": 1,
|
| 32 |
+
"outputs": [
|
| 33 |
+
{
|
| 34 |
+
"output_type": "stream",
|
| 35 |
+
"name": "stdout",
|
| 36 |
+
"text": [
|
| 37 |
+
"\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",
|
| 38 |
+
"\u001b[?25h"
|
| 39 |
+
]
|
| 40 |
+
}
|
| 41 |
+
]
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"cell_type": "code",
|
| 45 |
+
"execution_count": 1,
|
| 46 |
+
"metadata": {
|
| 47 |
+
"colab": {
|
| 48 |
+
"base_uri": "https://localhost:8080/"
|
| 49 |
+
},
|
| 50 |
+
"id": "OhI3LExdEd0t",
|
| 51 |
+
"outputId": "28967416-10ef-4f44-e3ad-e4743cfdc491"
|
| 52 |
+
},
|
| 53 |
+
"outputs": [
|
| 54 |
+
{
|
| 55 |
+
"output_type": "stream",
|
| 56 |
+
"name": "stdout",
|
| 57 |
+
"text": [
|
| 58 |
+
"==========================================================================\n",
|
| 59 |
+
" TopoDevPOC β Developing POC Pattern Enumerator\n",
|
| 60 |
+
" n = 39 candles | 38 transitions | device = cuda\n",
|
| 61 |
+
" GPU = Tesla T4\n",
|
| 62 |
+
"==========================================================================\n",
|
| 63 |
+
"\n",
|
| 64 |
+
"[THEOREM] Total unique developing POC patterns for n=39\n",
|
| 65 |
+
" Bullish (non-increasing) : 2^38 = 274,877,906,944\n",
|
| 66 |
+
" Bearish (non-decreasing) : 2^38 = 274,877,906,944\n",
|
| 67 |
+
" Total (2^39) : 549,755,813,888\n",
|
| 68 |
+
"\n",
|
| 69 |
+
"[MATRIX] A = [[1,1],[1,1]] | v_0 = [1,1]^T\n",
|
| 70 |
+
" A^37 = [[68719476736, 68719476736],\n",
|
| 71 |
+
" [68719476736, 68719476736]]\n",
|
| 72 |
+
" B_39 = 1^T Β· A^37 Β· v_0 = 274,877,906,944\n",
|
| 73 |
+
" Expected 2^{n-1} = 274,877,906,944\n",
|
| 74 |
+
" [OK] 2 Γ 274,877,906,944 = 549,755,813,888 β\n",
|
| 75 |
+
"\n",
|
| 76 |
+
"[SAMPLE] 100 patterns sampled on GPU (torch.randint)\n",
|
| 77 |
+
" Sampling time: 276.10 ms\n",
|
| 78 |
+
"\n",
|
| 79 |
+
"==========================================================================\n",
|
| 80 |
+
" OUTPUT 1 β TERNARY MATRICES (1Γ38, values β {-1,0,+1})\n",
|
| 81 |
+
" Format: [#] Direction | PatternID | M = [m_0 β¦ m_37]\n",
|
| 82 |
+
"==========================================================================\n",
|
| 83 |
+
" [ 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",
|
| 84 |
+
" [ 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",
|
| 85 |
+
" [ 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",
|
| 86 |
+
" [ 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",
|
| 87 |
+
" [ 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",
|
| 88 |
+
" [ 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",
|
| 89 |
+
" [ 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",
|
| 90 |
+
" [ 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",
|
| 91 |
+
" [ 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",
|
| 92 |
+
" [ 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",
|
| 93 |
+
" [ 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",
|
| 94 |
+
" [ 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",
|
| 95 |
+
" [ 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",
|
| 96 |
+
" [ 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",
|
| 97 |
+
" [ 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",
|
| 98 |
+
" [ 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",
|
| 99 |
+
" [ 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",
|
| 100 |
+
" [ 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",
|
| 101 |
+
" [ 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",
|
| 102 |
+
" [ 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",
|
| 103 |
+
" [ 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",
|
| 104 |
+
" [ 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",
|
| 105 |
+
" [ 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",
|
| 106 |
+
" [ 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",
|
| 107 |
+
" [ 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",
|
| 108 |
+
" [ 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",
|
| 109 |
+
" [ 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",
|
| 110 |
+
" [ 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",
|
| 111 |
+
" [ 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",
|
| 112 |
+
" [ 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",
|
| 113 |
+
" [ 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",
|
| 114 |
+
" [ 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",
|
| 115 |
+
" [ 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",
|
| 116 |
+
" [ 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",
|
| 117 |
+
" [ 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",
|
| 118 |
+
" [ 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",
|
| 119 |
+
" [ 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",
|
| 120 |
+
" [ 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",
|
| 121 |
+
" [ 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",
|
| 122 |
+
" [ 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",
|
| 123 |
+
" [ 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",
|
| 124 |
+
" [ 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",
|
| 125 |
+
" [ 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",
|
| 126 |
+
" [ 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",
|
| 127 |
+
" [ 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",
|
| 128 |
+
" [ 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",
|
| 129 |
+
" [ 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",
|
| 130 |
+
" [ 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",
|
| 131 |
+
" [ 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",
|
| 132 |
+
" [ 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",
|
| 133 |
+
" [ 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",
|
| 134 |
+
" [ 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",
|
| 135 |
+
" [ 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",
|
| 136 |
+
" [ 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",
|
| 137 |
+
" [ 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",
|
| 138 |
+
" [ 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",
|
| 139 |
+
" [ 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",
|
| 140 |
+
" [ 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",
|
| 141 |
+
" [ 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",
|
| 142 |
+
" [ 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",
|
| 143 |
+
" [ 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",
|
| 144 |
+
" [ 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",
|
| 145 |
+
" [ 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",
|
| 146 |
+
" [ 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",
|
| 147 |
+
" [ 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",
|
| 148 |
+
" [ 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",
|
| 149 |
+
" [ 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",
|
| 150 |
+
" [ 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",
|
| 151 |
+
" [ 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",
|
| 152 |
+
" [ 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",
|
| 153 |
+
" [ 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",
|
| 154 |
+
" [ 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",
|
| 155 |
+
" [ 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",
|
| 156 |
+
" [ 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",
|
| 157 |
+
" [ 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",
|
| 158 |
+
" [ 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",
|
| 159 |
+
" [ 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",
|
| 160 |
+
" [ 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",
|
| 161 |
+
" [ 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",
|
| 162 |
+
" [ 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",
|
| 163 |
+
" [ 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",
|
| 164 |
+
" [ 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",
|
| 165 |
+
" [ 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",
|
| 166 |
+
" [ 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",
|
| 167 |
+
" [ 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",
|
| 168 |
+
" [ 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",
|
| 169 |
+
" [ 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",
|
| 170 |
+
" [ 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",
|
| 171 |
+
" [ 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",
|
| 172 |
+
" [ 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",
|
| 173 |
+
" [ 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",
|
| 174 |
+
" [ 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",
|
| 175 |
+
" [ 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",
|
| 176 |
+
" [ 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",
|
| 177 |
+
" [ 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",
|
| 178 |
+
" [ 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",
|
| 179 |
+
" [ 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",
|
| 180 |
+
" [ 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",
|
| 181 |
+
" [ 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",
|
| 182 |
+
" [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",
|
| 183 |
+
"\n",
|
| 184 |
+
"==========================================================================\n",
|
| 185 |
+
" OUTPUT 2 β SYMBOLIC SEQUENCES (Ξ£, length 38)\n",
|
| 186 |
+
" Format: [#] Direction | PatternID | Ξ£ = Ο_0 Ο_1 β¦ Ο_37\n",
|
| 187 |
+
"==========================================================================\n",
|
| 188 |
+
" [ 1] Bullish | ID= 167790361200 | Ξ£ = = = = > > > = = > = > > > = > > = > = > = = = > = = = > = = = > > > = = > =\n",
|
| 189 |
+
" [ 2] Bearish | ID= 112296131307 | Ξ£ = < = < = < < < = < = < < < < < = < < < < = < = < = < = = < = = = < = < < = =\n",
|
| 190 |
+
" [ 3] Bullish | ID= 369064015028 | Ξ£ = = > = > > = > = = > = > > > > > = > > = > > > > = > > = > > > > = > = > = >\n",
|
| 191 |
+
" [ 4] Bearish | ID= 397679224723 | Ξ£ = < = = < = = < < < < = = < < = < < < = = = = < < < < = < = = < = = < < < = <\n",
|
| 192 |
+
" [ 5] Bullish | ID= 37927295500 | Ξ£ = = > > = = = = = > = > > = = > = = > = = > = > = = > = > = > > = = = > = = =\n",
|
| 193 |
+
" [ 6] Bullish | ID= 286312365648 | Ξ£ = = = = > = > = = > > > > > > > > > = > = = = > > = = > = > = > = > = = = = >\n",
|
| 194 |
+
" [ 7] Bearish | ID= 299333570369 | Ξ£ = = = = = = < = < < < < = = < < < < = < = < = < < = = = < < = < < = < = = = <\n",
|
| 195 |
+
" [ 8] Bearish | ID= 180886373753 | Ξ£ = = = < < < < = < = < = = = = = < < = < = < = < < = < < < = = = = < = < = < =\n",
|
| 196 |
+
" [ 9] Bullish | ID= 367632183586 | Ξ£ = > = = = > = = > = = = > > > > > = > = > = = > = = = > > = = > > = > = > = >\n",
|
| 197 |
+
" [ 10] Bullish | ID= 524916622536 | Ξ£ = = = > = = > > = = > = = = = = = = = > > > > = > > > = > > = = = > = > > > >\n",
|
| 198 |
+
" [ 11] Bullish | ID= 31775345360 | Ξ£ = = = = > = > > = > = > = = > = > = > = > > > > > = > = = > > = > > > = = = =\n",
|
| 199 |
+
" [ 12] Bullish | ID= 425035078904 | Ξ£ = = = > > > > > = = > > > = = > = = = = > = = = = > > = > > > > = > = = = > >\n",
|
| 200 |
+
" [ 13] Bullish | ID= 220258295520 | Ξ£ = = = = = > > > = > > > > = > > = > = > = > > = = = = > = = > = > > = = > > =\n",
|
| 201 |
+
" [ 14] Bearish | ID= 369470979075 | Ξ£ = < = = = = = = = = < < < < = < < < < < = < = = = < < = = = = = = < < = < = <\n",
|
| 202 |
+
" [ 15] Bearish | ID= 318324601329 | Ξ£ = = = = < < < < < = = = < < < < < < < < < = = < < = < < < = = = = < = < = = <\n",
|
| 203 |
+
" [ 16] Bearish | ID= 147404907673 | Ξ£ = = = < < = = < = = < = = < < = = = < = = = = = = < = = < = < = = < = = = < =\n",
|
| 204 |
+
" [ 17] Bearish | ID= 371069085929 | Ξ£ = = = < = < < < = = = < = < < < = = = = < < < = < = < = = < < = = < < = < = <\n",
|
| 205 |
+
" [ 18] Bearish | ID= 2330012161 | Ξ£ = = = = = = = = = < = < = < = = < = = = = < < < = < = < = = = < = = = = = = =\n",
|
| 206 |
+
" [ 19] Bearish | ID= 419107634965 | Ξ£ = = < = < = = = < < < < < < < < = < = = = = < < = = < = < = = < < = = = = < <\n",
|
| 207 |
+
" [ 20] Bullish | ID= 479318507150 | Ξ£ = > > > = = = > = > > > > > > > > > = > > = = > > = = > > = = > > > > > = > >\n",
|
| 208 |
+
" [ 21] Bearish | ID= 319608669591 | Ξ£ = < < = < = = < < = < = = = < = < = = < = < = = = < = < = < < = = < = < = = <\n",
|
| 209 |
+
" [ 22] Bullish | ID= 534756389730 | Ξ£ = > = = = > > = > > = = > > > > = > > = > > > > > = = = = = = > = = > > > > >\n",
|
| 210 |
+
" [ 23] Bullish | ID= 234063416010 | Ξ£ = > = > = = > > = > = > = = > = = = > = = = > = > > > > > > > = = > > = > > =\n",
|
| 211 |
+
" [ 24] Bullish | ID= 259589951898 | Ξ£ = > = > > = = > > = = = > = > = = = > = = = > > = = = = > > > = = = > > > > =\n",
|
| 212 |
+
" [ 25] Bullish | ID= 33069957648 | Ξ£ = = = = > = = = = > = = = = = > > > > > > = = = > > = = > > = > > > > = = = =\n",
|
| 213 |
+
" [ 26] Bullish | ID= 386376948582 | Ξ£ = > > = = > > = > > = > > = > = = = > > > = > > > = > = > > > > > = = > > = >\n",
|
| 214 |
+
" [ 27] Bearish | ID= 137526752343 | Ξ£ = < < = < = < = = = < = < < = < < < = < < < = = < = < = = = = = = = = = = < =\n",
|
| 215 |
+
" [ 28] Bearish | ID= 466989440093 | Ξ£ = = < < < = < = = = < < < = < = < = < < < < = < = < = < < < = < = = < < = < <\n",
|
| 216 |
+
" [ 29] Bearish | ID= 30541739875 | Ξ£ = < = = = < < = < < < = < < < < < = < < = < < = = = < < < = = = < < < = = = =\n",
|
| 217 |
+
" [ 30] Bullish | ID= 256289197764 | Ξ£ = = > = = = > > = > > > = = > > = > > = = = = = = = > > = > = > > > = > > > =\n",
|
| 218 |
+
" [ 31] Bullish | ID= 463423679574 | Ξ£ = > > = > = > = = = > > = > = = = = > = > > = = = > > = = > > > > > = > = > >\n",
|
| 219 |
+
" [ 32] Bearish | ID= 269170438337 | Ξ£ = = = = = = < < = = = = < < < < = < < < = = < < < < = < = < = < = < < < < < =\n",
|
| 220 |
+
" [ 33] Bearish | ID= 535223428555 | Ξ£ = < = < = = < < < = < = = < < = < = < < = = < < < = < < < = = < = = < < < < <\n",
|
| 221 |
+
" [ 34] Bearish | ID= 295288782235 | Ξ£ = < = < < = = < < = < < < < = = < = < = < = = < = = = = = = < < = = < = = = <\n",
|
| 222 |
+
" [ 35] Bearish | ID= 343554777039 | Ξ£ = < < < = = < < < < < < < = < < < = < = < < < = < = < < < < < < < < < < = = <\n",
|
| 223 |
+
" [ 36] Bearish | ID= 547418250595 | Ξ£ = < = = = < < = < = < < < = = < < < = < = < = < = = < = < < < = < < < < < < <\n",
|
| 224 |
+
" [ 37] Bullish | ID= 177868470766 | Ξ£ = > > > = > > > > = = > > > > = > = = > = = > > > = = > = > > = > = = > = > =\n",
|
| 225 |
+
" [ 38] Bullish | ID= 294601994596 | Ξ£ = = > = = > > = > = = = > > = > > = > = = > = > > > > = > = = > = = > = = = >\n",
|
| 226 |
+
" [ 39] Bullish | ID= 57969416624 | Ξ£ = = = = > > = > > = = > > = = = > > > > > > = = > > > > > > > = > = > > = = =\n",
|
| 227 |
+
" [ 40] Bullish | ID= 27863637690 | Ξ£ = > = > > > = > = > > > > = > = > = > > = = > > = = > > > > > = = > > = = = =\n",
|
| 228 |
+
" [ 41] Bullish | ID= 224985691976 | Ξ£ = = = > = = > = > > > = > > = = > = = = > > = = = > = = = > > = = = > = > > =\n",
|
| 229 |
+
" [ 42] Bearish | ID= 487090078369 | Ξ£ = = = = = < = < = < = = = = < < = = < = < = < < = = = < = < < = < = = = < < <\n",
|
| 230 |
+
" [ 43] Bullish | ID= 4141515848 | Ξ£ = = = > = = > = = = > = = = = > = > = > > = > > = > > = > > > > = = = = = = =\n",
|
| 231 |
+
" [ 44] Bullish | ID= 197888556010 | Ξ£ = > = > = > > > > > = > > > = > > > = = > = = = > > = = > = = = = > > > = > =\n",
|
| 232 |
+
" [ 45] Bearish | ID= 434117278173 | Ξ£ = = < < < = < < < = = < < < < < < < < = = < < = < < = = < = = = < = < = = < <\n",
|
| 233 |
+
" [ 46] Bullish | ID= 538864504842 | Ξ£ = > = > = = = = = = = = > = > > > > = = > = > > = > > = > > > = > = > > > > >\n",
|
| 234 |
+
" [ 47] Bullish | ID= 95860229666 | Ξ£ = > = = = > = = = > > = = = = = > > > = > > = > > = = = > = > = = > > = > = =\n",
|
| 235 |
+
" [ 48] Bearish | ID= 175140355631 | Ξ£ = < < < = < = = = < < < < < = < < = < < = < = = < < < = = = < < = = = < = < =\n",
|
| 236 |
+
" [ 49] Bearish | ID= 229634663885 | Ξ£ = = < < = = < < < = < = = < < < = < = < = = < = < < < = < < < = < = < = < < =\n",
|
| 237 |
+
" [ 50] Bearish | ID= 215659952263 | Ξ£ = < < = = = = < = = = < < < = < < = < = < = < = = < < = < < = = = < = = < < =\n",
|
| 238 |
+
" [ 51] Bearish | ID= 88951779299 | Ξ£ = < = = = < < < < < < < = < < = = = = = < < < < < = < = < < = < = = < = < = =\n",
|
| 239 |
+
" [ 52] Bearish | ID= 93340530549 | Ξ£ = = < = < < < = < < < = < < < = < < < = = = = < < < = < < < = < < = < = < = =\n",
|
| 240 |
+
" [ 53] Bearish | ID= 520761088879 | Ξ£ = < < < = < < = < < = < < = = < < < < = = = < < < < < < < < = = < = = < < < <\n",
|
| 241 |
+
" [ 54] Bullish | ID= 427826220636 | Ξ£ = = > > > = > = = > > > = = = = = > > > = > > = = = > > > = = > > > = = = > >\n",
|
| 242 |
+
" [ 55] Bullish | ID= 483254597582 | Ξ£ = > > > = = > > > > > = > > > > > > > = > > = = = = > = = = = > = = = = > > >\n",
|
| 243 |
+
" [ 56] Bullish | ID= 99519992790 | Ξ£ = > > = > = > > > > = = > = = > = > = > > = > > > > = > = > = = > > > = > = =\n",
|
| 244 |
+
" [ 57] Bullish | ID= 318036678048 | Ξ£ = = = = = > = > > = > = > = = > = > > = > > > = = = > > = = = = = > = > = = >\n",
|
| 245 |
+
" [ 58] Bullish | ID= 465354264024 | Ξ£ = = = > > = > > > = > > = = = > = > > = = = > = > = = > > = > = = = > > = > >\n",
|
| 246 |
+
" [ 59] Bearish | ID= 257366456073 | Ξ£ = = = < = = = = < < < = < < < = = = < < < < = = = = < < = < < < < < = < < < =\n",
|
| 247 |
+
" [ 60] Bearish | ID= 438801001563 | Ξ£ = < = < < = < = = = < < = < < < < < = = < = = < = < = < = < = = = < < = = < <\n",
|
| 248 |
+
" [ 61] Bullish | ID= 524444180016 | Ξ£ = = = = > > = = = > > > > = = = > > > > = = > = > > = > > = = = = > = > > > >\n",
|
| 249 |
+
" [ 62] Bearish | ID= 326267911843 | Ξ£ = < = = = < = < = < < < < < = = < = < = < = = = < < < = < < < < < < = < = = <\n",
|
| 250 |
+
" [ 63] Bullish | ID= 79552418304 | Ξ£ = = = = = = = = = > = = > = = > > = = = > > = > > = > = = = = > = > = = > = =\n",
|
| 251 |
+
" [ 64] Bearish | ID= 47263338937 | Ξ£ = = = < < < = < < = = = < = < = < = < < < = = = < = = = = = = = < < = < = = =\n",
|
| 252 |
+
" [ 65] Bearish | ID= 175808306983 | Ξ£ = < < = = < = = < < < < < = < < < = < < < < < < = < < < = < < < = = = < = < =\n",
|
| 253 |
+
" [ 66] Bullish | ID= 482859874250 | Ξ£ = > = > = = > > > > > = > > > > = = = = > > = > = = > > = > > = = = = = > > >\n",
|
| 254 |
+
" [ 67] Bullish | ID= 437378623348 | Ξ£ = = > = > > > = > > > = = > = = = = > > = = > > > = > = > = > > > = > = = > >\n",
|
| 255 |
+
" [ 68] Bearish | ID= 400478158341 | Ξ£ = = < = = = = = = < < < < < = < < < = < < = < = = < < < < < = = < = < < < = <\n",
|
| 256 |
+
" [ 69] Bearish | ID= 401295312607 | Ξ£ = < < < < = < < = < < = = = = < = = = = < = = = < < < < = < < = < = < < < = <\n",
|
| 257 |
+
" [ 70] Bullish | ID= 418612558654 | Ξ£ = > > > > > = = > > = > > > = > = = = = = = > = > > > = > > > = > = = = = > >\n",
|
| 258 |
+
" [ 71] Bullish | ID= 85827056944 | Ξ£ = = = = > > = = > = > = > > > > = = = = > > = > > > = > > > > > > > = = > = =\n",
|
| 259 |
+
" [ 72] Bullish | ID= 128616350616 | Ξ£ = = = > > = = > > > = = = = > > > = = = = > = = = > = = > > > > > = > > > = =\n",
|
| 260 |
+
" [ 73] Bearish | ID= 314776501053 | Ξ£ = = < < < < = = < < = < < < = = = = < = = < = = = < = < = = < = < = = < = = <\n",
|
| 261 |
+
" [ 74] Bullish | ID= 210744214082 | Ξ£ = > = = = = > = = > = = = = = > > = > = > = > = > = = = > = = = > = = = > > =\n",
|
| 262 |
+
" [ 75] Bearish | ID= 231440688619 | Ξ£ = < = < = < < < < = < = = < = < = = = = < < < < = < = = = < < < < = < = < < =\n",
|
| 263 |
+
" [ 76] Bearish | ID= 266647084447 | Ξ£ = < < < < = = < < = < < < = = < < < < = = < < = < = < = < = = = = < < < < < =\n",
|
| 264 |
+
" [ 77] Bullish | ID= 198293842838 | Ξ£ = > > = > = = > > > = > = > > > > > = > > > = = > > = > = > = = = > > > = > =\n",
|
| 265 |
+
" [ 78] Bearish | ID= 357662675445 | Ξ£ = = < = < < < < < = = = < = < = < < = < < = < = = < < = = = < = < < = = < = <\n",
|
| 266 |
+
" [ 79] Bullish | ID= 273125219496 | Ξ£ = = = > = > = > = = > > > = = = = = = > = = = > > > > = > = = > > > > > > > =\n",
|
| 267 |
+
" [ 80] Bullish | ID= 75425469868 | Ξ£ = = > > = > = > > = > = > = > = > = > = > > = > > > > > = = = > > = = = > = =\n",
|
| 268 |
+
" [ 81] Bearish | ID= 195189967611 | Ξ£ = < = < < < < < = < = < = = = < = < = < < < = = = < = = < < < = < = < < = < =\n",
|
| 269 |
+
" [ 82] Bearish | ID= 225512663559 | Ξ£ = < < = = = = = = < = < = < = = = < = < < = = < < = = = = = = < = = < = < < =\n",
|
| 270 |
+
" [ 83] Bearish | ID= 78254493955 | Ξ£ = < = = = = = = < = = = < = < < = = < = < = < = = = = < < < = = = < = = < = =\n",
|
| 271 |
+
" [ 84] Bullish | ID= 389605294658 | Ξ£ = > = = = = > = = > = = = = = = > = = > = = > = = > > = > > = > = > = > > = >\n",
|
| 272 |
+
" [ 85] Bearish | ID= 373561087563 | Ξ£ = < = < = = < = = < < = < = < < < = = < < < < < < = = < < < < < = < < = < = <\n",
|
| 273 |
+
" [ 86] Bullish | ID= 444857134536 | Ξ£ = = = > = = > > > = > > = > = = > = > > = = = > > > = = > = = > > > > = = > >\n",
|
| 274 |
+
" [ 87] Bearish | ID= 490743440237 | Ξ£ = = < < = < < = < < = = = < = < = < < = < = = < = < = = = = < = = < = = < < <\n",
|
| 275 |
+
" [ 88] Bearish | ID= 379217567217 | Ξ£ = = = = < < < < < = < < < = < < = = = = = < = = < < = < = = < = = = = < < = <\n",
|
| 276 |
+
" [ 89] Bullish | ID= 225620347090 | Ξ£ = > = = > = > > = = = > = = > = > = > = = = = = = = = > = = = > = = > = > > =\n",
|
| 277 |
+
" [ 90] Bearish | ID= 222579730557 | Ξ£ = = < < < < < = = = = < = < = = < = = < = = < < = < = = < = < < < < = = < < =\n",
|
| 278 |
+
" [ 91] Bearish | ID= 191729915761 | Ξ£ = = = = < < < = < < < = < = < = = < < < < < < < < < = = = < = < = = < < = < =\n",
|
| 279 |
+
" [ 92] Bearish | ID= 119739270581 | Ξ£ = = < = < < = < < = < = = = < = = = < = = = = = < = = = = < < < < < = < < = =\n",
|
| 280 |
+
" [ 93] Bullish | ID= 485971249076 | Ξ£ = = > = > > = > > > > = = = > > = = > = = > = = = > > = = > = = > = = = > > >\n",
|
| 281 |
+
" [ 94] Bearish | ID= 216427290349 | Ξ£ = = < < = < < < = < < < < = < = = < = = < = = = = = < = = < < = = < = = < < =\n",
|
| 282 |
+
" [ 95] Bearish | ID= 425495675577 | Ξ£ = = = < < < = < = < = = = = < < = = < = = = = < < = = = < = = = < < = = = < <\n",
|
| 283 |
+
" [ 96] Bearish | ID= 63855804407 | Ξ£ = < < = < < < < < < < < < < = = = < = < < = = = = < < < < = < < = < < < = = =\n",
|
| 284 |
+
" [ 97] Bearish | ID= 69480015969 | Ξ£ = = = = = < < = = = = < = < < < = = < = < = < = < = < < = < = = = = = = < = =\n",
|
| 285 |
+
" [ 98] Bearish | ID= 256615250465 | Ξ£ = = = = = < = = = < = < < < < < < = < = < < < = < < < < < < = < < < = < < < =\n",
|
| 286 |
+
" [ 99] Bullish | ID= 488221437982 | Ξ£ = > > > > = = = = = = = > > > > > > = = = = > = = = > > = > = > > = = = > > >\n",
|
| 287 |
+
" [100] Bearish | ID= 89681994059 | Ξ£ = < = < = = < = < = = = = < = < = < < = < < < = < = = = = < < < = = < = < = =\n",
|
| 288 |
+
"\n",
|
| 289 |
+
"==========================================================================\n",
|
| 290 |
+
" OUTPUT 3 β DEVELOPING POC CHARTS (100 patterns)\n",
|
| 291 |
+
"==========================================================================\n",
|
| 292 |
+
" [SAVED] TopoDevPOC_n39_100samples.png\n",
|
| 293 |
+
"\n",
|
| 294 |
+
" ASCII CLI Charts β first 10 samples (right side = C_0 = newest)\n",
|
| 295 |
+
"\n",
|
| 296 |
+
" [ 1] Bullish | ID=167790361200 | strict_moves=17/38\n",
|
| 297 |
+
" POC range: oldest=50 β newest=67\n",
|
| 298 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 299 |
+
" β βΒ·Β·Β·Β·β\n",
|
| 300 |
+
" β Β·βΒ·Β·ββ β\n",
|
| 301 |
+
" β Β·βββ β\n",
|
| 302 |
+
" β Β·ββ β\n",
|
| 303 |
+
" β Β·Β·Β·βΒ·Β·Β·βΒ·β β\n",
|
| 304 |
+
" β ββΒ·Β·Β·β β\n",
|
| 305 |
+
" βΒ·βΒ·Β·β β\n",
|
| 306 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 307 |
+
" Ξ£ (first 12): = = = > > > = = > = > > β¦\n",
|
| 308 |
+
"\n",
|
| 309 |
+
" [ 2] Bearish | ID=112296131307 | strict_moves=22/38\n",
|
| 310 |
+
" POC range: oldest=50 β newest=28\n",
|
| 311 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 312 |
+
" βΒ·Β·ββ β\n",
|
| 313 |
+
" β Β·βΒ·Β·Β·βΒ·Β·βΒ·β β\n",
|
| 314 |
+
" β Β·βΒ·βββ β\n",
|
| 315 |
+
" β βΒ·ββ β\n",
|
| 316 |
+
" β βββΒ·β β\n",
|
| 317 |
+
" β Β·βββΒ·β β\n",
|
| 318 |
+
" β Β·βΒ·β\n",
|
| 319 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 320 |
+
" Ξ£ (first 12): < = < = < < < = < = < < β¦\n",
|
| 321 |
+
"\n",
|
| 322 |
+
" [ 3] Bullish | ID=369064015028 | strict_moves=25/38\n",
|
| 323 |
+
" POC range: oldest=50 β newest=75\n",
|
| 324 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 325 |
+
" β βΒ·βΒ·Β·β\n",
|
| 326 |
+
" β βΒ·βΒ·Β·βΒ·β β\n",
|
| 327 |
+
" β Β·ββββ β\n",
|
| 328 |
+
" β ββΒ·ββ β\n",
|
| 329 |
+
" β Β·ββΒ·ββ β\n",
|
| 330 |
+
" β Β·ββββ β\n",
|
| 331 |
+
" ββΒ·βΒ·β β\n",
|
| 332 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 333 |
+
" Ξ£ (first 12): = > = > > = > = = > = > β¦\n",
|
| 334 |
+
"\n",
|
| 335 |
+
" [ 4] Bearish | ID=397679224723 | strict_moves=21/38\n",
|
| 336 |
+
" POC range: oldest=50 β newest=29\n",
|
| 337 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 338 |
+
" ββΒ·β β\n",
|
| 339 |
+
" β ββΒ·Β·βΒ·Β·β β\n",
|
| 340 |
+
" β Β·βββ β\n",
|
| 341 |
+
" β βΒ·Β·Β·Β·βββ β\n",
|
| 342 |
+
" β Β·ββΒ·Β·β β\n",
|
| 343 |
+
" β βββΒ·Β·β β\n",
|
| 344 |
+
" β Β·Β·βΒ·β\n",
|
| 345 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 346 |
+
" Ξ£ (first 12): < = = < = = < < < < = = β¦\n",
|
| 347 |
+
"\n",
|
| 348 |
+
" [ 5] Bullish | ID=37927295500 | strict_moves=14/38\n",
|
| 349 |
+
" POC range: oldest=50 β newest=64\n",
|
| 350 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 351 |
+
" β βΒ·Β·β\n",
|
| 352 |
+
" β Β·βΒ·Β·Β·Β·Β·β β\n",
|
| 353 |
+
" β Β·Β·ββ β\n",
|
| 354 |
+
" β Β·βΒ·Β·βΒ·Β·β β\n",
|
| 355 |
+
" β Β·βΒ·Β·β β\n",
|
| 356 |
+
" β βΒ·β β\n",
|
| 357 |
+
" βΒ·Β·Β·βΒ·Β·Β·β β\n",
|
| 358 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 359 |
+
" Ξ£ (first 12): = > > = = = = = > = > > β¦\n",
|
| 360 |
+
"\n",
|
| 361 |
+
" [ 6] Bullish | ID=286312365648 | strict_moves=19/38\n",
|
| 362 |
+
" POC range: oldest=50 β newest=69\n",
|
| 363 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 364 |
+
" β Β·βΒ·Β·Β·Β·β\n",
|
| 365 |
+
" β ββΒ·Β·β β\n",
|
| 366 |
+
" β βββ β\n",
|
| 367 |
+
" β Β·ββββ β\n",
|
| 368 |
+
" β Β·Β·ββΒ·Β·Β·β β\n",
|
| 369 |
+
" β Β·βΒ·βΒ·β β\n",
|
| 370 |
+
" ββΒ·Β·Β·Β·β β\n",
|
| 371 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 372 |
+
" Ξ£ (first 12): = = = > = > = = > > > > β¦\n",
|
| 373 |
+
"\n",
|
| 374 |
+
" [ 7] Bearish | ID=299333570369 | strict_moves=19/38\n",
|
| 375 |
+
" POC range: oldest=50 β newest=31\n",
|
| 376 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 377 |
+
" ββΒ·Β·Β·β β\n",
|
| 378 |
+
" β Β·ββΒ·β β\n",
|
| 379 |
+
" β βΒ·Β·Β·ββ β\n",
|
| 380 |
+
" β Β·βΒ·βΒ·ββ β\n",
|
| 381 |
+
" β ββΒ·Β·β β\n",
|
| 382 |
+
" β βββ β\n",
|
| 383 |
+
" β Β·βΒ·Β·Β·Β·Β·Β·β\n",
|
| 384 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 385 |
+
" Ξ£ (first 12): = = = = = < = < < < < = β¦\n",
|
| 386 |
+
"\n",
|
| 387 |
+
" [ 8] Bearish | ID=180886373753 | strict_moves=18/38\n",
|
| 388 |
+
" POC range: oldest=50 β newest=32\n",
|
| 389 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 390 |
+
" βΒ·βΒ·β β\n",
|
| 391 |
+
" β Β·βΒ·Β·Β·Β·ββ β\n",
|
| 392 |
+
" β βΒ·ββ β\n",
|
| 393 |
+
" β Β·βΒ·βΒ·β β\n",
|
| 394 |
+
" β βΒ·Β·Β·Β·Β·βΒ·β β\n",
|
| 395 |
+
" β Β·βββ β\n",
|
| 396 |
+
" β βΒ·Β·Β·β\n",
|
| 397 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 398 |
+
" Ξ£ (first 12): = = < < < < = < = < = = β¦\n",
|
| 399 |
+
"\n",
|
| 400 |
+
" [ 9] Bullish | ID=367632183586 | strict_moves=18/38\n",
|
| 401 |
+
" POC range: oldest=50 β newest=68\n",
|
| 402 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 403 |
+
" β Β·Β·Β·βΒ·β\n",
|
| 404 |
+
" β βΒ·Β·Β·βΒ·Β·β β\n",
|
| 405 |
+
" β βββ β\n",
|
| 406 |
+
" β Β·Β·βΒ·βΒ·β β\n",
|
| 407 |
+
" β Β·Β·ββΒ·Β·Β·β β\n",
|
| 408 |
+
" β Β·βΒ·ββ β\n",
|
| 409 |
+
" ββΒ·β β\n",
|
| 410 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 411 |
+
" Ξ£ (first 12): > = = = > = = > = = = > β¦\n",
|
| 412 |
+
"\n",
|
| 413 |
+
" [10] Bullish | ID=524916622536 | strict_moves=18/38\n",
|
| 414 |
+
" POC range: oldest=50 β newest=68\n",
|
| 415 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 416 |
+
" β Β·Β·βΒ·Β·Β·β\n",
|
| 417 |
+
" β Β·Β·Β·Β·Β·Β·Β·Β·βΒ·Β·ββ β\n",
|
| 418 |
+
" β βββ β\n",
|
| 419 |
+
" β ββΒ·β β\n",
|
| 420 |
+
" β Β·Β·Β·ββΒ·β β\n",
|
| 421 |
+
" β ββΒ·β β\n",
|
| 422 |
+
" βββ β\n",
|
| 423 |
+
" βββββββββββββββββββββββββββββββββββββββββ\n",
|
| 424 |
+
" Ξ£ (first 12): = = > = = > > = = > = = β¦\n",
|
| 425 |
+
"\n",
|
| 426 |
+
"==========================================================================\n",
|
| 427 |
+
" SUMMARY\n",
|
| 428 |
+
"==========================================================================\n",
|
| 429 |
+
" n (candles) = 39\n",
|
| 430 |
+
" Transitions per pattern = 38\n",
|
| 431 |
+
" Total patterns [2^39] = 549,755,813,888\n",
|
| 432 |
+
" Bullish [2^38] = 274,877,906,944\n",
|
| 433 |
+
" Bearish [2^38] = 274,877,906,944\n",
|
| 434 |
+
" Matrix B_n validated = 274,877,906,944 β\n",
|
| 435 |
+
" Samples generated = 100\n",
|
| 436 |
+
" Chart file = TopoDevPOC_n39_100samples.png\n",
|
| 437 |
+
" Compute device = cuda\n",
|
| 438 |
+
" Wall-clock (sample+decode) = 13032.35 ms\n",
|
| 439 |
+
"==========================================================================\n",
|
| 440 |
+
"\n",
|
| 441 |
+
" CONVERSION FORMULAS (tex Sec. V)\n",
|
| 442 |
+
" Symbolic β Ternary:\n",
|
| 443 |
+
" Bullish: '>' β +1, '=' β 0\n",
|
| 444 |
+
" Bearish: '<' β -1, '=' β 0\n",
|
| 445 |
+
" Ternary β Symbolic:\n",
|
| 446 |
+
" +1 β '>', 0 β '=', -1 β '<'\n",
|
| 447 |
+
"\n",
|
| 448 |
+
" TEMPORAL CONVENTION:\n",
|
| 449 |
+
" Chart x-axis: left = C_{-38} (oldest) β right = C_0 (newest)\n",
|
| 450 |
+
" Bullish pattern: POC non-increasing toward right (higher on left)\n",
|
| 451 |
+
" Bearish pattern: POC non-decreasing toward right (lower on left)\n",
|
| 452 |
+
"==========================================================================\n"
|
| 453 |
+
]
|
| 454 |
+
}
|
| 455 |
+
],
|
| 456 |
+
"source": [
|
| 457 |
+
"#!/usr/bin/env python3\n",
|
| 458 |
+
"\"\"\"\n",
|
| 459 |
+
"TopoDevPOC_n39.py\n",
|
| 460 |
+
"Topologically Unique Developing Point of Control Patterns\n",
|
| 461 |
+
"Pre-market K-Lines, n = 39 three-minute candlesticks\n",
|
| 462 |
+
"\n",
|
| 463 |
+
"Paper : TopoDevPOC.tex (ConQ Research Team, Continual Quasars)\n",
|
| 464 |
+
"Compute: Vectorized NumPy + GPU Torch (T4) + Warp branchless ops\n",
|
| 465 |
+
" Architectural patterns from core_engine_v11.py (Hyper-Warp Edition)\n",
|
| 466 |
+
"\n",
|
| 467 |
+
"Outputs (CLI):\n",
|
| 468 |
+
" 1. Total combination count for n=39\n",
|
| 469 |
+
" 2. Matrix state-transition validation\n",
|
| 470 |
+
" 3. 100 random ternary matrices (1Γ38 each)\n",
|
| 471 |
+
" 4. 100 random symbolic sequences (length-38 strings)\n",
|
| 472 |
+
" 5. 100 developing_poc charts saved as PNG + ASCII CLI preview\n",
|
| 473 |
+
"\n",
|
| 474 |
+
"Run on Google Colab T4:\n",
|
| 475 |
+
" !python TopoDevPOC_n39.py\n",
|
| 476 |
+
"\"\"\"\n",
|
| 477 |
+
"\n",
|
| 478 |
+
"# ββ stdlib ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 479 |
+
"import os, sys, time, math\n",
|
| 480 |
+
"import numpy as np\n",
|
| 481 |
+
"\n",
|
| 482 |
+
"# ββ matplotlib (non-interactive for Colab CLI) ββββββββββββββββββββββββββββββββ\n",
|
| 483 |
+
"import matplotlib\n",
|
| 484 |
+
"matplotlib.use('Agg')\n",
|
| 485 |
+
"import matplotlib.pyplot as plt\n",
|
| 486 |
+
"import matplotlib.ticker as mticker\n",
|
| 487 |
+
"\n",
|
| 488 |
+
"# ββ GPU setup (T4 Colab) βββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 489 |
+
"try:\n",
|
| 490 |
+
" import torch\n",
|
| 491 |
+
" HAS_CUDA = torch.cuda.is_available()\n",
|
| 492 |
+
" DEVICE = 'cuda' if HAS_CUDA else 'cpu'\n",
|
| 493 |
+
"except ImportError:\n",
|
| 494 |
+
" HAS_CUDA = False\n",
|
| 495 |
+
" DEVICE = 'cpu'\n",
|
| 496 |
+
" torch = None\n",
|
| 497 |
+
"\n",
|
| 498 |
+
"# Optional Warp (core_engine_v11.py pattern) βββββββββββββββββββββββββββββββββ\n",
|
| 499 |
+
"HAS_WARP = False\n",
|
| 500 |
+
"try:\n",
|
| 501 |
+
" import warp as wp\n",
|
| 502 |
+
" wp.init()\n",
|
| 503 |
+
" wp.set_module_options({\"enable_backward\": False, \"fast_math\": True, \"max_unroll\": 8})\n",
|
| 504 |
+
" HAS_WARP = bool(wp.get_cuda_devices())\n",
|
| 505 |
+
"except Exception:\n",
|
| 506 |
+
" pass\n",
|
| 507 |
+
"\n",
|
| 508 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 509 |
+
"# CONSTANTS (tex Section II)\n",
|
| 510 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 511 |
+
"N = 39 # pre-market 3-min candles (C_0 β¦ C_{-(n-1)})\n",
|
| 512 |
+
"N_TRANS = N - 1 # 38 adjacent-pair relations\n",
|
| 513 |
+
"N_SAMPLES = 100\n",
|
| 514 |
+
"SEED = int(time.time() * 1000) & 0x7FFFFFFF\n",
|
| 515 |
+
"\n",
|
| 516 |
+
"SEP = \"=\" * 74\n",
|
| 517 |
+
"\n",
|
| 518 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 519 |
+
"# 0. HEADER\n",
|
| 520 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 521 |
+
"print(SEP)\n",
|
| 522 |
+
"print(\" TopoDevPOC β Developing POC Pattern Enumerator\")\n",
|
| 523 |
+
"print(f\" n = {N} candles | {N_TRANS} transitions | device = {DEVICE}\")\n",
|
| 524 |
+
"if HAS_CUDA and torch:\n",
|
| 525 |
+
" print(f\" GPU = {torch.cuda.get_device_name(0)}\")\n",
|
| 526 |
+
"if HAS_WARP:\n",
|
| 527 |
+
" print(f\" Warp = enabled (branchless kernel path)\")\n",
|
| 528 |
+
"print(SEP)\n",
|
| 529 |
+
"\n",
|
| 530 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 531 |
+
"# SECTION 1 β COMBINATORIAL ENUMERATION (tex Theorem, Sec. III)\n",
|
| 532 |
+
"#\n",
|
| 533 |
+
"# Bullish: each of (n-1) transitions β {>, =} β 2^(n-1) patterns\n",
|
| 534 |
+
"# Bearish: each of (n-1) transitions β {<, =} β 2^(n-1) patterns\n",
|
| 535 |
+
"# Total : 2^(n-1) + 2^(n-1) = 2^n (disjoint families)\n",
|
| 536 |
+
"# n=39 : 2^39 = 549,755,813,888\n",
|
| 537 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββοΏ½οΏ½βββββββββ\n",
|
| 538 |
+
"TOTAL = 1 << N # exact Python int (arbitrary precision)\n",
|
| 539 |
+
"HALF = 1 << (N - 1)\n",
|
| 540 |
+
"\n",
|
| 541 |
+
"print(f\"\\n[THEOREM] Total unique developing POC patterns for n={N}\")\n",
|
| 542 |
+
"print(f\" Bullish (non-increasing) : 2^{N-1} = {HALF:,}\")\n",
|
| 543 |
+
"print(f\" Bearish (non-decreasing) : 2^{N-1} = {HALF:,}\")\n",
|
| 544 |
+
"print(f\" Total (2^{N}) : {TOTAL:,}\")\n",
|
| 545 |
+
"\n",
|
| 546 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 547 |
+
"# SECTION 2 β MATRIX STATE-TRANSITION VALIDATION (tex Sec. IV)\n",
|
| 548 |
+
"#\n",
|
| 549 |
+
"# States : S_0 (equality), S_Β± (strict move)\n",
|
| 550 |
+
"# A = [[1,1],[1,1]] (fully-connected 2-state digraph)\n",
|
| 551 |
+
"# v_0 = [1,1]^T (both states reachable initially)\n",
|
| 552 |
+
"#\n",
|
| 553 |
+
"# B_n = 1^T Β· A^(n-2) Β· v_0\n",
|
| 554 |
+
"# = 2^(n-3) Β· 1^T Β· A Β· 1 (using A^k = 2^(k-1)Β·A for kβ₯1)\n",
|
| 555 |
+
"# = 2^(n-3) Β· 4 = 2^(n-1) per direction\n",
|
| 556 |
+
"#\n",
|
| 557 |
+
"# Implementation: exact Python-int matrix exponentiation (no float rounding)\n",
|
| 558 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 559 |
+
"\n",
|
| 560 |
+
"def _mm2(A, B):\n",
|
| 561 |
+
" \"\"\"Exact 2Γ2 matrix multiply with Python arbitrary-precision ints.\"\"\"\n",
|
| 562 |
+
" return [\n",
|
| 563 |
+
" [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",
|
| 564 |
+
" [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",
|
| 565 |
+
" ]\n",
|
| 566 |
+
"\n",
|
| 567 |
+
"def _mpow2(M, k):\n",
|
| 568 |
+
" \"\"\"Fast 2Γ2 matrix power, exact ints, O(log k).\"\"\"\n",
|
| 569 |
+
" if k == 0: return [[1,0],[0,1]]\n",
|
| 570 |
+
" if k == 1: return M\n",
|
| 571 |
+
" h = _mpow2(M, k >> 1)\n",
|
| 572 |
+
" s = _mm2(h, h)\n",
|
| 573 |
+
" return s if (k & 1) == 0 else _mm2(s, M)\n",
|
| 574 |
+
"\n",
|
| 575 |
+
"A_mat = [[1,1],[1,1]]\n",
|
| 576 |
+
"v0 = [1, 1]\n",
|
| 577 |
+
"A_pow = _mpow2(A_mat, N - 2)\n",
|
| 578 |
+
"# 1^T Β· A^(n-2) Β· v0\n",
|
| 579 |
+
"Av0_0 = A_pow[0][0]*v0[0] + A_pow[0][1]*v0[1]\n",
|
| 580 |
+
"Av0_1 = A_pow[1][0]*v0[0] + A_pow[1][1]*v0[1]\n",
|
| 581 |
+
"B_n = Av0_0 + Av0_1 # = 1^T Β· (A^(n-2)Β·v0)\n",
|
| 582 |
+
"\n",
|
| 583 |
+
"print(f\"\\n[MATRIX] A = [[1,1],[1,1]] | v_0 = [1,1]^T\")\n",
|
| 584 |
+
"print(f\" A^{N-2} = [[{A_pow[0][0]}, {A_pow[0][1]}],\")\n",
|
| 585 |
+
"print(f\" [{A_pow[1][0]}, {A_pow[1][1]}]]\")\n",
|
| 586 |
+
"print(f\" B_{N} = 1^T Β· A^{N-2} Β· v_0 = {B_n:,}\")\n",
|
| 587 |
+
"print(f\" Expected 2^{{n-1}} = {HALF:,}\")\n",
|
| 588 |
+
"assert B_n == HALF, f\"Matrix B_n mismatch: {B_n} β {HALF}\"\n",
|
| 589 |
+
"assert 2 * B_n == TOTAL, f\"Total mismatch: {2*B_n} β {TOTAL}\"\n",
|
| 590 |
+
"print(f\" [OK] 2 Γ {B_n:,} = {TOTAL:,} β\")\n",
|
| 591 |
+
"\n",
|
| 592 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 593 |
+
"# SECTION 3 β PATTERN ENCODING SCHEME\n",
|
| 594 |
+
"#\n",
|
| 595 |
+
"# Each of the 2^39 patterns maps bijectively to a 39-bit integer:\n",
|
| 596 |
+
"# bit 0 : direction (0 = Bullish, 1 = Bearish)\n",
|
| 597 |
+
"# bits 1 β¦ N-1 : transitions (1 = strict move, 0 = equality)\n",
|
| 598 |
+
"#\n",
|
| 599 |
+
"# pattern_id β [0, 2^39) uniquely identifies every valid pattern.\n",
|
| 600 |
+
"#\n",
|
| 601 |
+
"# Ternary matrix m β {+1,0}^(n-1) for bullish,\n",
|
| 602 |
+
"# m β {-1,0}^(n-1) for bearish.\n",
|
| 603 |
+
"# Bijection: m_k = sign(direction) Γ trans_bit_k\n",
|
| 604 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 605 |
+
"\n",
|
| 606 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 607 |
+
"# SECTION 4 β GPU-ACCELERATED RANDOM SAMPLING\n",
|
| 608 |
+
"# Generate (N_SAMPLES Γ N) binary matrix at once on T4 GPU.\n",
|
| 609 |
+
"# Inspired by core_engine_v11.py XOR-shift PRNG kernel design.\n",
|
| 610 |
+
"# bits[:,0] = direction flags\n",
|
| 611 |
+
"# bits[:,1:] = N_TRANS transition flags per pattern\n",
|
| 612 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 613 |
+
"\n",
|
| 614 |
+
"t_sample = time.perf_counter()\n",
|
| 615 |
+
"\n",
|
| 616 |
+
"if HAS_WARP:\n",
|
| 617 |
+
" # ββ Warp branchless path (core_engine_v11.py style) βββββββββββββββββββββ\n",
|
| 618 |
+
" # Launch one thread per sample; XOR-shift fills N bits per thread.\n",
|
| 619 |
+
" _seed_wp = SEED\n",
|
| 620 |
+
"\n",
|
| 621 |
+
" @wp.kernel\n",
|
| 622 |
+
" def k_rng_bits(seed: int, N_cols: int,\n",
|
| 623 |
+
" out: wp.array(dtype=wp.int8)):\n",
|
| 624 |
+
" tid = wp.tid()\n",
|
| 625 |
+
" rng = wp.uint32(seed) ^ wp.uint32(tid)\n",
|
| 626 |
+
" if rng == wp.uint32(0):\n",
|
| 627 |
+
" rng = wp.uint32(123456789)\n",
|
| 628 |
+
" base = tid * N_cols\n",
|
| 629 |
+
" for col in range(N_cols):\n",
|
| 630 |
+
" rng = rng ^ (rng << wp.uint32(13))\n",
|
| 631 |
+
" rng = rng ^ (rng >> wp.uint32(17))\n",
|
| 632 |
+
" rng = rng ^ (rng << wp.uint32(5))\n",
|
| 633 |
+
" out[base + col] = wp.int8(int(rng) & 1)\n",
|
| 634 |
+
"\n",
|
| 635 |
+
" out_wp = wp.zeros(N_SAMPLES * N, dtype=wp.int8, device='cuda')\n",
|
| 636 |
+
" wp.launch(k_rng_bits, dim=N_SAMPLES, block_dim=128,\n",
|
| 637 |
+
" inputs=[_seed_wp, N, out_wp], device='cuda')\n",
|
| 638 |
+
" wp.synchronize()\n",
|
| 639 |
+
" bits_np = out_wp.numpy().reshape(N_SAMPLES, N)\n",
|
| 640 |
+
" print(f\"\\n[SAMPLE] {N_SAMPLES} patterns sampled via Warp XOR-shift kernel\")\n",
|
| 641 |
+
"\n",
|
| 642 |
+
"elif HAS_CUDA and torch is not None:\n",
|
| 643 |
+
" # ββ Torch GPU path βββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 644 |
+
" gen = torch.Generator(device='cuda')\n",
|
| 645 |
+
" gen.manual_seed(SEED)\n",
|
| 646 |
+
" bits_t = torch.randint(0, 2, (N_SAMPLES, N), device='cuda',\n",
|
| 647 |
+
" generator=gen, dtype=torch.int8)\n",
|
| 648 |
+
" bits_np = bits_t.cpu().numpy()\n",
|
| 649 |
+
" print(f\"\\n[SAMPLE] {N_SAMPLES} patterns sampled on GPU (torch.randint)\")\n",
|
| 650 |
+
"\n",
|
| 651 |
+
"else:\n",
|
| 652 |
+
" # ββ CPU NumPy fallback ββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 653 |
+
" rng_cpu = np.random.default_rng(SEED)\n",
|
| 654 |
+
" bits_np = rng_cpu.integers(0, 2, size=(N_SAMPLES, N), dtype=np.int8)\n",
|
| 655 |
+
" print(f\"\\n[SAMPLE] {N_SAMPLES} patterns sampled on CPU (NumPy)\")\n",
|
| 656 |
+
"\n",
|
| 657 |
+
"sample_ms = (time.perf_counter() - t_sample) * 1e3\n",
|
| 658 |
+
"print(f\" Sampling time: {sample_ms:.2f} ms\")\n",
|
| 659 |
+
"\n",
|
| 660 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 661 |
+
"# SECTION 5 β VECTORISED DECODING (NumPy, no Python loops over patterns)\n",
|
| 662 |
+
"#\n",
|
| 663 |
+
"# bits[:,0] β direction array (0=Bullish, 1=Bearish), shape (100,)\n",
|
| 664 |
+
"# bits[:,1:] β trans array, shape (100, 38)\n",
|
| 665 |
+
"# ternary_mat: +trans if Bullish, -trans if Bearish β shape (100, 38)\n",
|
| 666 |
+
"# sign: Bullishβ+1, Bearishβ-1, broadcast multiply\n",
|
| 667 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 668 |
+
"\n",
|
| 669 |
+
"dir_bits = bits_np[:, 0].astype(np.int8) # 0 or 1\n",
|
| 670 |
+
"trans = bits_np[:, 1:].astype(np.int8) # (100,38), values 0 or 1\n",
|
| 671 |
+
"signs = 1 - 2 * dir_bits # 0β+1 (bull), 1β-1 (bear)\n",
|
| 672 |
+
"ternary = (signs[:, None] * trans).astype(np.int8) # (100,38): +1/0/-1\n",
|
| 673 |
+
"\n",
|
| 674 |
+
"# Compact 39-bit pattern IDs\n",
|
| 675 |
+
"pows64 = (np.uint64(1) << np.arange(N, dtype=np.uint64))\n",
|
| 676 |
+
"pat_ids = (bits_np.astype(np.uint64) * pows64[None, :]).sum(axis=1)\n",
|
| 677 |
+
"\n",
|
| 678 |
+
"# Symbolic sequences: vectorised char lookup\n",
|
| 679 |
+
"# Bullish (sign=+1): trans=1 β '>', trans=0 β '='\n",
|
| 680 |
+
"# Bearish (sign=-1): trans=1 β '<', trans=0 β '='\n",
|
| 681 |
+
"SYM_BULL = np.array(['=', '>'], dtype='<U1') # index by trans bit\n",
|
| 682 |
+
"SYM_BEAR = np.array(['=', '<'], dtype='<U1')\n",
|
| 683 |
+
"sym_matrix = np.where(dir_bits[:, None] == 0,\n",
|
| 684 |
+
" SYM_BULL[trans],\n",
|
| 685 |
+
" SYM_BEAR[trans]) # (100, 38)\n",
|
| 686 |
+
"\n",
|
| 687 |
+
"# POC price sequence (right-to-left: p[0]=C_0=newest, p[N-1]=C_{-(N-1)}=oldest)\n",
|
| 688 |
+
"# p_raw[i, k] = POC of candle C_{-k} for sample i\n",
|
| 689 |
+
"# Transition k: p[k] = p[k+1] + ternary[k]\n",
|
| 690 |
+
"# Build by cumsum from oldestβnewest: p_raw[:, N-1] = 50, then forward\n",
|
| 691 |
+
"BASE = 50.0\n",
|
| 692 |
+
"step = 1.0\n",
|
| 693 |
+
"p_raw = np.zeros((N_SAMPLES, N), dtype=np.float32)\n",
|
| 694 |
+
"p_raw[:, N-1] = BASE\n",
|
| 695 |
+
"# Vectorised: cumulative sum of ternary (columns N-2 down to 0)\n",
|
| 696 |
+
"for k in range(N-2, -1, -1):\n",
|
| 697 |
+
" p_raw[:, k] = p_raw[:, k+1] + ternary[:, k].astype(np.float32) * step\n",
|
| 698 |
+
"\n",
|
| 699 |
+
"# Display order: oldest(left) β newest(right)\n",
|
| 700 |
+
"# poc_disp[:, j] = p_raw[:, N-1-j]\n",
|
| 701 |
+
"poc_disp = p_raw[:, ::-1].copy() # (100, 39), column 0=oldest, col N-1=newest\n",
|
| 702 |
+
"\n",
|
| 703 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 704 |
+
"# OUTPUT 1 β TERNARY MATRICES (100 Γ 38)\n",
|
| 705 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 706 |
+
"print(f\"\\n{SEP}\")\n",
|
| 707 |
+
"print(f\" OUTPUT 1 β TERNARY MATRICES (1Γ{N_TRANS}, values β {{-1,0,+1}})\")\n",
|
| 708 |
+
"print(f\" Format: [#] Direction | PatternID | M = [m_0 β¦ m_37]\")\n",
|
| 709 |
+
"print(SEP)\n",
|
| 710 |
+
"\n",
|
| 711 |
+
"for i in range(N_SAMPLES):\n",
|
| 712 |
+
" d_label = \"Bullish\" if dir_bits[i] == 0 else \"Bearish\"\n",
|
| 713 |
+
" pid = int(pat_ids[i])\n",
|
| 714 |
+
" row_str = np.array2string(ternary[i], separator=',',\n",
|
| 715 |
+
" max_line_width=400).replace('\\n','')\n",
|
| 716 |
+
" print(f\" [{i+1:3d}] {d_label:7s} | ID={pid:>15d} | M={row_str}\")\n",
|
| 717 |
+
"\n",
|
| 718 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 719 |
+
"# OUTPUT 2 β SYMBOLIC SEQUENCES (length 38)\n",
|
| 720 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 721 |
+
"print(f\"\\n{SEP}\")\n",
|
| 722 |
+
"print(f\" OUTPUT 2 β SYMBOLIC SEQUENCES (Ξ£, length {N_TRANS})\")\n",
|
| 723 |
+
"print(f\" Format: [#] Direction | PatternID | Ξ£ = Ο_0 Ο_1 β¦ Ο_37\")\n",
|
| 724 |
+
"print(SEP)\n",
|
| 725 |
+
"\n",
|
| 726 |
+
"for i in range(N_SAMPLES):\n",
|
| 727 |
+
" d_label = \"Bullish\" if dir_bits[i] == 0 else \"Bearish\"\n",
|
| 728 |
+
" pid = int(pat_ids[i])\n",
|
| 729 |
+
" seq_str = ' '.join(sym_matrix[i])\n",
|
| 730 |
+
" print(f\" [{i+1:3d}] {d_label:7s} | ID={pid:>15d} | Ξ£ = {seq_str}\")\n",
|
| 731 |
+
"\n",
|
| 732 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 733 |
+
"# OUTPUT 3 β CHARTS\n",
|
| 734 |
+
"# (a) Full matplotlib figure: 10Γ10 grid, saved to PNG\n",
|
| 735 |
+
"# (b) ASCII CLI preview for first 10 patterns\n",
|
| 736 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 737 |
+
"print(f\"\\n{SEP}\")\n",
|
| 738 |
+
"print(f\" OUTPUT 3 β DEVELOPING POC CHARTS (100 patterns)\")\n",
|
| 739 |
+
"print(SEP)\n",
|
| 740 |
+
"\n",
|
| 741 |
+
"# ββ x-axis: position 0=oldest C_{-(N-1)}, N-1=newest C_0 ββββββββββββββββββ\n",
|
| 742 |
+
"x_pos = np.arange(N, dtype=np.float32)\n",
|
| 743 |
+
"x_tick_pos = [0, 9, 19, 29, N-1]\n",
|
| 744 |
+
"x_tick_lbl = [f'C_{{-{N-1}}}', f'C_{{-29}}', f'C_{{-19}}', f'C_{{-9}}', 'C_0']\n",
|
| 745 |
+
"\n",
|
| 746 |
+
"ROWS, COLS = 10, 10\n",
|
| 747 |
+
"fig = plt.figure(figsize=(COLS * 3.2, ROWS * 2.0))\n",
|
| 748 |
+
"fig.suptitle(\n",
|
| 749 |
+
" f\"TopoDevPOC β 100 Random Developing POC Patterns \"\n",
|
| 750 |
+
" f\"n={N} pre-market 3-min K-lines\\n\"\n",
|
| 751 |
+
" f\"Total pattern space: 2^{N} = {TOTAL:,} \"\n",
|
| 752 |
+
" f\"(Bullish: {HALF:,} | Bearish: {HALF:,})\",\n",
|
| 753 |
+
" fontsize=10, y=1.005\n",
|
| 754 |
+
")\n",
|
| 755 |
+
"\n",
|
| 756 |
+
"for i in range(N_SAMPLES):\n",
|
| 757 |
+
" ax = fig.add_subplot(ROWS, COLS, i + 1)\n",
|
| 758 |
+
" poc = poc_disp[i]\n",
|
| 759 |
+
" is_bull = (dir_bits[i] == 0)\n",
|
| 760 |
+
" color = '#1a6eb5' if is_bull else '#c0392b'\n",
|
| 761 |
+
" label = 'Bβ' if is_bull else 'Bβ'\n",
|
| 762 |
+
"\n",
|
| 763 |
+
" # Background shade\n",
|
| 764 |
+
" ax.set_facecolor('#f7f9fc' if is_bull else '#fdf4f4')\n",
|
| 765 |
+
"\n",
|
| 766 |
+
" # POC line\n",
|
| 767 |
+
" ax.plot(x_pos, poc, color=color, linewidth=1.2, zorder=3)\n",
|
| 768 |
+
"\n",
|
| 769 |
+
" # Mark strict-move positions (non-zero ternary in display coords)\n",
|
| 770 |
+
" # Transition k corresponds to display segment [N-2-k, N-1-k]\n",
|
| 771 |
+
" # Highlight the newer-side node at display index N-1-k = N-1-k\n",
|
| 772 |
+
" strict_k = np.where(ternary[i] != 0)[0] # transition indices\n",
|
| 773 |
+
" strict_disp = (N - 1 - strict_k).astype(int) # display x-positions\n",
|
| 774 |
+
" if strict_disp.size > 0:\n",
|
| 775 |
+
" ax.scatter(strict_disp, poc[strict_disp],\n",
|
| 776 |
+
" color=color, s=5, zorder=5, linewidths=0)\n",
|
| 777 |
+
"\n",
|
| 778 |
+
" # Flat segments (equality)\n",
|
| 779 |
+
" flat_k = np.where(ternary[i] == 0)[0]\n",
|
| 780 |
+
" flat_disp = (N - 1 - flat_k).astype(int)\n",
|
| 781 |
+
" if flat_disp.size > 0:\n",
|
| 782 |
+
" ax.scatter(flat_disp, poc[flat_disp],\n",
|
| 783 |
+
" color='gray', s=3, zorder=4, linewidths=0, alpha=0.5)\n",
|
| 784 |
+
"\n",
|
| 785 |
+
" n_strict = int(np.abs(ternary[i]).sum())\n",
|
| 786 |
+
" pid_short = int(pat_ids[i]) % 10**9 # last 9 digits for readability\n",
|
| 787 |
+
" ax.set_title(f\"#{i+1} {label} mv={n_strict} β¦{pid_short:09d}\",\n",
|
| 788 |
+
" fontsize=5.5, pad=2, color=color)\n",
|
| 789 |
+
"\n",
|
| 790 |
+
" ax.set_xlim(-0.5, N - 0.5)\n",
|
| 791 |
+
" ax.set_xticks(x_tick_pos)\n",
|
| 792 |
+
" ax.set_xticklabels(['βold', '', '', '', 'newβ'], fontsize=3.5)\n",
|
| 793 |
+
" ax.tick_params(axis='y', labelsize=3.5)\n",
|
| 794 |
+
" ax.yaxis.set_major_locator(mticker.MaxNLocator(4))\n",
|
| 795 |
+
" for sp in ('top', 'right'):\n",
|
| 796 |
+
" ax.spines[sp].set_visible(False)\n",
|
| 797 |
+
" ax.spines['left'].set_color(color)\n",
|
| 798 |
+
" ax.spines['left'].set_linewidth(1.5)\n",
|
| 799 |
+
" ax.spines['bottom'].set_color('#cccccc')\n",
|
| 800 |
+
"\n",
|
| 801 |
+
"plt.tight_layout(rect=[0, 0, 1, 1])\n",
|
| 802 |
+
"chart_path = \"TopoDevPOC_n39_100samples.png\"\n",
|
| 803 |
+
"plt.savefig(chart_path, dpi=110, bbox_inches='tight')\n",
|
| 804 |
+
"plt.close(fig)\n",
|
| 805 |
+
"print(f\" [SAVED] {chart_path}\")\n",
|
| 806 |
+
"\n",
|
| 807 |
+
"# ββ ASCII CLI chart for first 10 patterns ββββββββββββββββββββββββββββββββββββ\n",
|
| 808 |
+
"H = 7 # chart height in rows\n",
|
| 809 |
+
"W = 39 # chart width = N\n",
|
| 810 |
+
"\n",
|
| 811 |
+
"print(f\"\\n ASCII CLI Charts β first 10 samples (right side = C_0 = newest)\\n\")\n",
|
| 812 |
+
"for i in range(10):\n",
|
| 813 |
+
" poc = poc_disp[i]\n",
|
| 814 |
+
" d_lbl = \"Bullish\" if dir_bits[i] == 0 else \"Bearish\"\n",
|
| 815 |
+
" pid = int(pat_ids[i])\n",
|
| 816 |
+
" n_mv = int(np.abs(ternary[i]).sum())\n",
|
| 817 |
+
" pmin, pmax = poc.min(), poc.max()\n",
|
| 818 |
+
" span = pmax - pmin if pmax != pmin else 1.0\n",
|
| 819 |
+
"\n",
|
| 820 |
+
" # Map each x-position to a row\n",
|
| 821 |
+
" rows = (H - 1 - ((poc - pmin) / span * (H - 1))).round().astype(int)\n",
|
| 822 |
+
" rows = np.clip(rows, 0, H - 1)\n",
|
| 823 |
+
"\n",
|
| 824 |
+
" grid = [[' '] * W for _ in range(H)]\n",
|
| 825 |
+
" for j in range(W):\n",
|
| 826 |
+
" r = rows[j]\n",
|
| 827 |
+
" # Strict-move node in the pair ending at display j:\n",
|
| 828 |
+
" # transition index k = N-1-j (if j < N-1)\n",
|
| 829 |
+
" is_strict = (j < N - 1) and (ternary[i, N - 2 - j] != 0)\n",
|
| 830 |
+
" grid[r][j] = 'β' if is_strict else 'Β·'\n",
|
| 831 |
+
" # Connect with horizontal dash where poc is flat\n",
|
| 832 |
+
" for row_idx in range(H):\n",
|
| 833 |
+
" line = grid[row_idx]\n",
|
| 834 |
+
" for j in range(1, W):\n",
|
| 835 |
+
" if line[j] == ' ' and rows[j] == row_idx:\n",
|
| 836 |
+
" line[j] = '-'\n",
|
| 837 |
+
"\n",
|
| 838 |
+
" print(f\" [{i+1:2d}] {d_lbl:7s} | ID={pid} | strict_moves={n_mv}/{N_TRANS}\")\n",
|
| 839 |
+
" poc_hi = poc[N-1]; poc_lo = poc[0]\n",
|
| 840 |
+
" print(f\" POC range: oldest={poc_lo:.0f} β newest={poc_hi:.0f}\")\n",
|
| 841 |
+
" print(f\" β{'β'*W}β\")\n",
|
| 842 |
+
" for row_idx in range(H):\n",
|
| 843 |
+
" print(f\" β{''.join(grid[row_idx])}β\")\n",
|
| 844 |
+
" print(f\" β{'β'*W}β\")\n",
|
| 845 |
+
" sym_preview = ' '.join(sym_matrix[i, :12]) + ' β¦'\n",
|
| 846 |
+
" print(f\" Ξ£ (first 12): {sym_preview}\\n\")\n",
|
| 847 |
+
"\n",
|
| 848 |
+
"# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ\n",
|
| 849 |
+
"# FINAL SUMMARY\n",
|
| 850 |
+
"# ββββββββββββββββββββββββββββββββββββββββββββββββββββοΏ½οΏ½οΏ½ββββββββββββββββββββββββ\n",
|
| 851 |
+
"total_ms = (time.perf_counter() - t_sample) * 1e3\n",
|
| 852 |
+
"print(SEP)\n",
|
| 853 |
+
"print(\" SUMMARY\")\n",
|
| 854 |
+
"print(SEP)\n",
|
| 855 |
+
"print(f\" n (candles) = {N}\")\n",
|
| 856 |
+
"print(f\" Transitions per pattern = {N_TRANS}\")\n",
|
| 857 |
+
"print(f\" Total patterns [2^{N}] = {TOTAL:,}\")\n",
|
| 858 |
+
"print(f\" Bullish [2^{N-1}] = {HALF:,}\")\n",
|
| 859 |
+
"print(f\" Bearish [2^{N-1}] = {HALF:,}\")\n",
|
| 860 |
+
"print(f\" Matrix B_n validated = {B_n:,} β\")\n",
|
| 861 |
+
"print(f\" Samples generated = {N_SAMPLES}\")\n",
|
| 862 |
+
"print(f\" Chart file = {chart_path}\")\n",
|
| 863 |
+
"print(f\" Compute device = {DEVICE}\")\n",
|
| 864 |
+
"print(f\" Wall-clock (sample+decode) = {total_ms:.2f} ms\")\n",
|
| 865 |
+
"print(SEP)\n",
|
| 866 |
+
"print()\n",
|
| 867 |
+
"print(\" CONVERSION FORMULAS (tex Sec. V)\")\n",
|
| 868 |
+
"print(\" Symbolic β Ternary:\")\n",
|
| 869 |
+
"print(\" Bullish: '>' β +1, '=' β 0\")\n",
|
| 870 |
+
"print(\" Bearish: '<' β -1, '=' β 0\")\n",
|
| 871 |
+
"print(\" Ternary β Symbolic:\")\n",
|
| 872 |
+
"print(\" +1 β '>', 0 β '=', -1 β '<'\")\n",
|
| 873 |
+
"print()\n",
|
| 874 |
+
"print(\" TEMPORAL CONVENTION:\")\n",
|
| 875 |
+
"print(f\" Chart x-axis: left = C_{{-{N-1}}} (oldest) β right = C_0 (newest)\")\n",
|
| 876 |
+
"print(\" Bullish pattern: POC non-increasing toward right (higher on left)\")\n",
|
| 877 |
+
"print(\" Bearish pattern: POC non-decreasing toward right (lower on left)\")\n",
|
| 878 |
+
"print(SEP)"
|
| 879 |
+
]
|
| 880 |
+
}
|
| 881 |
+
]
|
| 882 |
+
}
|
TopoDevPOC_n39.py
ADDED
|
@@ -0,0 +1,423 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# !pip -q install numpy matplotlib warp-lang torch
|
| 2 |
+
#!/usr/bin/env python3
|
| 3 |
+
"""
|
| 4 |
+
TopoDevPOC_n39.py
|
| 5 |
+
Topologically Unique Developing Point of Control Patterns
|
| 6 |
+
Pre-market K-Lines, n = 39 three-minute candlesticks
|
| 7 |
+
|
| 8 |
+
Paper : TopoDevPOC.tex (ConQ Research Team, Continual Quasars)
|
| 9 |
+
Compute: Vectorized NumPy + GPU Torch (T4) + Warp branchless ops
|
| 10 |
+
Architectural patterns from core_engine_v11.py (Hyper-Warp Edition)
|
| 11 |
+
|
| 12 |
+
Outputs (CLI):
|
| 13 |
+
1. Total combination count for n=39
|
| 14 |
+
2. Matrix state-transition validation
|
| 15 |
+
3. 100 random ternary matrices (1Γ38 each)
|
| 16 |
+
4. 100 random symbolic sequences (length-38 strings)
|
| 17 |
+
5. 100 developing_poc charts saved as PNG + ASCII CLI preview
|
| 18 |
+
|
| 19 |
+
Run on Google Colab T4:
|
| 20 |
+
!python TopoDevPOC_n39.py
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
# ββ stdlib ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 24 |
+
import os, sys, time, math
|
| 25 |
+
import numpy as np
|
| 26 |
+
|
| 27 |
+
# ββ matplotlib (non-interactive for Colab CLI) ββββββββββββββββββββββββββββββββ
|
| 28 |
+
import matplotlib
|
| 29 |
+
matplotlib.use('Agg')
|
| 30 |
+
import matplotlib.pyplot as plt
|
| 31 |
+
import matplotlib.ticker as mticker
|
| 32 |
+
|
| 33 |
+
# ββ GPU setup (T4 Colab) βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 34 |
+
try:
|
| 35 |
+
import torch
|
| 36 |
+
HAS_CUDA = torch.cuda.is_available()
|
| 37 |
+
DEVICE = 'cuda' if HAS_CUDA else 'cpu'
|
| 38 |
+
except ImportError:
|
| 39 |
+
HAS_CUDA = False
|
| 40 |
+
DEVICE = 'cpu'
|
| 41 |
+
torch = None
|
| 42 |
+
|
| 43 |
+
# Optional Warp (core_engine_v11.py pattern) βββββββββββββββββββββββββββββββββ
|
| 44 |
+
HAS_WARP = False
|
| 45 |
+
try:
|
| 46 |
+
import warp as wp
|
| 47 |
+
wp.init()
|
| 48 |
+
wp.set_module_options({"enable_backward": False, "fast_math": True, "max_unroll": 8})
|
| 49 |
+
HAS_WARP = bool(wp.get_cuda_devices())
|
| 50 |
+
except Exception:
|
| 51 |
+
pass
|
| 52 |
+
|
| 53 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 54 |
+
# CONSTANTS (tex Section II)
|
| 55 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 56 |
+
N = 39 # pre-market 3-min candles (C_0 β¦ C_{-(n-1)})
|
| 57 |
+
N_TRANS = N - 1 # 38 adjacent-pair relations
|
| 58 |
+
N_SAMPLES = 100
|
| 59 |
+
SEED = int(time.time() * 1000) & 0x7FFFFFFF
|
| 60 |
+
|
| 61 |
+
SEP = "=" * 74
|
| 62 |
+
|
| 63 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 64 |
+
# 0. HEADER
|
| 65 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 66 |
+
print(SEP)
|
| 67 |
+
print(" TopoDevPOC β Developing POC Pattern Enumerator")
|
| 68 |
+
print(f" n = {N} candles | {N_TRANS} transitions | device = {DEVICE}")
|
| 69 |
+
if HAS_CUDA and torch:
|
| 70 |
+
print(f" GPU = {torch.cuda.get_device_name(0)}")
|
| 71 |
+
if HAS_WARP:
|
| 72 |
+
print(f" Warp = enabled (branchless kernel path)")
|
| 73 |
+
print(SEP)
|
| 74 |
+
|
| 75 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 76 |
+
# SECTION 1 β COMBINATORIAL ENUMERATION (tex Theorem, Sec. III)
|
| 77 |
+
#
|
| 78 |
+
# Bullish: each of (n-1) transitions β {>, =} β 2^(n-1) patterns
|
| 79 |
+
# Bearish: each of (n-1) transitions β {<, =} β 2^(n-1) patterns
|
| 80 |
+
# Total : 2^(n-1) + 2^(n-1) = 2^n (disjoint families)
|
| 81 |
+
# n=39 : 2^39 = 549,755,813,888
|
| 82 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 83 |
+
TOTAL = 1 << N # exact Python int (arbitrary precision)
|
| 84 |
+
HALF = 1 << (N - 1)
|
| 85 |
+
|
| 86 |
+
print(f"\n[THEOREM] Total unique developing POC patterns for n={N}")
|
| 87 |
+
print(f" Bullish (non-increasing) : 2^{N-1} = {HALF:,}")
|
| 88 |
+
print(f" Bearish (non-decreasing) : 2^{N-1} = {HALF:,}")
|
| 89 |
+
print(f" Total (2^{N}) : {TOTAL:,}")
|
| 90 |
+
|
| 91 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 92 |
+
# SECTION 2 β MATRIX STATE-TRANSITION VALIDATION (tex Sec. IV)
|
| 93 |
+
#
|
| 94 |
+
# States : S_0 (equality), S_Β± (strict move)
|
| 95 |
+
# A = [[1,1],[1,1]] (fully-connected 2-state digraph)
|
| 96 |
+
# v_0 = [1,1]^T (both states reachable initially)
|
| 97 |
+
#
|
| 98 |
+
# B_n = 1^T Β· A^(n-2) Β· v_0
|
| 99 |
+
# = 2^(n-3) Β· 1^T Β· A Β· 1 (using A^k = 2^(k-1)Β·A for kβ₯1)
|
| 100 |
+
# = 2^(n-3) Β· 4 = 2^(n-1) per direction
|
| 101 |
+
#
|
| 102 |
+
# Implementation: exact Python-int matrix exponentiation (no float rounding)
|
| 103 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 104 |
+
|
| 105 |
+
def _mm2(A, B):
|
| 106 |
+
"""Exact 2Γ2 matrix multiply with Python arbitrary-precision ints."""
|
| 107 |
+
return [
|
| 108 |
+
[A[0][0]*B[0][0] + A[0][1]*B[1][0], A[0][0]*B[0][1] + A[0][1]*B[1][1]],
|
| 109 |
+
[A[1][0]*B[0][0] + A[1][1]*B[1][0], A[1][0]*B[0][1] + A[1][1]*B[1][1]],
|
| 110 |
+
]
|
| 111 |
+
|
| 112 |
+
def _mpow2(M, k):
|
| 113 |
+
"""Fast 2Γ2 matrix power, exact ints, O(log k)."""
|
| 114 |
+
if k == 0: return [[1,0],[0,1]]
|
| 115 |
+
if k == 1: return M
|
| 116 |
+
h = _mpow2(M, k >> 1)
|
| 117 |
+
s = _mm2(h, h)
|
| 118 |
+
return s if (k & 1) == 0 else _mm2(s, M)
|
| 119 |
+
|
| 120 |
+
A_mat = [[1,1],[1,1]]
|
| 121 |
+
v0 = [1, 1]
|
| 122 |
+
A_pow = _mpow2(A_mat, N - 2)
|
| 123 |
+
# 1^T Β· A^(n-2) Β· v0
|
| 124 |
+
Av0_0 = A_pow[0][0]*v0[0] + A_pow[0][1]*v0[1]
|
| 125 |
+
Av0_1 = A_pow[1][0]*v0[0] + A_pow[1][1]*v0[1]
|
| 126 |
+
B_n = Av0_0 + Av0_1 # = 1^T Β· (A^(n-2)Β·v0)
|
| 127 |
+
|
| 128 |
+
print(f"\n[MATRIX] A = [[1,1],[1,1]] | v_0 = [1,1]^T")
|
| 129 |
+
print(f" A^{N-2} = [[{A_pow[0][0]}, {A_pow[0][1]}],")
|
| 130 |
+
print(f" [{A_pow[1][0]}, {A_pow[1][1]}]]")
|
| 131 |
+
print(f" B_{N} = 1^T Β· A^{N-2} Β· v_0 = {B_n:,}")
|
| 132 |
+
print(f" Expected 2^{{n-1}} = {HALF:,}")
|
| 133 |
+
assert B_n == HALF, f"Matrix B_n mismatch: {B_n} β {HALF}"
|
| 134 |
+
assert 2 * B_n == TOTAL, f"Total mismatch: {2*B_n} β {TOTAL}"
|
| 135 |
+
print(f" [OK] 2 Γ {B_n:,} = {TOTAL:,} β")
|
| 136 |
+
|
| 137 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 138 |
+
# SECTION 3 β PATTERN ENCODING SCHEME
|
| 139 |
+
#
|
| 140 |
+
# Each of the 2^39 patterns maps bijectively to a 39-bit integer:
|
| 141 |
+
# bit 0 : direction (0 = Bullish, 1 = Bearish)
|
| 142 |
+
# bits 1 β¦ N-1 : transitions (1 = strict move, 0 = equality)
|
| 143 |
+
#
|
| 144 |
+
# pattern_id β [0, 2^39) uniquely identifies every valid pattern.
|
| 145 |
+
#
|
| 146 |
+
# Ternary matrix m β {+1,0}^(n-1) for bullish,
|
| 147 |
+
# m β {-1,0}^(n-1) for bearish.
|
| 148 |
+
# Bijection: m_k = sign(direction) Γ trans_bit_k
|
| 149 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 150 |
+
|
| 151 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 152 |
+
# SECTION 4 β GPU-ACCELERATED RANDOM SAMPLING
|
| 153 |
+
# Generate (N_SAMPLES Γ N) binary matrix at once on T4 GPU.
|
| 154 |
+
# Inspired by core_engine_v11.py XOR-shift PRNG kernel design.
|
| 155 |
+
# bits[:,0] = direction flags
|
| 156 |
+
# bits[:,1:] = N_TRANS transition flags per pattern
|
| 157 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 158 |
+
|
| 159 |
+
t_sample = time.perf_counter()
|
| 160 |
+
|
| 161 |
+
if HAS_WARP:
|
| 162 |
+
# ββ Warp branchless path (core_engine_v11.py style) βββββββββββββββββββββ
|
| 163 |
+
# Launch one thread per sample; XOR-shift fills N bits per thread.
|
| 164 |
+
_seed_wp = SEED
|
| 165 |
+
|
| 166 |
+
@wp.kernel
|
| 167 |
+
def k_rng_bits(seed: int, N_cols: int,
|
| 168 |
+
out: wp.array(dtype=wp.int8)):
|
| 169 |
+
tid = wp.tid()
|
| 170 |
+
rng = wp.uint32(seed) ^ wp.uint32(tid)
|
| 171 |
+
if rng == wp.uint32(0):
|
| 172 |
+
rng = wp.uint32(123456789)
|
| 173 |
+
base = tid * N_cols
|
| 174 |
+
for col in range(N_cols):
|
| 175 |
+
rng = rng ^ (rng << wp.uint32(13))
|
| 176 |
+
rng = rng ^ (rng >> wp.uint32(17))
|
| 177 |
+
rng = rng ^ (rng << wp.uint32(5))
|
| 178 |
+
out[base + col] = wp.int8(int(rng) & 1)
|
| 179 |
+
|
| 180 |
+
out_wp = wp.zeros(N_SAMPLES * N, dtype=wp.int8, device='cuda')
|
| 181 |
+
wp.launch(k_rng_bits, dim=N_SAMPLES, block_dim=128,
|
| 182 |
+
inputs=[_seed_wp, N, out_wp], device='cuda')
|
| 183 |
+
wp.synchronize()
|
| 184 |
+
bits_np = out_wp.numpy().reshape(N_SAMPLES, N)
|
| 185 |
+
print(f"\n[SAMPLE] {N_SAMPLES} patterns sampled via Warp XOR-shift kernel")
|
| 186 |
+
|
| 187 |
+
elif HAS_CUDA and torch is not None:
|
| 188 |
+
# ββ Torch GPU path βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 189 |
+
gen = torch.Generator(device='cuda')
|
| 190 |
+
gen.manual_seed(SEED)
|
| 191 |
+
bits_t = torch.randint(0, 2, (N_SAMPLES, N), device='cuda',
|
| 192 |
+
generator=gen, dtype=torch.int8)
|
| 193 |
+
bits_np = bits_t.cpu().numpy()
|
| 194 |
+
print(f"\n[SAMPLE] {N_SAMPLES} patterns sampled on GPU (torch.randint)")
|
| 195 |
+
|
| 196 |
+
else:
|
| 197 |
+
# ββ CPU NumPy fallback ββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 198 |
+
rng_cpu = np.random.default_rng(SEED)
|
| 199 |
+
bits_np = rng_cpu.integers(0, 2, size=(N_SAMPLES, N), dtype=np.int8)
|
| 200 |
+
print(f"\n[SAMPLE] {N_SAMPLES} patterns sampled on CPU (NumPy)")
|
| 201 |
+
|
| 202 |
+
sample_ms = (time.perf_counter() - t_sample) * 1e3
|
| 203 |
+
print(f" Sampling time: {sample_ms:.2f} ms")
|
| 204 |
+
|
| 205 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 206 |
+
# SECTION 5 β VECTORISED DECODING (NumPy, no Python loops over patterns)
|
| 207 |
+
#
|
| 208 |
+
# bits[:,0] β direction array (0=Bullish, 1=Bearish), shape (100,)
|
| 209 |
+
# bits[:,1:] β trans array, shape (100, 38)
|
| 210 |
+
# ternary_mat: +trans if Bullish, -trans if Bearish β shape (100, 38)
|
| 211 |
+
# sign: Bullishβ+1, Bearishβ-1, broadcast multiply
|
| 212 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 213 |
+
|
| 214 |
+
dir_bits = bits_np[:, 0].astype(np.int8) # 0 or 1
|
| 215 |
+
trans = bits_np[:, 1:].astype(np.int8) # (100,38), values 0 or 1
|
| 216 |
+
signs = 1 - 2 * dir_bits # 0β+1 (bull), 1β-1 (bear)
|
| 217 |
+
ternary = (signs[:, None] * trans).astype(np.int8) # (100,38): +1/0/-1
|
| 218 |
+
|
| 219 |
+
# Compact 39-bit pattern IDs
|
| 220 |
+
pows64 = (np.uint64(1) << np.arange(N, dtype=np.uint64))
|
| 221 |
+
pat_ids = (bits_np.astype(np.uint64) * pows64[None, :]).sum(axis=1)
|
| 222 |
+
|
| 223 |
+
# Symbolic sequences: vectorised char lookup
|
| 224 |
+
# Bullish (sign=+1): trans=1 β '>', trans=0 β '='
|
| 225 |
+
# Bearish (sign=-1): trans=1 β '<', trans=0 β '='
|
| 226 |
+
SYM_BULL = np.array(['=', '>'], dtype='<U1') # index by trans bit
|
| 227 |
+
SYM_BEAR = np.array(['=', '<'], dtype='<U1')
|
| 228 |
+
sym_matrix = np.where(dir_bits[:, None] == 0,
|
| 229 |
+
SYM_BULL[trans],
|
| 230 |
+
SYM_BEAR[trans]) # (100, 38)
|
| 231 |
+
|
| 232 |
+
# POC price sequence (right-to-left: p[0]=C_0=newest, p[N-1]=C_{-(N-1)}=oldest)
|
| 233 |
+
# p_raw[i, k] = POC of candle C_{-k} for sample i
|
| 234 |
+
# Transition k: p[k] = p[k+1] + ternary[k]
|
| 235 |
+
# Build by cumsum from oldestβnewest: p_raw[:, N-1] = 50, then forward
|
| 236 |
+
BASE = 50.0
|
| 237 |
+
step = 1.0
|
| 238 |
+
p_raw = np.zeros((N_SAMPLES, N), dtype=np.float32)
|
| 239 |
+
p_raw[:, N-1] = BASE
|
| 240 |
+
# Vectorised: cumulative sum of ternary (columns N-2 down to 0)
|
| 241 |
+
for k in range(N-2, -1, -1):
|
| 242 |
+
p_raw[:, k] = p_raw[:, k+1] + ternary[:, k].astype(np.float32) * step
|
| 243 |
+
|
| 244 |
+
# Display order: oldest(left) β newest(right)
|
| 245 |
+
# poc_disp[:, j] = p_raw[:, N-1-j]
|
| 246 |
+
poc_disp = p_raw[:, ::-1].copy() # (100, 39), column 0=oldest, col N-1=newest
|
| 247 |
+
|
| 248 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 249 |
+
# OUTPUT 1 β TERNARY MATRICES (100 Γ 38)
|
| 250 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 251 |
+
print(f"\n{SEP}")
|
| 252 |
+
print(f" OUTPUT 1 β TERNARY MATRICES (1Γ{N_TRANS}, values β {{-1,0,+1}})")
|
| 253 |
+
print(f" Format: [#] Direction | PatternID | M = [m_0 β¦ m_37]")
|
| 254 |
+
print(SEP)
|
| 255 |
+
|
| 256 |
+
for i in range(N_SAMPLES):
|
| 257 |
+
d_label = "Bullish" if dir_bits[i] == 0 else "Bearish"
|
| 258 |
+
pid = int(pat_ids[i])
|
| 259 |
+
row_str = np.array2string(ternary[i], separator=',',
|
| 260 |
+
max_line_width=400).replace('\n','')
|
| 261 |
+
print(f" [{i+1:3d}] {d_label:7s} | ID={pid:>15d} | M={row_str}")
|
| 262 |
+
|
| 263 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 264 |
+
# OUTPUT 2 β SYMBOLIC SEQUENCES (length 38)
|
| 265 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 266 |
+
print(f"\n{SEP}")
|
| 267 |
+
print(f" OUTPUT 2 β SYMBOLIC SEQUENCES (Ξ£, length {N_TRANS})")
|
| 268 |
+
print(f" Format: [#] Direction | PatternID | Ξ£ = Ο_0 Ο_1 β¦ Ο_37")
|
| 269 |
+
print(SEP)
|
| 270 |
+
|
| 271 |
+
for i in range(N_SAMPLES):
|
| 272 |
+
d_label = "Bullish" if dir_bits[i] == 0 else "Bearish"
|
| 273 |
+
pid = int(pat_ids[i])
|
| 274 |
+
seq_str = ' '.join(sym_matrix[i])
|
| 275 |
+
print(f" [{i+1:3d}] {d_label:7s} | ID={pid:>15d} | Ξ£ = {seq_str}")
|
| 276 |
+
|
| 277 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 278 |
+
# OUTPUT 3 β CHARTS
|
| 279 |
+
# (a) Full matplotlib figure: 10Γ10 grid, saved to PNG
|
| 280 |
+
# (b) ASCII CLI preview for first 10 patterns
|
| 281 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 282 |
+
print(f"\n{SEP}")
|
| 283 |
+
print(f" OUTPUT 3 β DEVELOPING POC CHARTS (100 patterns)")
|
| 284 |
+
print(SEP)
|
| 285 |
+
|
| 286 |
+
# ββ x-axis: position 0=oldest C_{-(N-1)}, N-1=newest C_0 ββββββββββββββββββ
|
| 287 |
+
x_pos = np.arange(N, dtype=np.float32)
|
| 288 |
+
x_tick_pos = [0, 9, 19, 29, N-1]
|
| 289 |
+
x_tick_lbl = [f'C_{{-{N-1}}}', f'C_{{-29}}', f'C_{{-19}}', f'C_{{-9}}', 'C_0']
|
| 290 |
+
|
| 291 |
+
ROWS, COLS = 10, 10
|
| 292 |
+
fig = plt.figure(figsize=(COLS * 3.2, ROWS * 2.0))
|
| 293 |
+
fig.suptitle(
|
| 294 |
+
f"TopoDevPOC β 100 Random Developing POC Patterns "
|
| 295 |
+
f"n={N} pre-market 3-min K-lines\n"
|
| 296 |
+
f"Total pattern space: 2^{N} = {TOTAL:,} "
|
| 297 |
+
f"(Bullish: {HALF:,} | Bearish: {HALF:,})",
|
| 298 |
+
fontsize=10, y=1.005
|
| 299 |
+
)
|
| 300 |
+
|
| 301 |
+
for i in range(N_SAMPLES):
|
| 302 |
+
ax = fig.add_subplot(ROWS, COLS, i + 1)
|
| 303 |
+
poc = poc_disp[i]
|
| 304 |
+
is_bull = (dir_bits[i] == 0)
|
| 305 |
+
color = '#1a6eb5' if is_bull else '#c0392b'
|
| 306 |
+
label = 'Bβ' if is_bull else 'Bβ'
|
| 307 |
+
|
| 308 |
+
# Background shade
|
| 309 |
+
ax.set_facecolor('#f7f9fc' if is_bull else '#fdf4f4')
|
| 310 |
+
|
| 311 |
+
# POC line
|
| 312 |
+
ax.plot(x_pos, poc, color=color, linewidth=1.2, zorder=3)
|
| 313 |
+
|
| 314 |
+
# Mark strict-move positions (non-zero ternary in display coords)
|
| 315 |
+
# Transition k corresponds to display segment [N-2-k, N-1-k]
|
| 316 |
+
# Highlight the newer-side node at display index N-1-k = N-1-k
|
| 317 |
+
strict_k = np.where(ternary[i] != 0)[0] # transition indices
|
| 318 |
+
strict_disp = (N - 1 - strict_k).astype(int) # display x-positions
|
| 319 |
+
if strict_disp.size > 0:
|
| 320 |
+
ax.scatter(strict_disp, poc[strict_disp],
|
| 321 |
+
color=color, s=5, zorder=5, linewidths=0)
|
| 322 |
+
|
| 323 |
+
# Flat segments (equality)
|
| 324 |
+
flat_k = np.where(ternary[i] == 0)[0]
|
| 325 |
+
flat_disp = (N - 1 - flat_k).astype(int)
|
| 326 |
+
if flat_disp.size > 0:
|
| 327 |
+
ax.scatter(flat_disp, poc[flat_disp],
|
| 328 |
+
color='gray', s=3, zorder=4, linewidths=0, alpha=0.5)
|
| 329 |
+
|
| 330 |
+
n_strict = int(np.abs(ternary[i]).sum())
|
| 331 |
+
pid_short = int(pat_ids[i]) % 10**9 # last 9 digits for readability
|
| 332 |
+
ax.set_title(f"#{i+1} {label} mv={n_strict} β¦{pid_short:09d}",
|
| 333 |
+
fontsize=5.5, pad=2, color=color)
|
| 334 |
+
|
| 335 |
+
ax.set_xlim(-0.5, N - 0.5)
|
| 336 |
+
ax.set_xticks(x_tick_pos)
|
| 337 |
+
ax.set_xticklabels(['βold', '', '', '', 'newβ'], fontsize=3.5)
|
| 338 |
+
ax.tick_params(axis='y', labelsize=3.5)
|
| 339 |
+
ax.yaxis.set_major_locator(mticker.MaxNLocator(4))
|
| 340 |
+
for sp in ('top', 'right'):
|
| 341 |
+
ax.spines[sp].set_visible(False)
|
| 342 |
+
ax.spines['left'].set_color(color)
|
| 343 |
+
ax.spines['left'].set_linewidth(1.5)
|
| 344 |
+
ax.spines['bottom'].set_color('#cccccc')
|
| 345 |
+
|
| 346 |
+
plt.tight_layout(rect=[0, 0, 1, 1])
|
| 347 |
+
chart_path = "TopoDevPOC_n39_100samples.png"
|
| 348 |
+
plt.savefig(chart_path, dpi=110, bbox_inches='tight')
|
| 349 |
+
plt.close(fig)
|
| 350 |
+
print(f" [SAVED] {chart_path}")
|
| 351 |
+
|
| 352 |
+
# ββ ASCII CLI chart for first 10 patterns ββββββββββββββββββββββββββββββββββββ
|
| 353 |
+
H = 7 # chart height in rows
|
| 354 |
+
W = 39 # chart width = N
|
| 355 |
+
|
| 356 |
+
print(f"\n ASCII CLI Charts β first 10 samples (right side = C_0 = newest)\n")
|
| 357 |
+
for i in range(10):
|
| 358 |
+
poc = poc_disp[i]
|
| 359 |
+
d_lbl = "Bullish" if dir_bits[i] == 0 else "Bearish"
|
| 360 |
+
pid = int(pat_ids[i])
|
| 361 |
+
n_mv = int(np.abs(ternary[i]).sum())
|
| 362 |
+
pmin, pmax = poc.min(), poc.max()
|
| 363 |
+
span = pmax - pmin if pmax != pmin else 1.0
|
| 364 |
+
|
| 365 |
+
# Map each x-position to a row
|
| 366 |
+
rows = (H - 1 - ((poc - pmin) / span * (H - 1))).round().astype(int)
|
| 367 |
+
rows = np.clip(rows, 0, H - 1)
|
| 368 |
+
|
| 369 |
+
grid = [[' '] * W for _ in range(H)]
|
| 370 |
+
for j in range(W):
|
| 371 |
+
r = rows[j]
|
| 372 |
+
# Strict-move node in the pair ending at display j:
|
| 373 |
+
# transition index k = N-1-j (if j < N-1)
|
| 374 |
+
is_strict = (j < N - 1) and (ternary[i, N - 2 - j] != 0)
|
| 375 |
+
grid[r][j] = 'β' if is_strict else 'Β·'
|
| 376 |
+
# Connect with horizontal dash where poc is flat
|
| 377 |
+
for row_idx in range(H):
|
| 378 |
+
line = grid[row_idx]
|
| 379 |
+
for j in range(1, W):
|
| 380 |
+
if line[j] == ' ' and rows[j] == row_idx:
|
| 381 |
+
line[j] = '-'
|
| 382 |
+
|
| 383 |
+
print(f" [{i+1:2d}] {d_lbl:7s} | ID={pid} | strict_moves={n_mv}/{N_TRANS}")
|
| 384 |
+
poc_hi = poc[N-1]; poc_lo = poc[0]
|
| 385 |
+
print(f" POC range: oldest={poc_lo:.0f} β newest={poc_hi:.0f}")
|
| 386 |
+
print(f" β{'β'*W}β")
|
| 387 |
+
for row_idx in range(H):
|
| 388 |
+
print(f" β{''.join(grid[row_idx])}β")
|
| 389 |
+
print(f" β{'β'*W}β")
|
| 390 |
+
sym_preview = ' '.join(sym_matrix[i, :12]) + ' β¦'
|
| 391 |
+
print(f" Ξ£ (first 12): {sym_preview}\n")
|
| 392 |
+
|
| 393 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 394 |
+
# FINAL SUMMARY
|
| 395 |
+
# οΏ½οΏ½οΏ½ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 396 |
+
total_ms = (time.perf_counter() - t_sample) * 1e3
|
| 397 |
+
print(SEP)
|
| 398 |
+
print(" SUMMARY")
|
| 399 |
+
print(SEP)
|
| 400 |
+
print(f" n (candles) = {N}")
|
| 401 |
+
print(f" Transitions per pattern = {N_TRANS}")
|
| 402 |
+
print(f" Total patterns [2^{N}] = {TOTAL:,}")
|
| 403 |
+
print(f" Bullish [2^{N-1}] = {HALF:,}")
|
| 404 |
+
print(f" Bearish [2^{N-1}] = {HALF:,}")
|
| 405 |
+
print(f" Matrix B_n validated = {B_n:,} β")
|
| 406 |
+
print(f" Samples generated = {N_SAMPLES}")
|
| 407 |
+
print(f" Chart file = {chart_path}")
|
| 408 |
+
print(f" Compute device = {DEVICE}")
|
| 409 |
+
print(f" Wall-clock (sample+decode) = {total_ms:.2f} ms")
|
| 410 |
+
print(SEP)
|
| 411 |
+
print()
|
| 412 |
+
print(" CONVERSION FORMULAS (tex Sec. V)")
|
| 413 |
+
print(" Symbolic β Ternary:")
|
| 414 |
+
print(" Bullish: '>' β +1, '=' β 0")
|
| 415 |
+
print(" Bearish: '<' β -1, '=' β 0")
|
| 416 |
+
print(" Ternary β Symbolic:")
|
| 417 |
+
print(" +1 β '>', 0 β '=', -1 β '<'")
|
| 418 |
+
print()
|
| 419 |
+
print(" TEMPORAL CONVENTION:")
|
| 420 |
+
print(f" Chart x-axis: left = C_{{-{N-1}}} (oldest) β right = C_0 (newest)")
|
| 421 |
+
print(" Bullish pattern: POC non-increasing toward right (higher on left)")
|
| 422 |
+
print(" Bearish pattern: POC non-decreasing toward right (lower on left)")
|
| 423 |
+
print(SEP)
|
TopoDevPOC_n39_100samples.png
ADDED
|
Git LFS Details
|