algorembrant commited on
Commit
6510661
·
verified ·
1 Parent(s): 105f226

Upload 2 files

Browse files
.gitattributes CHANGED
@@ -43,3 +43,4 @@ volatility[[:space:]]drag/volatility[[:space:]]drag[[:space:]]more.png filter=lf
43
  volatility[[:space:]]drag/volatility[[:space:]]drag.pdf filter=lfs diff=lfs merge=lfs -text
44
  draft[[:space:]]of[[:space:]]simulated[[:space:]]trades/main.pdf filter=lfs diff=lfs merge=lfs -text
45
  unique[[:space:]]candle[[:space:]]patterns[[:space:]]but[[:space:]]practical/main.pdf filter=lfs diff=lfs merge=lfs -text
 
 
43
  volatility[[:space:]]drag/volatility[[:space:]]drag.pdf filter=lfs diff=lfs merge=lfs -text
44
  draft[[:space:]]of[[:space:]]simulated[[:space:]]trades/main.pdf filter=lfs diff=lfs merge=lfs -text
45
  unique[[:space:]]candle[[:space:]]patterns[[:space:]]but[[:space:]]practical/main.pdf filter=lfs diff=lfs merge=lfs -text
46
+ simulated[[:space:]]trades/main.pdf filter=lfs diff=lfs merge=lfs -text
simulated trades/main.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:92a452bcb0b2dca52db896d32653d79e7a49cb0ed5536622582dfaf1410063e4
3
+ size 188416
simulated trades/main.tex ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ \documentclass[11pt]{article}
3
+ \usepackage[margin=0.5in]{geometry}
4
+
5
+ % Core packages
6
+ \usepackage{amsmath,amssymb,mathrsfs,bm,dsfont,bbold,euscript}
7
+ \usepackage{tikz-cd}
8
+ \usepackage{multicol}
9
+
10
+ % Paragraphs
11
+ \setlength{\parindent}{0pt}
12
+ \setlength{\parskip}{1\baselineskip}
13
+
14
+ \title{Simulated Trades}
15
+ \author{algorembrant}
16
+ \date{\today}
17
+
18
+ \begin{document}
19
+ \maketitle
20
+
21
+ \begin{abstract}
22
+ I formalized how to get the best simulated trades at historical data with the use of mix lookback and lookahead. Although it sound dumb for the first time, the purpose of having a $time$ with rich information such as
23
+ $\mathcal{V}_{\mathfrak{t}} =
24
+ (
25
+ \mathfrak{E}_{\mathfrak{t}}, \Omega_{\mathfrak{t}}, \mathcal{T}_{\mathfrak{t}}, \mathcal{R}_{\mathfrak{t}}, \mathcal{L}_{\mathfrak{t}}, \mathcal{Q}_\mathfrak{t}, \mathcal{Y}_{\mathfrak{t}}
26
+ )$ as another form of dataset, is benificial for field such as shaping the Reward function in Reinforcement Learning. The following contents will not discuss anything about RL, but a pure mathematital formalization of the said best trade at times $\mathfrak{t}$.
27
+ \end{abstract}
28
+
29
+
30
+ \newpage
31
+
32
+ \section{Information-rich Time}
33
+ \begin{align}
34
+ \mathfrak{E}_{\mathfrak{t}} &= \text{simulated entry at historical time } \mathfrak{t} \\
35
+ O &= open \\
36
+ C &= close \\
37
+ H &= high \\
38
+ L &= low \\
39
+ P &\in \{O,C,H,L\}, \quad \text{raw prices} \\
40
+ \mathfrak{O}_{\mathfrak{t}} &= (O_{\mathfrak{t}} - \mathfrak{E}_{\mathfrak{t}}), \quad \text{deviated open price at historical time } \mathfrak{t} \\
41
+ \mathfrak{C}_{\mathfrak{t}} &= (C_{\mathfrak{t}} - \mathfrak{E}_{\mathfrak{t}}), \quad \text{deviated close price at historical time } \mathfrak{t} \\
42
+ \mathfrak{H}_{\mathfrak{t}} &= (H_{\mathfrak{t}} - \mathfrak{E}_{\mathfrak{t}}), \quad \text{deviated high price at historical time } \mathfrak{t} \\
43
+ \mathfrak{L}_{\mathfrak{t}} &= (L_{\mathfrak{t}} - \mathfrak{E}_{\mathfrak{t}}), \quad \text{deviated low price at historical time } \mathfrak{t} \\
44
+ \mathfrak{P} &\in \{\mathfrak{O},\mathfrak{C},\mathfrak{H},\mathfrak{L}\}, \quad \text{deviated prices} \\
45
+ mfe &= \text{max favorable excursion} \\
46
+ mae &= \text{max adverse excursion} \\
47
+ s_{\mathfrak{t}} &= \text{spread of that historical time, say we have 0.260}
48
+ \end{align}
49
+
50
+ \begin{align}
51
+ t &= \text{current time}\\
52
+ t-n &= \text{where } n \text{ refers to number of lookback} \\
53
+ \dot{t} &= \text{is } t \ge \dot{t} \ge (t-n) \\
54
+ \mathfrak{t} &= \text{time where \textit{simulated entry} occured, where } \mathfrak{t} \in \{t-n\} \\
55
+ \mathfrak{t} + \mathfrak{n} &= \text{where } \mathfrak{n} \text{ refers to the lookahead or holding period}\\
56
+ \dot{\mathfrak{t}} &= \text{is } \mathfrak{t} \le \dot{\mathfrak{t}} \le (\mathfrak{t} + \mathfrak{n})\\
57
+ \mathbb{t} &= \text{time before } \mathfrak{M} \ge -50\% \text{, where } \mathbb{t} \in \{\max((\mathfrak{t} + \mathfrak{n}) - 1)\} \\
58
+ \mathbb{t} - \mathbb{n} &= \text{where } \mathbb{n} \text{ also refers to number of lookback}\\
59
+ \dot{\mathbb{t}} &= \text{is } \mathbb{t} \ge \dot{\mathbb{t}} \ge (\mathbb{t}-\mathbb{n})\\
60
+ \end{align}
61
+
62
+ \begin{align}
63
+ \mathfrak{X}_{\dot{\mathfrak{t}}} &=
64
+ \begin{cases}
65
+ \text{if buy}, \quad \underbrace{\max_{\mathfrak{t} \le \dot{\mathfrak{t}} \le (\mathfrak{t}+\mathfrak{n})} \mathfrak{H}_{\dot{\mathfrak{t}}}}_{mfe} \\
66
+ \text{if buy}, \quad \underbrace{\min_{\mathfrak{t} \le \dot{\mathfrak{t}} \le (\mathfrak{t}+\mathfrak{n})} \mathfrak{L}_{\dot{\mathfrak{t}}}}_{mae} \\
67
+ \text{if sell}, \quad \underbrace{\max_{\mathfrak{t} \le \dot{\mathfrak{t}} \le (\mathfrak{t}+\mathfrak{n})} \mathfrak{H}_{\dot{\mathfrak{t}}}}_{mae} \\
68
+ \text{if sell}, \quad \underbrace{\min_{\mathfrak{t} \le \dot{\mathfrak{t}} \le (\mathfrak{t}+\mathfrak{n})} \mathfrak{L}_{\dot{\mathfrak{t}}}}_{mfe}
69
+ \end{cases},
70
+ \quad \text{\textcolor{red}{running extreme}}
71
+ \end{align}
72
+
73
+
74
+ And we formalize our imaginary stoploss as:
75
+ \begin{align}
76
+ \omega &= \frac{1}{\mathfrak{T}}\sum_{\mathfrak{t}=0}^{\mathfrak{T}-1}
77
+ \begin{cases}
78
+ \text{if buy}, \quad \max\left({\mathfrak{O}}_{-\mathfrak{t}} - {\mathfrak{L}}_{-\mathfrak{t}},|{\mathfrak{O}}_{-\mathfrak{t}}-{\mathfrak{C}}_{{-\mathfrak{t}}-1}|,|{\mathfrak{L}}_{-\mathfrak{t}}-{\mathfrak{C}}_{{-\mathfrak{t}}-1}|\right)\\
79
+ \text{if sell}, \quad \max\left(|{\mathfrak{O}}_{-\mathfrak{t}} - {\mathfrak{H}}_{-\mathfrak{t}}|,|{\mathfrak{O}}_{-\mathfrak{t}}-{\mathfrak{C}}_{{-\mathfrak{t}}-1}|,|{\mathfrak{H}}_{-\mathfrak{t}}-{\mathfrak{C}}_{{-\mathfrak{t}}-1}|\right)
80
+ \end{cases}, \quad \text{\textcolor{red}{avg. imaginary $mae$}}
81
+ \\
82
+ \Omega_{\mathfrak{t}} &=
83
+ \begin{cases}
84
+ \text{if buy}, \quad \mathfrak{E}_{\mathfrak{t}} -(\omega_{{\mathfrak{t}}-1} \cdot s_{\mathfrak{t}} \cdot m) \\
85
+ \text{if sell}, \quad \mathfrak{E}_{\mathfrak{t}} +(\omega_{{\mathfrak{t}}-1} \cdot s_{\mathfrak{t}} \cdot m)
86
+ \end{cases},\quad \text{\textcolor{red}{projected deviated stoploss} and $m$ (10x) as multiplier (the entry is $\mathfrak{E}_{\mathfrak{t}}$)}
87
+ \end{align}
88
+ That ensures that the stoploss is always greater than the spread multiplier, $\Omega_{\mathfrak{t}} > (s_{\mathfrak{t}} \cdot m)$
89
+
90
+ Therefore, our run stop creterion is defined as
91
+ \begin{align}
92
+ \mathfrak{R}_{\dot{\mathfrak{t}}} &=
93
+ \begin{cases}
94
+ \text{if buy}, \quad \left(\left(\underbrace{\max_{\mathfrak{t} \le \dot{\mathfrak{t}} \le (\mathfrak{t}+\mathfrak{n})} \mathfrak{H}_{\dot{\mathfrak{t}}}}_{mfe} + \Omega_{\mathfrak{t}} \right) \cdot d \right)+ \Omega_{\mathfrak{t}} \\
95
+ \text{if sell}, \quad \left(\left(\underbrace{\min_{\mathfrak{t} \le \dot{\mathfrak{t}} \le (\mathfrak{t}+\mathfrak{n})} \mathfrak{L}_{\dot{\mathfrak{t}}}}_{mfe} - \Omega_{\mathfrak{t}} \right) \cdot d \right)+ \Omega_{\mathfrak{t}}
96
+ \end{cases}, \quad
97
+ \text{\textcolor{red}{run stop creterion}, where $d$ is divider (say 0.50)}
98
+ \end{align}
99
+
100
+ And the time where price crosses the opposite bound of run stop creterion is defined as:
101
+ \begin{align}
102
+ \mathfrak{C}_{\mathbb{t}} &=
103
+ \begin{cases}
104
+ \text{if buy}, \quad \mathfrak{L}_{\max(\dot{\mathfrak{t}})} \ge \mathfrak{R}_{\dot{\mathfrak{t}}} \\
105
+ \text{if sell}, \quad \mathfrak{H}_{\max(\dot{\mathfrak{t}})} \le \mathfrak{R}_{\dot{\mathfrak{t}}}
106
+ \end{cases}, \quad \text{\textcolor{red}{crossover price}, where $\mathfrak{C}$ is the deviated close price of time $\mathbb{t}$}
107
+ \end{align}
108
+ That will get the price at max timestamp indexing before the price touches the lowerbound (if buyside) or upperbound (if sellside) of $\mathfrak{R}_{\dot{\mathfrak{t}}}$
109
+
110
+ And to get the max imaginary takeprofit, we formalize it as:
111
+
112
+ \begin{align}
113
+ \mathcal{T}_{\dot{\mathbb{t}}} &=
114
+ \begin{cases}
115
+ \text{if buy}, \quad \displaystyle \max_{\mathbb{t} \ge \dot{\mathbb{t}} \ge \mathfrak{t}}(\mathfrak{H}_{\dot{\mathbb{t}}}) - (s_{\mathfrak{t}} \cdot \mathfrak{m})\\
116
+ \text{if sell}, \quad \displaystyle \min_{\mathbb{t} \ge \dot{\mathbb{t}} \ge \mathfrak{t}}(\mathfrak{L}_{\dot{\mathbb{t}}}) + (s_{\mathfrak{t}} \cdot \mathfrak{m})
117
+ \end{cases}, \quad \text{where $\mathfrak{m} (2x)$ as multiplier, and $\mathfrak{t} \in \{\mathbb{t}-\mathbb{n}\}$}, \quad \text{\textcolor{red}{max simulated takeprofit}} \\
118
+ \mathcal{R}_{\dot{\mathbb{t}}} &=
119
+ \begin{cases}
120
+ \text{if buy,} \quad \mathfrak{C}_{\mathbb{t}}^{buy} \\
121
+ \text{if sell,} \quad \mathfrak{C}_{\mathbb{t}}^{sell}
122
+ \end{cases}, \quad \text{\textcolor{red}{emergency return}} \\
123
+ \mathcal{L}_{\dot{\mathbb{t}}} &=
124
+ \begin{cases}
125
+ \text{if buy}, \quad \displaystyle \min_{\mathbb{t} \ge \dot{\mathbb{t}} \ge \mathfrak{t}}(\mathfrak{L}_{\dot{\mathbb{t}}}) \\
126
+ \text{if sell}, \quad \displaystyle \max_{\mathbb{t} \ge \dot{\mathbb{t}} \ge \mathfrak{t}}(\mathfrak{H}_{\dot{\mathbb{t}}})
127
+ \end{cases}, \quad \text{where $\mathfrak{t} \in \{\mathbb{t}-\mathbb{n}\}$}, \quad \text{\textcolor{red}{max simulated adverse-loss }}
128
+ \end{align}
129
+ That finds the max high (if buyside) or min low (if sell side) in between from $\mathfrak{P}_{\mathbb{t}}$ to $\mathfrak{E}_{\mathfrak{t}}$
130
+
131
+ And quality is defined as;
132
+
133
+ \begin{align}
134
+ \mathcal{Q}_{\mathfrak{t}} &=
135
+ \begin{cases}
136
+ \text{if buy}, \quad \displaystyle \underbrace{\min_{\mathbb{t} \ge \dot{\mathbb{t}} \ge \mathfrak{t}}(\mathfrak{L}_{\dot{\mathbb{t}}})}_{\mathcal{L}_{\dot{\mathfrak{t}}}} \cdot \frac{1}{\underbrace{\mathfrak{E}_{\mathfrak{t}} -(\omega_{{\mathfrak{t}}-1} \cdot s_{\mathfrak{t}} \cdot m)}_{\Omega_{\mathfrak{t}}}} \\
137
+ \text{if sell}, \quad \displaystyle \underbrace{\max_{\mathbb{t} \ge \dot{\mathbb{t}} \ge \mathfrak{t}}(\mathfrak{H}_{\dot{\mathbb{t}}})}_{\mathcal{L}_{\dot{\mathfrak{t}}}} \cdot \frac{1}{\underbrace{\mathfrak{E}_{\mathfrak{t}} +(\omega_{{\mathfrak{t}}-1} \cdot s_{\mathfrak{t}} \cdot m)}_{\Omega_\mathfrak{t}}}
138
+ \end{cases}, \quad
139
+ \text{\textcolor{red}{quality of adverse}}
140
+ \end{align}
141
+ where if $\mathcal{Q}_{\mathfrak{t}}$ is closer or equal to zero, then the better, $\mathcal{Q}_{\mathfrak{t}} \succeq 0$.
142
+
143
+ And we formalize our simulated risk-reward ratio as:
144
+
145
+ \begin{align}
146
+ \mathcal{Y}_{\mathfrak{t}} &=
147
+ \begin{cases}
148
+ \text{if buy,} \quad \displaystyle \left|\frac{\mathcal{R}_{\mathfrak{t}}^{buy}}{\Omega_{\mathfrak{t}}^{buy}} \right| \\
149
+ \text{if sell,} \quad \displaystyle \left|\frac{\mathcal{R}_{\mathfrak{t}}^{sell}}{\Omega_{\mathfrak{t}}^{sell}} \right|
150
+ \end{cases}, \quad \text{\textcolor{red}{simulated risk-reward ratio}}
151
+ \end{align}
152
+
153
+
154
+ Therefore we can now project the value of that entry at spcific time $\mathfrak{E}_{\mathfrak{t}}$, formalized as:
155
+
156
+ \begin{align}
157
+ \mathcal{V}_{\mathfrak{t}} &=
158
+ (
159
+ \mathfrak{E}_{\mathfrak{t}}, \Omega_{\mathfrak{t}}, \mathcal{T}_{\mathfrak{t}}, \mathcal{R}_{\mathfrak{t}}, \mathcal{L}_{\mathfrak{t}}, \mathcal{Q}_\mathfrak{t}, \mathcal{Y}_{\mathfrak{t}}
160
+ ), \text{\textcolor{red}{values of simulated trade at $\mathfrak{t}$} where $\mathcal{T}_{\mathfrak{t}}=\mathcal{T}_{\dot{\mathbb{t}}}, \mathcal{R}_{\mathfrak{t}}=\mathcal{R}_{\dot{\mathbb{t}}}, \mathcal{L}_{\mathfrak{t}}=\mathcal{L}_{\dot{\mathbb{t}}} $}
161
+ \end{align}
162
+
163
+ That equation above defines a perfect trade (when enter at that time $\mathfrak{E}_{\mathfrak{t}}$) because all values are already showed at the time of entry. Before you argue that this is a product of mix loockback and lookahead, there is no problem since we are trying to make a another form of data here (the perfect trade).
164
+
165
+ The catch is that if $\mathcal{Y}_{\mathfrak{t}} \ge 1$ then $\mathcal{V}_{\mathfrak{t}}$ is valid, otherwise it's invalid and must not be included in the dataset. Therefore, of we follow this catch, then a valid $\mathcal{V}_{\mathfrak{t}}$ is always ideal and have positive expectancy.
166
+
167
+ Now lets proceed to polishing.
168
+
169
+ Since $\mathfrak{E}_{\mathfrak{t}}$ is also equavalent to 0 as deviated price. Therefore our two possible trades at time $\mathfrak{t}$ is defined as:
170
+
171
+ \begin{align}
172
+ \mathcal{V}_{\mathfrak{t}}^{buy} &=
173
+ \left(
174
+ \mathfrak{E}_{\mathfrak{t}}^{buy}, \Omega_{\mathfrak{t}}^{buy}, \mathcal{T}_\mathfrak{t}^{buy}, \mathcal{R}_{\mathfrak{t}}^{buy}, \mathcal{L}_{\mathfrak{t}}^{buy}, \mathcal{Q}_\mathfrak{t}^{buy}, \mathcal{Y}_\mathfrak{t}^{buy}
175
+ \right) \\
176
+ \mathcal{V}_{\mathfrak{t}}^{sell} &=
177
+ \left(
178
+ \mathfrak{E}_{\mathfrak{t}}^{sell}, \Omega_{\mathfrak{t}}^{sell}, \mathcal{T}_\mathfrak{t}^{sell}, \mathcal{R}_{\mathfrak{t}}^{sell}, \mathcal{L}_{\mathfrak{t}}^{sell}, \mathcal{Q}_\mathfrak{t}^{sell}, \mathcal{Y}_\mathfrak{t}^{sell}
179
+ \right)
180
+ \end{align}
181
+
182
+ First, we need to make all variables of $\mathcal{V}_{\mathfrak{t}}^{sell}$ into into reverse becuase the favorable side is the opposite of its value (i.e. the loss is located at positive and the return is located at the negative, if we follow the formula discussed from the very beginning), therefore we formalize that as
183
+ \begin{align}
184
+ \mathcal{V}_{\mathfrak{t}}^{{sell},{r}} &=
185
+ \text{Rev}
186
+ (
187
+ \mathfrak{E}_{\mathfrak{t}}, \Omega_{\mathfrak{t}}, \mathcal{T}_{\mathfrak{t}}, \mathcal{R}_{\mathfrak{t}}, \mathcal{L}_{\mathfrak{t}}, \mathcal{Q}_\mathfrak{t}, \mathcal{Y}_{\mathfrak{t}}
188
+ ) =
189
+ (
190
+ -\mathfrak{E}_{\mathfrak{t}}, -\Omega_{\mathfrak{t}}, -\mathcal{T}_{\mathfrak{t}}, -\mathcal{R}_{\mathfrak{t}}, -\mathcal{L}_{\mathfrak{t}}, -\mathcal{Q}_\mathfrak{t}, -\mathcal{Y}_{\mathfrak{t}}
191
+ ), \quad \text{where $r$ is notation for $reverse$}
192
+ \end{align}
193
+
194
+ then let $v$ be the invididual variables of $\mathcal{V}$, and we formalize our points calculator as:
195
+
196
+ \begin{align}
197
+ \text{Point}\left(v_{\mathfrak{t}}^{buy}, v_{\mathfrak{t}}^{sell}\right) &=
198
+ \begin{cases}
199
+ (1,1) & \text{if } \mathfrak{E}_{\mathfrak{t}}^{buy} \gtreqless \mathfrak{E}_{\mathfrak{t}}^{{sell},r} \\
200
+ (1,1) & \text{if } \Omega_{\mathfrak{t}}^{buy} \gtreqless \Omega_{\mathfrak{t}}^{{sell},r} \\
201
+ (1,0) & \text{if } \mathcal{T}_{\mathfrak{t}}^{buy} > \mathcal{T}_{\mathfrak{t}}^{{sell},r} \\
202
+ (0,1) & \text{if } \mathcal{T}_{\mathfrak{t}}^{buy} < \mathcal{T}_{\mathfrak{t}}^{{sell},r} \\
203
+ (1,0) & \text{if } \mathcal{R}_{\mathfrak{t}}^{buy} > \mathcal{R}_{\mathfrak{t}}^{{sell},r} \\
204
+ (0,1) & \text{if } \mathcal{R}_{\mathfrak{t}}^{buy} < \mathcal{R}_{\mathfrak{t}}^{{sell},r} \\
205
+ (0,1) & \text{if } \mathcal{L}_{\mathfrak{t}}^{buy} > \mathcal{L}_{\mathfrak{t}}^{{sell},r} \\
206
+ (1,0) & \text{if } \mathcal{L}_{\mathfrak{t}}^{buy} < \mathcal{L}_{\mathfrak{t}}^{{sell},r} \\
207
+ (0,1) & \text{if } \mathcal{Q}_\mathfrak{t}^{buy} > \mathcal{Q}_\mathfrak{t}^{{sell},r} \\
208
+ (1,0) & \text{if } \mathcal{Q}_\mathfrak{t}^{buy} < \mathcal{Q}_\mathfrak{t}^{{sell},r} \\
209
+ (1,0) & \text{if } \mathcal{Y}_\mathfrak{t}^{buy} > \mathcal{Y}_\mathfrak{t}^{{sell},r} \\
210
+ (0,1) & \text{if } \mathcal{Y}_\mathfrak{t}^{buy} < \mathcal{Y}_\mathfrak{t}^{{sell},r} \\
211
+ \end{cases}
212
+ \end{align}
213
+
214
+ Therefore our scoring is formalized as:
215
+
216
+ \begin{align}
217
+ \text{Favor} \left(\mathcal{V}_{\mathfrak{t}}^{buy},\mathcal{V}_{\mathfrak{t}}^{sell}\right) &=
218
+ \begin{cases}
219
+ (1,0) & \text{if } \displaystyle\sum_{\text{all } v} \text{Point}\left(v_{\mathfrak{t}}^{buy}\right) > \sum_{\text{all } v} \text{Point}\left(v_{\mathfrak{t}}^{sell}\right) \\
220
+ (0,1) & \text{if } \displaystyle\sum_{\text{all } v} \text{Point}\left(v_{\mathfrak{t}}^{buy}\right) < \sum_{\text{all } v} \text{Point}\left(v_{\mathfrak{t}}^{sell}\right)
221
+ \end{cases}
222
+ \end{align}
223
+ That equation above will tell us whether if it is best to buy or sell at that time $\mathfrak{t}$
224
+
225
+ Say we want to know wheter it is best to buy or sell at times $\mathfrak{t}_1, \mathfrak{t}_2, \mathfrak{t}_3, \mathfrak{t}_4, \mathfrak{t}_5$, and we calculate each $\text{Favor} \left(\mathcal{V}_{\mathfrak{t}}^{buy},\mathcal{V}_{\mathfrak{t}}^{sell}\right)$ at that time, then we get something like; as example:
226
+ \begin{align}
227
+ \mathcal{V}_{\mathfrak{t}_1}^{sell}, \mathcal{V}_{\mathfrak{t}_2}^{sell}, \mathcal{V}_{\mathfrak{t}_3}^{buy}, \mathcal{V}_{\mathfrak{t}_4}^{sell}, \mathcal{V}_{\mathfrak{t}_5}^{buy}
228
+ \end{align}
229
+ where each time contains rich information of
230
+ \begin{align}
231
+ \mathcal{V}_{\mathfrak{t}} &=
232
+ (
233
+ \mathfrak{E}_{\mathfrak{t}}, \Omega_{\mathfrak{t}}, \mathcal{T}_{\mathfrak{t}}, \mathcal{R}_{\mathfrak{t}}, \mathcal{L}_{\mathfrak{t}}, \mathcal{Q}_\mathfrak{t}, \mathcal{Y}_{\mathfrak{t}}
234
+ ),
235
+ \end{align}
236
+
237
+ Moving on, since we stated "\textit{if $\mathcal{Y}_{\mathfrak{t}} \ge 1$ then $\mathcal{V}_{\mathfrak{t}}$ is valid, otherwise it's invalid and must not be included in the dataset}" that mean we will be having three possible outcome for each $\mathfrak{t}$, which is defined as:
238
+ \begin{align}
239
+ T^{valid}_{\mathfrak{t}} &\in \{\mathcal{V}_{\mathfrak{t}}^{buy},\mathcal{V}_{\mathfrak{t}}^{sell}\}, \quad \text{where $T^{valid}$ means there is a Trade on that time} \\
240
+ T^{null}_{\mathfrak{t}} &\notin \{\mathcal{V}_{\mathfrak{t}}^{buy},\mathcal{V}_{\mathfrak{t}}^{sell}\}, \quad \text{where $T^{null}$ there is no Trade on that time}
241
+ \end{align}
242
+ Therefore we get something like this:
243
+ \begin{align}
244
+ T^{valid}_{\mathfrak{t}_1},T^{valid}_{\mathfrak{t}_2},T^{valid}_{\mathfrak{t}_3},T^{valid}_{\mathfrak{t}_4},T^{valid}_{\mathfrak{t}_5},T^{null}_{\mathfrak{t}_6},T^{valid}_{\mathfrak{t}_7},T^{null}_{\mathfrak{t}_8},T^{null}_{\mathfrak{t}_9},T^{valid}_{\mathfrak{t}_{10}}
245
+ \end{align}
246
+
247
+ \end{document}