Skip to content

Commit

Permalink
Add chapter on tick rule 🔢 (#152)
Browse files Browse the repository at this point in the history
Addresses #10
  • Loading branch information
KarelZe authored Feb 9, 2023
1 parent 93121da commit 1d774e7
Show file tree
Hide file tree
Showing 19 changed files with 230 additions and 252 deletions.
2 changes: 1 addition & 1 deletion references/obsidian/.obsidian/graph.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"repelStrength": 10,
"linkStrength": 1,
"linkDistance": 250,
"scale": 0.3823010968769974,
"scale": 1.476986098068651,
"close": true
}
110 changes: 14 additions & 96 deletions references/obsidian/.obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,111 +3,29 @@
"id": "550952c7dea0cc23",
"type": "split",
"children": [
{
"id": "9d9a45cd3aa297af",
"type": "tabs",
"dimension": 35.10593220338983,
"children": [
{
"id": "6a18cf819fe4635b",
"type": "leaf",
"pinned": true,
"state": {
"type": "markdown",
"state": {
"file": "📑notes/🍪Selection of supervised approaches notes.md",
"mode": "source",
"source": false
},
"pinned": true
}
},
{
"id": "106d26afbe6ac5ca",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "📖chapters/🔢EMO rule.md",
"mode": "source",
"source": false
}
}
},
{
"id": "cfcc451141d62be0",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "📖chapters/🔢CLNV method.md",
"mode": "source",
"source": false
}
}
}
],
"currentTab": 2
},
{
"id": "2785db0e51818bf2",
"type": "tabs",
"dimension": 35.10593220338983,
"dimension": 49.568965517241374,
"children": [
{
"id": "0b5c7cf912d57d27",
"type": "leaf",
"pinned": true,
"state": {
"type": "markdown",
"state": {
"file": "📑notes/🔢CLNV method notes.md",
"mode": "source",
"source": false
},
"pinned": true
}
},
{
"id": "45c897f094afeb47",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "📑notes/🔢Tick test notes.md",
"mode": "source",
"source": false
}
}
},
{
"id": "1934968841d72664",
"id": "94415710fad4ab13",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "📑notes/🔢Hybrid rules notes.md",
"file": "📖chapters/🔢Tick Test.md",
"mode": "source",
"source": false
}
}
},
{
"id": "94415710fad4ab13",
"type": "leaf",
"state": {
"type": "image",
"state": {
"file": "🖼️Media/pseudocode-of-algorithms.png"
}
}
}
]
},
{
"id": "98f847228f79bc8c",
"type": "tabs",
"dimension": 29.78813559322034,
"dimension": 50.431034482758626,
"children": [
{
"id": "f35a250acbe1a2dc",
Expand Down Expand Up @@ -178,7 +96,7 @@
"state": {
"type": "backlink",
"state": {
"file": "📖chapters/🔢CLNV method.md",
"file": "📖chapters/🔢Tick Test.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
Expand Down Expand Up @@ -206,7 +124,7 @@
"state": {
"type": "outline",
"state": {
"file": "📖chapters/🔢CLNV method.md"
"file": "📖chapters/🔢Tick Test.md"
}
}
},
Expand Down Expand Up @@ -237,17 +155,17 @@
"markdown-importer:Open format converter": false
}
},
"active": "cfcc451141d62be0",
"active": "94415710fad4ab13",
"lastOpenFiles": [
"📑notes/🔢CLNV method notes.md",
"📑notes/🍪Selection of supervised approaches notes.md",
"📖chapters/🔢Tick Test.md",
"📑notes/🔢Tick test notes.md",
"📑notes/🔢Hybrid rules notes.md",
"📑notes/🔢Basic rules notes.md",
"📖chapters/🔢Basic rules.md",
"📖chapters/🔢Quote Rule.md",
"📑notes/🔢LR algorithm notes.md",
"🖼️Media/pseudocode-of-algorithms.png",
"📖chapters/🔢CLNV method.md",
"📖chapters/🔢EMO rule.md",
"📑notes/🍪Selection of supervised approaches notes.md",
"📖chapters/🔢Tick test.md",
"📖chapters/🔢Trade Size Rule.md",
"📑notes/🔢Trade Size Rule Notes.md"
"📖chapters/🔢Hybrid rules.md"
]
}
10 changes: 5 additions & 5 deletions references/obsidian/IW-Queues/IW-Queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ interval: 1
| [[🤖Transformer]] | 12.5 | | 2 | 2022-12-15 |
| [[👨‍🍳Tain-Test-split]] | 15 | | 2 | 2022-12-15 |
| [[🔢Trade Size Rule]] | 17.5 | | 1 | 1970-01-01 |
| [[🔢Tick test]] | 20 | | 1 | 1970-01-01 |
| [[🔢Tick Test]] | 20 | | 1 | 1970-01-01 |
| [[🍪Selection Of Semisupervised Approaches]] | 22.5 | | 1 | 1970-01-01 |
| [[🍪Selection Of Supervised Approaches]] | 25 | | 1 | 1970-01-01 |
| [[🏅Robustness]] | 27.5 | | 1 | 1970-01-01 |
| [[semi-supervised]] | 28 | | 1 | 1970-01-01 |
| [[🏅Results of semi-supervised]] | 30 | | 1 | 1970-01-01 |
| [[🏅Results]] | 32.5 | | 1 | 1970-01-01 |
| [[👪Related Work]] | 35 | | 1 | 1970-01-01 |
| [[🔢Quote rule]] | 37.5 | | 1 | 1970-01-01 |
| [[🔢Quote Rule]] | 37.5 | | 1 | 1970-01-01 |
| [[💡Training and tuning]] | 40 | | 1 | 1970-01-01 |
| [[👨‍🍳Pre-Processing]] | 40 | | 1 | 1970-01-01 |
| [[💡Tuning of models (semi-supervised)]] | 41 | | 1 | 1970-01-01 |
Expand All @@ -36,11 +36,11 @@ interval: 1
| [[🚏Exploratory Data Analysis]] | 72.5 | | 1 | 1970-01-01 |
| [[🧭Evaluation metric]] | 75 | | 1 | 1970-01-01 |
| [[🌏Environment]] | 77.5 | | 1 | 1970-01-01 |
| [[🔢EMO rule]] | 80 | | 1 | 1970-01-01 |
| [[🔢EMO Rule]] | 80 | | 1 | 1970-01-01 |
| [[🛌Token Embedding]] | 82.5 | | 1 | 1970-01-01 |
| [[🤖Pre-training of Transformers]] | 85 | | 1 | 1970-01-01 |
| [[🧓Discussion]] | 87.5 | | 1 | 1970-01-01 |
| [[🔢Depth rule]] | 90 | | 1 | 1970-01-01 |
| [[🔢CLNV method]] | 95 | | 1 | 1970-01-01 |
| [[🔢Depth Rule]] | 90 | | 1 | 1970-01-01 |
| [[🔢CLNV Method]] | 95 | | 1 | 1970-01-01 |
| [[🔢Basic rules]] | 97.5 | | 1 | 1970-01-01 |
| [[🐈Gradient Boosting]] | 5 | | 8 | 2023-02-07 |
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#gbm #transformer #supervised-learning #deep-learning





**Why probabilistic classification:**
- Due to a unsatisfactory research situation, for trade classification (see chapter [[👪Related Work]]) we base
- Use classification methods (*probabilistic classifier*) that can return probabilities instead of class-only for better analysis. Using probabilistic trade classification rules might have been studied in [[@easleyDiscerningInformationTrade2016]]
Expand Down
4 changes: 4 additions & 0 deletions references/obsidian/📑notes/🔢Basic rules notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Denote sells with $0$ and buys with $1$.
“The trade indicator is a binary variable stating whether the buyer or seller of an asset has initiated the trade by submitting a market order or an immediately executed limit order.” (Frömmel et al., 2021, p. 4)


<mark style="background: #FFB86CA6;">“Methods of inferring trade direction can be classified as: tick tests, which use changes in trade prices; the quote method, which compares trade prices to quotes;” (Finucane, 2000, p. 557)
</mark>


**Synonyms**
1. Broader term is **trade site classification** = assign the side to a to a transaction and differentiate between buyer- and seller-initiated transactions
2. It's also sometimes called trade sign classification
Expand Down
16 changes: 16 additions & 0 deletions references/obsidian/📑notes/🔢CLNV method notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
Tags: #trade-classification #CLVN

Long form:
$$
  \begin{equation}
    \text{Trade}_{i,t}=
    \begin{cases}
      \operatorname{tick}(), & \text{if}\ P_{i, t} \in \left(A_{i, t}, \infty\right) \\
      1, & \text{if}\ P_{i, t} \in \left[\frac{3}{10} B_{i,t} + \frac{7}{10} A_{i,t}, A_{i, t}\right] \\
      \operatorname{tick}(), & \text{if}\ P_{i, t} \in \left(\frac{7}{10} B_{i,t} + \frac{3}{10} A_{i,t}, \frac{3}{10} B_{i,t} + \frac{7}{10} A_{i,t}\right) \\
      0, & \text{if} P_{i, t} \in \left[ B_{i,t}, \frac{7}{10} B_{i,t} + \frac{3}{10} A_{i,t}\right] \\
\operatorname{tick}(), & \text{if} \ P_{i, t} \in \left(-\infty, B_{i, t}\right) \\
    \end{cases}
  \end{equation}
$$


- “We compare the accuracy rates of various algorithms in classifying ECN trades. We divide trades according to their price distribution relative to quotes. We expect the classification rules to perform better when trades occur at the ask or bid. When trades receive price improvement, buys and sells will execute at prices inside the quotes. In these instances, not only does the quote rule meet with some challenge, the tick rule will also be more difficult as buys (sells) will more likely occur on downticks (upticks).” (Chakrabarty et al., 2007, p. 3811)

- “We find that ECN trades are difficult to classify as the overall success rates of the LR, EMO, and tick rules are 74.42%, 75.80%, and 75.40%, respectively. Our algorithm modestly outperforms these three, with an overall success rate of 76.52%, but we show that our algorithm substantially outperforms the others for trades inside the quotes. For trades inside 1 Our primary sample is from the INET ECN. We use ArcaEx data to confirm the robustness of our results across another ECN. Table 3 reports results using the ArcaEx data. All other tables use the INET sample. B. Chakrabarty et al. / Journal of Banking & Finance 31 (2007) 3806–3821 380” (Chakrabarty et al., 2007, p. 3807) “the quotes our success rate is 76.32% compared to 71.85% for the LR rule and 71.35% for both the tick and EMO rules. We also find that a significant proportion of trades execute outside the quotes. This phenomenon, called a ‘‘trade-through’’, is prevalent for NASDAQ markets due to the absence of the trade-through rule in our study period.2” (Chakrabarty et al., 2007, p. 3808)
Expand Down
15 changes: 0 additions & 15 deletions references/obsidian/📑notes/🔢Hybrid rules notes.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
Tags: #trade-classification

Long form:
$$
  \begin{equation}
    \text{Trade}_{i,t}=
    \begin{cases}
      \operatorname{tick}(), & \text{if}\ P_{i, t} \in \left(A_{i, t}, \infty\right) \\
      1, & \text{if}\ P_{i, t} \in \left[\frac{3}{10} B_{i,t} + \frac{7}{10} A_{i,t}, A_{i, t}\right] \\
      \operatorname{tick}(), & \text{if}\ P_{i, t} \in \left(\frac{7}{10} B_{i,t} + \frac{3}{10} A_{i,t}, \frac{3}{10} B_{i,t} + \frac{7}{10} A_{i,t}\right) \\
      0, & \text{if} P_{i, t} \in \left[ B_{i,t}, \frac{7}{10} B_{i,t} + \frac{3}{10} A_{i,t}\right] \\
\operatorname{tick}(), & \text{if} \ P_{i, t} \in \left(-\infty, B_{i, t}\right) \\
    \end{cases}
  \end{equation}
$$


- Why is there a need for hybrid classification rules? What are the problems of the tick and quote rule?
- The previous trade classification rules are applicable to certain trades or come with their own drawbacks e. g., they perform poorly for a greater distance to quotes. To mitigate the disadvantages, rules are combined to hybrids through ensembeling. In certain cases through stacking.
Expand Down
Loading

0 comments on commit 1d774e7

Please sign in to comment.