I'm currently studying the tick rule and wanted to denote it formally. However, I'm unsure about my notation when accessing sequence elements in a piece-wise function.
Background:
found in (https://doi.org/10.1111/j.1540-6261.1991.tb02683.x):
“A trade is an uptick (downtick) if the price is higher (lower) than the price of the previous trade. When the price is the same as the previous trade (a zero tick), if the last price change was an uptick, then the trade is a zero-uptick. Similarly, if the last price change was a downtick, then the trade is a zero-downtick. A trade is classified as a buy if it occurs on an uptick or a zero-uptick; otherwise it is classified as a sell”
My description:
Let $(p_t)_{t\in\mathbb{N}}$ be the sequence of trade prices ordered by time. I've now defined the tick rule as: $$ \operatorname{tick}\colon \mathbb{R}^2 \to \left\{0,1\right\}\quad \operatorname{tick}(p_{t-1}, p_{t})= \begin{cases} 1, & \text{if}\ p_{t} > p_{t-1} \\ 0, & \text{if}\ p_{t} < p_{t-1} \\ \operatorname{tick}(p_{t-2}, p_{t-1}), & \text{else}. \end{cases} $$
What makes me wonder if my notation is correct regarding the else case, as I don't pass $p_{t-2}$ (or any other previous element) to the function, and what is a better way to denote it? Basically, I want to find the last element before $p_t$ that is different from $p_t$ and classify it.
Please feel free to point me to a broader concept if there is some.
EDIT: fixed typo in else branch ($p_t$ to $p_{t-1}$)
I recommend the following
$$\operatorname{tick}\colon\mathbb{N}\to\left\{0,1\right\}\quad\operatorname{tick}(t)=\begin{cases} 1, & t=1\lor p_{t}>p_{t-1} \\ 0, & p_{t}<p_{t-1} \\ \operatorname{tick}(t-1), & p_{t}=p_{t-1}\end{cases}$$
where the assumption is there's an array $p$ of trade prices where $p_t$ references an element of the array for $t\in\mathbb{N}$ and the $t=1$ condition corresponding to the first entry in the array assures the recursion doesn't go beyond the beginning of the array $p$.