algorembrant commited on
Commit
741995d
·
verified ·
1 Parent(s): d8cba76

Upload 4 files

Browse files
.gitattributes CHANGED
@@ -35,3 +35,5 @@ saved_model/**/* 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
 
 
 
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
38
+ developing_poc/md.topodevpoc.pdf filter=lfs diff=lfs merge=lfs -text
39
+ developing_poc/od.topodevpoc.pdf filter=lfs diff=lfs merge=lfs -text
developing_poc/md.topodevpoc.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ea9d2c75c30e83484ba65eef25e7d20a23e68a9f9de00b82b810f5406bcaca34
3
+ size 246412
developing_poc/md.topodevpoc.tex ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ \newtheorem{theorem}{Theorem}
11
+ \newtheorem{lemma}{Lemma}
12
+ \newtheorem{corollary}{Corollary}
13
+ \newtheorem{definition}{Definition}
14
+ \newtheorem{proposition}{Proposition}
15
+
16
+ \begin{document}
17
+
18
+ \title{MD.TopoDevPOC: Topologically Unique Multi-Directional Developing Point-of-Control Patterns in Pre-Market K-Lines}
19
+
20
+ \author{\IEEEauthorblockN{ConQ Research Team}\\
21
+ \IEEEauthorblockA{\textit{Continual Quasars}\\
22
+ \today}
23
+ }
24
+
25
+ \maketitle
26
+
27
+ \begin{abstract}
28
+ This paper characterizes the complete space of developing Point of Control (POC) line patterns on pre-market candlestick sequences when no directional monotonicity is imposed. Allowing each inter-candle relation to be strict-up ($<$), strict-down ($>$), or equality ($=$), we prove that for $n$ candles there are exactly $3^{\,n-1}$ distinct patterns. The derivation uses elementary combinatorics and is validated by a state-transition matrix on three states. A ternary vector encoding with values $+1$, $0$, $-1$ is introduced, together with bidirectional conversion formulas to the symbolic sequence. Two natural aggregated metrics are defined: the migration count $M$ (total number of strict moves, the $L_1$ norm of the vector) and the end-to-end (E2E) net balance $S$ (the signed sum of the vector). Exact combinatorial counts for given $M$ are provided, and the joint distribution of $M$ and $S$ is outlined. Ten illustrative random multi-directional patterns are displayed in both symbolic and vector formats, with a right-to-left temporal chart. All results are purely combinatorial and require no simulation.
29
+ \end{abstract}
30
+
31
+ \begin{IEEEkeywords}
32
+ developing POC, multi-directional patterns, combinatorial enumeration, ternary encoding, end-to-end balance, pre-market analysis
33
+ \end{IEEEkeywords}
34
+
35
+ \section{Introduction}
36
+
37
+ The developing Point of Control (POC) during the pre-market session can exhibit rich behavior, moving up, down, or remaining flat between consecutive three-minute candles. While constrained (monotonic) patterns have been studied in a companion work, the unrestricted case where the POC may reverse direction multiple times within a single session captures the full complexity of pre-market price discovery. The central question is: Given $n$ consecutive pre-market candles, each associated with a developing POC value, how many distinct sequences of direction relations (strict-up, strict-down, flat) can be formed? Furthermore, what compact metrics describe the overall movement?
38
+
39
+ This paper provides a comprehensive combinatorial treatment of multi-directional developing POC patterns. The main contributions are:
40
+ \begin{enumerate}
41
+ \item A closed-form enumeration: for $n$ candles, exactly $3^{\,n-1}$ distinct patterns exist.
42
+ \item A ternary vector representation $(+1,0,-1)$ that encodes each transition, with explicit bidirectional conversion to the symbolic form.
43
+ \item Definition and analysis of two end-to-end (E2E) metrics: the migration count $M$ (total strict moves) and the net balance $S$ (signed sum of moves). Exact formulas for the number of patterns with a given $M$ are derived.
44
+ \item A state-transition matrix formulation on three states that independently confirms the total count.
45
+ \item Ten illustrative patterns with a visual chart following the correct right-to-left temporal convention.
46
+ \end{enumerate}
47
+
48
+ No empirical data or simulations are used; the development is entirely theoretical.
49
+
50
+ \section{Problem Definition and Notation}
51
+
52
+ Let $n \in \mathbb{N}$ be the number of candles, with $n=39$ for a standard US pre-market session. Index candles from the most recent $C_0$ back to $C_{-(n-1)}$. The corresponding developing POC values form a real sequence
53
+ \begin{equation}
54
+ \mathbf{p} = (p_0, p_1, \dots, p_{n-1}) \in \mathbb{R}^n,
55
+ \end{equation}
56
+ where $p_k$ is the POC of candle $C_{-k}$. For each adjacent pair $(p_k, p_{k+1})$ we observe one of three possible relations:
57
+ \begin{definition}[Multi-Directional Relation]
58
+ The relation $R_k$ between $p_k$ and $p_{k+1}$ belongs to the set $\{\, <,\; >,\; = \,\}$,
59
+ where $<$ means $p_k < p_{k+1}$ (up move), $>$ means $p_k > p_{k+1}$ (down move), and $=$ means $p_k = p_{k+1}$ (flat).
60
+ \end{definition}
61
+ A pattern is uniquely identified by the $(n-1)$-tuple of relations
62
+ \begin{equation}
63
+ \mathbf{R} = (R_0, R_1, \dots, R_{n-2}), \quad R_k \in \{<, >, =\}.
64
+ \end{equation}
65
+ Two price sequences that yield the same $\mathbf{R}$ are considered equivalent. No further identification (e.g., by scaling or translation) is performed.
66
+
67
+ \section{Combinatorial Enumeration}
68
+
69
+ \begin{theorem}[Total Pattern Count]
70
+ For $n \ge 1$ candles, the number of distinct multi-directional developing POC patterns is
71
+ \begin{equation}
72
+ N_n = 3^{\,n-1}.
73
+ \end{equation}
74
+ \end{theorem}
75
+
76
+ \begin{proof}
77
+ For each of the $n-1$ adjacent pairs, there are three independent choices ($<$, $>$, $=$). Hence $N_n = 3^{\,n-1}$.
78
+ \end{proof}
79
+
80
+ For $n=39$, this evaluates to $3^{38} \approx 4.36 \times 10^{18}$. The space is vast, accommodating all possible sequences of directional moves and flats.
81
+
82
+ \subsection{State-Transition Matrix Confirmation}
83
+
84
+ The same result follows from a 3-state Markovian view. Define states corresponding to the last observed relation: $U$ (strict-up, $<$), $D$ (strict-down, $>$), and $F$ (flat, $=$). There are no restrictions on transitions, so any state can follow any state. The transition (adjacency) matrix is the all-ones matrix
85
+ \begin{equation}
86
+ \mathbf{A} = \begin{pmatrix}
87
+ 1 & 1 & 1 \\
88
+ 1 & 1 & 1 \\
89
+ 1 & 1 & 1
90
+ \end{pmatrix} = \mathbf{1}\mathbf{1}^\top,
91
+ \end{equation}
92
+ where $\mathbf{1} = (1,1,1)^\top$. With $n$ candles we have $n-1$ transitions. Let the initial state vector $\mathbf{v}_0 = (1,1,1)^\top$ (all states permissible before the first comparison). The total number of patterns is
93
+ \begin{equation}
94
+ N_n = \mathbf{1}^\top \mathbf{A}^{n-2} \mathbf{v}_0 .
95
+ \end{equation}
96
+ Since $\mathbf{A}^k = 3^{k-1} \mathbf{A}$ for $k \ge 1$, we obtain
97
+ \begin{align}
98
+ N_n &= \mathbf{1}^\top \left(3^{n-3} \mathbf{A}\right) \mathbf{v}_0 \nonumber \\
99
+ &= 3^{n-3} \, \mathbf{1}^\top \mathbf{A} \mathbf{1} \nonumber \\
100
+ &= 3^{n-3} \cdot 9 = 3^{\,n-1}.
101
+ \end{align}
102
+ This cross-check confirms the elementary counting argument.
103
+
104
+ \section{Ternary Encoding and Conversion}
105
+
106
+ A compact, signed representation of a pattern is given by a ternary vector of length $n-1$.
107
+
108
+ \begin{definition}[Ternary Transition Vector]
109
+ For a pattern with relations $\mathbf{R} = (R_0, \dots, R_{n-2})$, define the vector $\mathbf{m} = (m_0, \dots, m_{n-2})$ by
110
+ \begin{equation}
111
+ m_k = \begin{cases}
112
+ +1, & \text{if } R_k = \; < \;\;(\text{up}),\\
113
+ -1, & \text{if } R_k = \; > \;\;(\text{down}),\\
114
+ 0, & \text{if } R_k = \; = \;\;(\text{flat}).
115
+ \end{cases}
116
+ \end{equation}
117
+ \end{definition}
118
+
119
+ Thus $\mathbf{m} \in \{-1,0,+1\}^{n-1}$. The mapping is a bijection between the $3^{\,n-1}$ symbolic sequences and the ternary vectors.
120
+
121
+ \subsection{Conversion Formulas}
122
+
123
+ Let $\Sigma$ be a string of length $n-1$ over the alphabet $\{<, >, =\}$, ordered from $\Sigma_0$ (transition between $C_0$ and $C_{-1}$) to $\Sigma_{n-2}$.
124
+
125
+ \textbf{Symbolic $\to$ Ternary:}
126
+ \begin{equation}
127
+ m_j = f(\Sigma_j), \quad j=0,\dots,n-2,
128
+ \end{equation}
129
+ with $f(<)=+1$, $f(>)=-1$, $f(=)=0$.
130
+
131
+ \textbf{Ternary $\to$ Symbolic:}
132
+ \begin{equation}
133
+ \Sigma_j = g(m_j), \quad g(+1)=\;<,\; g(-1)=\;>,\; g(0)=\;=.
134
+ \end{equation}
135
+
136
+ The vector $\mathbf{m}$ is a row vector of size $1 \times (n-1)$.
137
+
138
+ \section{End-to-End Metrics: Migration Count and Net Balance}
139
+
140
+ Two aggregate properties naturally emerge from the ternary vector.
141
+
142
+ \begin{definition}[Migration Count $M$]
143
+ The number of strict directional moves, i.e., the count of non-zero entries in $\mathbf{m}$, is
144
+ \begin{equation}
145
+ M(\mathbf{m}) = \sum_{k=0}^{n-2} |m_k| = \|\mathbf{m}\|_1.
146
+ \end{equation}
147
+ \end{definition}
148
+
149
+ \begin{definition}[End-to-End (E2E) Net Balance $S$]
150
+ The signed sum of the moves, capturing the net directional bias from the most recent candle to the oldest, is
151
+ \begin{equation}
152
+ S(\mathbf{m}) = \sum_{k=0}^{n-2} m_k .
153
+ \end{equation}
154
+ \end{definition}
155
+
156
+ $M$ measures the total activity (number of POC level changes), while $S$ indicates whether the cumulative movement was net up ($S>0$), net down ($S<0$), or perfectly cancelled ($S=0$). The two are related by $M \equiv |S| \pmod{2}$ when only strict moves are present.
157
+
158
+ \subsection{Exact Counts by Migration Count}
159
+
160
+ For a fixed $M = k$ ($0 \le k \le n-1$), the number of patterns with exactly $k$ strict moves is
161
+ \begin{equation}
162
+ C_{n,k} = \binom{n-1}{k} \, 2^{\,k}.
163
+ \end{equation}
164
+ \textit{Derivation:} Choose $k$ positions out of $n-1$ to be strict; at each chosen position assign either $+1$ or $-1$ ($2$ choices). The remaining $n-1-k$ positions are $0$. Summing over $k$,
165
+ \[
166
+ \sum_{k=0}^{n-1} \binom{n-1}{k} 2^{\,k} = (1+2)^{\,n-1} = 3^{\,n-1},
167
+ \]
168
+ which recovers the total.
169
+
170
+ If each transition is chosen uniformly at random among the three symbols, then $M$ follows a binomial distribution: $M \sim \mathrm{Binomial}\bigl(n-1,\; \frac{2}{3}\bigr)$.
171
+
172
+ \subsection{Joint Distribution of $M$ and $S$}
173
+
174
+ The number of patterns with $M = k$ and a given net balance $S = s$ can be expressed as
175
+ \[
176
+ N_{k,s} = \binom{n-1}{k} \cdot \binom{k}{\frac{k+s}{2}},
177
+ \]
178
+ provided $s \equiv k \pmod{2}$ and $|s| \le k$; otherwise $N_{k,s}=0$. Summation of $N_{k,s}$ over $s$ returns $\binom{n-1}{k}2^{k}$.
179
+
180
+ \section{Illustrative Examples}
181
+
182
+ Table~\ref{tab:examples} shows ten randomly generated multi-directional patterns for $n=6$ candles (five transitions). Each row gives a unique ID, the symbolic sequence, the $1 \times 5$ ternary vector $\mathbf{m}$, migration count $M$, and net balance $S$.
183
+
184
+ \begin{table}[h]
185
+ \centering
186
+ \caption{Ten Random Multi-Directional Developing POC Patterns ($n=6$)}
187
+ \label{tab:examples}
188
+ \begin{tabular}{c c c c c}
189
+ \toprule
190
+ \textbf{ID} & \textbf{Symbolic Sequence} & \textbf{Ternary Vector $\mathbf{m}$} & \textbf{$M$} & \textbf{$S$} \\
191
+ \midrule
192
+ 1 & $> \; < \; = \; > \; >$ & $(-1,\, +1,\, 0,\, -1,\, -1)$ & 4 & -2 \\
193
+ 2 & $< \; = \; < \; > \; =$ & $(+1,\, 0,\, +1,\, -1,\, 0)$ & 3 & +1 \\
194
+ 3 & $= \; > \; < \; = \; <$ & $(0,\, -1,\, +1,\, 0,\, +1)$ & 3 & +1 \\
195
+ 4 & $< \; < \; < \; = \; >$ & $(+1,\, +1,\, +1,\, 0,\, -1)$ & 4 & +2 \\
196
+ 5 & $> \; = \; > \; < \; <$ & $(-1,\, 0,\, -1,\, +1,\, +1)$ & 4 & 0 \\
197
+ 6 & $= \; = \; < \; > \; =$ & $(0,\, 0,\, +1,\, -1,\, 0)$ & 2 & 0 \\
198
+ 7 & $< \; > \; = \; > \; <$ & $(+1,\, -1,\, 0,\, -1,\, +1)$ & 4 & 0 \\
199
+ 8 & $> \; < \; > \; = \; =$ & $(-1,\, +1,\, -1,\, 0,\, 0)$ & 3 & -1 \\
200
+ 9 & $= \; > \; = \; < \; >$ & $(0,\, -1,\, 0,\, +1,\, -1)$ & 3 & -1 \\
201
+ 10& $< \; = \; = \; > \; <$ & $(+1,\, 0,\, 0,\, -1,\, +1)$ & 3 & +1 \\
202
+ \bottomrule
203
+ \end{tabular}
204
+ \end{table}
205
+
206
+ \subsection{Visual Chart}
207
+
208
+ Figure~\ref{fig:multipattern} illustrates pattern ID~7 ($< > = > <$) with the conventional right-to-left temporal orientation. The POC values are set arbitrarily to reflect the signed moves: starting at $y=3$, then $+1\,(4)$, $-1\,(3)$, $0\,(3)$, $-1\,(2)$, $+1\,(3)$. The annotations between points display the relation symbols. The migration count $M=4$ and net balance $S=0$.
209
+
210
+ \begin{figure}[h]
211
+ \centering
212
+ \begin{tikzpicture}[scale=0.6]
213
+ \draw[->] (0,0) -- (6,0) node[right] {$t$ (candle index)};
214
+ \draw[->] (0,0) -- (0,5.5) node[above] {POC};
215
+ \foreach \x in {0,1,2,3,4,5} {
216
+ \pgfmathtruncatemacro{\idx}{-\x}
217
+ \draw (5-\x,0.1) -- (5-\x,-0.1) node[below] {\small $C_{\idx}$};
218
+ }
219
+ % Pattern ID 7: < > = > < (m = +1, -1, 0, -1, +1)
220
+ % Points: (5,3), (4,4), (3,3), (2,3), (1,2), (0,3)
221
+ \draw[thick, blue] (5,3) -- (4,4) -- (3,3) -- (2,3) -- (1,2) -- (0,3);
222
+ \filldraw (5,3) circle (2pt) (4,4) circle (2pt) (3,3) circle (2pt) (2,3) circle (2pt) (1,2) circle (2pt) (0,3) circle (2pt);
223
+ \node[anchor=south] at (4.5,3.5) {$<$};
224
+ \node[anchor=south] at (3.5,3.5) {$>$};
225
+ \node[anchor=west] at (2.5,3) {$=$};
226
+ \node[anchor=south] at (1.5,2.5) {$>$};
227
+ \node[anchor=south] at (0.5,2.5) {$<$};
228
+ \end{tikzpicture}
229
+ \caption{Visualization of multi-directional pattern ID~7: $< > = > <$ ($M=4$, $S=0$). Right-to-left orientation places current candle $C_0$ on the right.}
230
+ \label{fig:multipattern}
231
+ \end{figure}
232
+
233
+ \section{Conclusion}
234
+
235
+ We have fully enumerated the set of all multi-directional developing POC line patterns on a pre-market session of $n$ candles. The total number is $3^{\,n-1}$, arising from the independence of the three possible relations ($<$, $>$, $=$) at each of the $n-1$ transitions. A ternary encoding with $\{+1,0,-1\}$ provides a compact signed representation. The migration count $M$ and end-to-end net balance $S$ offer interpretable summaries of pattern activity and directional bias. Exact combinatorial formulas give the number of patterns possessing any prescribed $M$, and jointly with $S$. The state-transition matrix formulation independently verifies the count. These results form a theoretical foundation for pattern classification, statistical testing, and machine-readable feature construction in pre-market analysis.
236
+
237
+ \begin{thebibliography}{1}
238
+ \bibitem{marketprofile}
239
+ J.~F.~Dalton, \emph{Mind Over Markets: Power Trading with Market Generated Information}. Marketplace Books, 2013.
240
+ \bibitem{combinatorics}
241
+ R.~P.~Stanley, \emph{Enumerative Combinatorics}, vol.~1, 2nd~ed. Cambridge University Press, 2011.
242
+ \end{thebibliography}
243
+
244
+ \end{document}
developing_poc/od.topodevpoc.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9186b08dfad199cd5e04ee04b65facfd40db982eb43a6b12186e4e53edc71fb
3
+ size 244382
developing_poc/od.topodevpoc.tex ADDED
@@ -0,0 +1,275 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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{OD.TopoDevPOC: Topologically Unique One-Directional Developing Point-of-Control Patterns in Pre-Market K-Lines}
20
+
21
+ \author{\IEEEauthorblockN{ConQ Research Team}\\
22
+ \IEEEauthorblockA{\textit{Continual Quasars}\\
23
+ April 20, 2026}
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$. An equation for computing the number of migrated POC locations (strict moves) from the ternary matrix encoding is introduced, quantified as the $L_1$ norm of the pattern vector. 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 An equation for computing the number of migrated POC locations (strict moves) from the ternary matrix encoding, quantified as the $L_1$ norm of the pattern vector.
47
+ \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.
48
+ \end{enumerate}
49
+
50
+ The analysis is purely theoretical; no simulations, empirical data, or numerical approximations are employed.
51
+
52
+ \section{Problem Definition and Notation}
53
+
54
+ 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
55
+ \begin{equation}
56
+ C_0, C_{-1}, C_{-2}, \dots, C_{-(n-1)}.
57
+ \end{equation}
58
+ The corresponding developing POC values form a sequence
59
+ \begin{equation}
60
+ \mathbf{p} = (p_0, p_1, \dots, p_{n-1}) \in \mathbb{R}^n,
61
+ \end{equation}
62
+ where $p_k$ denotes the POC value of candle $C_{-k}$.
63
+
64
+ \begin{definition}[Continuous Bullish Pattern]
65
+ 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.,
66
+ \begin{equation}
67
+ p_k \geq p_{k+1}, \quad \text{with } p_k > p_{k+1} \text{ or } p_k = p_{k+1}.
68
+ \end{equation}
69
+ \end{definition}
70
+
71
+ \begin{definition}[Continuous Bearish Pattern]
72
+ 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.,
73
+ \begin{equation}
74
+ p_k \leq p_{k+1}, \quad \text{with } p_k < p_{k+1} \text{ or } p_k = p_{k+1}.
75
+ \end{equation}
76
+ \end{definition}
77
+
78
+ 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.
79
+
80
+ \section{Combinatorial Enumeration}
81
+
82
+ \begin{theorem}
83
+ 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$.
84
+ \end{theorem}
85
+
86
+ \begin{proof}
87
+ 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$.
88
+ \end{proof}
89
+
90
+ For $n = 39$, the exact total number of unique patterns is
91
+ \begin{equation}
92
+ T_{39} = 2^{39}.
93
+ \end{equation}
94
+
95
+ \section{Matrix Formulation and State Transition}
96
+
97
+ Define a ternary state variable $m_k$ for each transition $k$ ($0 \le k \le n-2$) as follows:
98
+ \begin{itemize}
99
+ \item For a bullish pattern:
100
+ \begin{equation}
101
+ m_k = \begin{cases}
102
+ +1, & \text{if } R_k = \; >, \\
103
+ 0, & \text{if } R_k = \; =.
104
+ \end{cases}
105
+ \end{equation}
106
+ \item For a bearish pattern:
107
+ \begin{equation}
108
+ m_k = \begin{cases}
109
+ -1, & \text{if } R_k = \; <, \\
110
+ 0, & \text{if } R_k = \; =.
111
+ \end{cases}
112
+ \end{equation}
113
+ \end{itemize}
114
+ 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$:
115
+ \begin{equation}
116
+ \mathbf{m} = (m_0, m_1, \dots, m_{n-2}) \in \{-1,0,+1\}^{n-1},
117
+ \end{equation}
118
+ subject to the constraint that all nonzero entries share the same sign.
119
+
120
+ \subsection{Transition Matrix Representation}
121
+
122
+ 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
123
+ \begin{equation}
124
+ \mathbf{A} = \begin{pmatrix}
125
+ 1 & 1 \\
126
+ 1 & 1
127
+ \end{pmatrix}.
128
+ \end{equation}
129
+ 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
130
+ \begin{equation}
131
+ B_n = \mathbf{1}^\top \mathbf{A}^{n-2} \mathbf{v}_0,
132
+ \end{equation}
133
+ 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,
134
+ \begin{align}
135
+ B_n &= \mathbf{1}^\top \left( 2^{n-3} \mathbf{A} \right) \mathbf{v}_0 \nonumber \\
136
+ &= 2^{n-3} \mathbf{1}^\top \mathbf{A} \mathbf{1} \nonumber \\
137
+ &= 2^{n-3} \cdot 4 = 2^{n-1}.
138
+ \end{align}
139
+ This matrix derivation confirms the combinatorial count independently.
140
+
141
+ \section{Conversion Between Symbolic Sequence and Ternary Matrix}
142
+
143
+ We establish bidirectional conversion formulas between the symbolic sequence representation (a string of symbols $>$ and $=$, or $<$ and $=$) and the ternary matrix (row vector) encoding.
144
+
145
+ \subsection{Symbolic Sequence to Ternary Matrix}
146
+
147
+ Let $\Sigma$ be a string of length $n-1$ over alphabet $\{>, =\}$ for bullish, or $\{<, =\}$ for bearish. Define the mapping $f$:
148
+ \begin{align}
149
+ f_{\text{bullish}}(>) &= +1, & f_{\text{bullish}}(=) &= 0, \\
150
+ f_{\text{bearish}}(<) &= -1, & f_{\text{bearish}}(=) &= 0.
151
+ \end{align}
152
+ The ternary matrix $\mathbf{M}$ of size $1 \times (n-1)$ is given by
153
+ \begin{equation}
154
+ \mathbf{M}_{1,j+1} = f(\Sigma_j), \quad j = 0,1,\dots,n-2.
155
+ \end{equation}
156
+ That is, $\mathbf{M} = \begin{pmatrix} f(\Sigma_0) & f(\Sigma_1) & \cdots & f(\Sigma_{n-2}) \end{pmatrix}$.
157
+
158
+ \subsection{Ternary Matrix to Symbolic Sequence}
159
+
160
+ 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$:
161
+ \begin{align}
162
+ g_{\text{bullish}}(+1) &= >, & g_{\text{bullish}}(0) &= =, \\
163
+ g_{\text{bearish}}(-1) &= <, & g_{\text{bearish}}(0) &= =.
164
+ \end{align}
165
+ Formally,
166
+ \begin{equation}
167
+ \Sigma_j = g(m_j),
168
+ \end{equation}
169
+ and the sequence is $\Sigma = \Sigma_0 \Sigma_1 \cdots \Sigma_{n-2}$.
170
+
171
+ These conversions are one-to-one and preserve pattern identity.
172
+
173
+ \section{Migration Count: Number of Strict Moves}
174
+
175
+ A natural quantitative property of a developing POC pattern is the number of times the POC level actually changes location (i.e., the number of strict moves). This count, denoted by $M$, is simply the number of nonzero entries in the ternary vector $\mathbf{m}$.
176
+
177
+ \begin{definition}[Migration Count]
178
+ For a continuous developing POC pattern encoded by the ternary vector $\mathbf{m} = (m_0, \dots, m_{n-2})$, the \emph{migration count} $M$ is defined as
179
+ \begin{equation}
180
+ M(\mathbf{m}) = \sum_{k=0}^{n-2} |m_k| = \|\mathbf{m}\|_1,
181
+ \end{equation}
182
+ where $\|\cdot\|_1$ denotes the $L_1$ norm (sum of absolute values). For bullish patterns, $m_k \in \{+1,0\}$; hence $|m_k| = m_k$ (since $+1 \ge 0$). For bearish patterns, $m_k \in \{-1,0\}$; hence $|m_k| = -m_k$. In either case, $M$ counts the number of strict directional steps.
183
+ \end{definition}
184
+
185
+ The migration count satisfies $0 \le M \le n-1$. The extreme case $M = 0$ corresponds to the all‑equality pattern (flat POC line). The opposite extreme $M = n-1$ corresponds to a pattern with no equalities (continuously strict move). Because the entries of $\mathbf{m}$ are independent within the sign constraint, the distribution of $M$ for a given direction follows a binomial distribution with $n-1$ trials and success probability $1/2$ (assuming each transition independently chooses strict or flat). Specifically,
186
+ \begin{equation}
187
+ \Pr(M = k \mid \text{direction fixed}) = \binom{n-1}{k} \left(\frac{1}{2}\right)^{n-1}, \quad k = 0,1,\dots,n-1.
188
+ \end{equation}
189
+ This probabilistic interpretation aligns with the total count $2^{n-1}$ per direction.
190
+
191
+ The migration count is directly computable from the symbolic sequence by counting the occurrences of $>$ (bullish) or $<$ (bearish), ignoring $=$. It is also immediately obtained from the ternary matrix via the $L_1$ norm.
192
+
193
+ \section{Illustrative Examples}
194
+
195
+ 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, corresponding $1 \times 5$ ternary matrix, and migration count $M$.
196
+
197
+ \begin{table}[h]
198
+ \centering
199
+ \caption{Ten Random Continuous Developing POC Patterns ($n=6$)}
200
+ \label{tab:examples}
201
+ \begin{tabular}{c c c c c}
202
+ \toprule
203
+ \textbf{ID} & \textbf{Direction} & \textbf{Symbolic Sequence} & \textbf{Ternary Matrix ($1 \times 5$)} & \textbf{$M$} \\
204
+ \midrule
205
+ 1 & Bullish & $> \; > \; = \; > \; =$ & $\begin{pmatrix}+1 & +1 & 0 & +1 & 0\end{pmatrix}$ & 3 \\
206
+ 2 & Bullish & $= \; > \; = \; = \; >$ & $\begin{pmatrix}0 & +1 & 0 & 0 & +1\end{pmatrix}$ & 2 \\
207
+ 3 & Bearish & $< \; = \; < \; < \; =$ & $\begin{pmatrix}-1 & 0 & -1 & -1 & 0\end{pmatrix}$ & 3 \\
208
+ 4 & Bearish & $= \; = \; < \; = \; <$ & $\begin{pmatrix}0 & 0 & -1 & 0 & -1\end{pmatrix}$ & 2 \\
209
+ 5 & Bullish & $> \; = \; = \; > \; >$ & $\begin{pmatrix}+1 & 0 & 0 & +1 & +1\end{pmatrix}$ & 3 \\
210
+ 6 & Bullish & $= \; > \; > \; = \; >$ & $\begin{pmatrix}0 & +1 & +1 & 0 & +1\end{pmatrix}$ & 3 \\
211
+ 7 & Bearish & $< \; < \; = \; = \; <$ & $\begin{pmatrix}-1 & -1 & 0 & 0 & -1\end{pmatrix}$ & 3 \\
212
+ 8 & Bearish & $= \; < \; = \; < \; =$ & $\begin{pmatrix}0 & -1 & 0 & -1 & 0\end{pmatrix}$ & 2 \\
213
+ 9 & Bullish & $> \; > \; > \; = \; =$ & $\begin{pmatrix}+1 & +1 & +1 & 0 & 0\end{pmatrix}$ & 3 \\
214
+ 10 & Bearish & $< \; = \; = \; = \; <$ & $\begin{pmatrix}-1 & 0 & 0 & 0 & -1\end{pmatrix}$ & 2 \\
215
+ \bottomrule
216
+ \end{tabular}
217
+ \end{table}
218
+
219
+ \subsection{Visual Chart with Correct Temporal Ordering}
220
+
221
+ 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.
222
+
223
+ 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). The migration count $M=3$ corresponds to the three downward-sloping segments.
224
+
225
+ \begin{figure}[h]
226
+ \centering
227
+ \begin{tikzpicture}[scale=0.6]
228
+ % x-axis reversed: 0 on the right, negative indices to the left
229
+ \draw[->] (0,0) -- (6,0) node[right] {$t$ (candle index)};
230
+ \draw[->] (0,0) -- (0,5) node[above] {POC};
231
+ % Labels: C_0 at x=5, C_{-1} at x=4, ..., C_{-5} at x=0
232
+ \foreach \x in {0,1,2,3,4,5} {
233
+ \pgfmathtruncatemacro{\idx}{-\x}
234
+ \draw (5-\x,0.1) -- (5-\x,-0.1) node[below] {\small $C_{\idx}$};
235
+ }
236
+ % Pattern: > > = > =
237
+ % Starting value 5, then steps: -1, -1, 0, -1, 0
238
+ % Plot from right to left: C_0 (x=5, y=5), C_{-1} (x=4, y=4), ...
239
+ \draw[thick, blue] (5,5) -- (4,4) -- (3,3) -- (2,3) -- (1,2) -- (0,2);
240
+ \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);
241
+ % Annotate relations between points (placed near the line segment)
242
+ \node[anchor=south] at (4.5,4.5) {$>$};
243
+ \node[anchor=south] at (3.5,3.5) {$>$};
244
+ \node[anchor=south] at (2.5,3) {$=$};
245
+ \node[anchor=south] at (1.5,2.5) {$>$};
246
+ \node[anchor=south] at (0.5,2) {$=$};
247
+ \end{tikzpicture}
248
+ \caption{Visualization of Bullish Pattern 1: $> > = > =$ ($M=3$). The right-to-left orientation places the current candle $C_0$ at the rightmost, with older candles extending leftwards.}
249
+ \label{fig:pattern1}
250
+ \end{figure}
251
+
252
+ \section{Discussion and Consistency Verification}
253
+
254
+ 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.
255
+
256
+ 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. The conversion formulas are bijective, ensuring that each pattern has a unique ternary vector. The migration count $M = \|\mathbf{m}\|_1$ offers a simple, interpretable metric for pattern activity, directly computable from either the symbolic sequence or the ternary matrix.
257
+
258
+ 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, $M=0$), which corresponds to a completely flat developing POC line.
259
+
260
+ 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.
261
+
262
+ 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.
263
+
264
+ \section{Conclusion}
265
+
266
+ 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. An equation for the migration count (number of strict moves) as the $L_1$ norm of the pattern vector is introduced, offering a compact summary statistic. Ten illustrative random patterns with their migration counts are presented, along with a correctly oriented visual chart. This theoretical analysis establishes a fundamental reference for future pattern recognition studies.
267
+
268
+ \begin{thebibliography}{1}
269
+ \bibitem{marketprofile}
270
+ J. F. Dalton, \emph{Mind Over Markets: Power Trading with Market Generated Information}. Marketplace Books, 2013.
271
+ \bibitem{combinatorics}
272
+ R. P. Stanley, \emph{Enumerative Combinatorics}, vol. 1, 2nd ed. Cambridge University Press, 2011.
273
+ \end{thebibliography}
274
+
275
+ \end{document}