Skip to content

Commit

Permalink
Deployed 0bbdbdd with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
KarelZe committed Dec 28, 2023
1 parent d21eb27 commit 5f2bea1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ <h1 id="trade-classification-with-python">Trade classification with python 🐍<
<h2 id="installation">Installation<a class="headerlink" href="#installation" title="Permanent link">&para;</a></h2>
<div class="highlight"><pre><span></span><code><span class="gp">$ </span>pip<span class="w"> </span>install<span class="w"> </span>.
<span class="go">---&gt; 100%</span>
<span class="go">Successfully installed tclf-0.0.0</span>
<span class="go">Successfully installed tclf-0.0.1</span>
</code></pre></div>
<h2 id="supported-algorithms">Supported Algorithms<a class="headerlink" href="#supported-algorithms" title="Permanent link">&para;</a></h2>
<ul>
Expand Down
3 changes: 3 additions & 0 deletions option_trade_classification/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,9 @@ <h2 id="prepare-dataset">Prepare Dataset<a class="headerlink" href="#prepare-dat
<span class="n">X</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_parquet</span><span class="p">(</span><span class="n">gcs_loc</span><span class="p">,</span> <span class="n">engine</span><span class="o">=</span><span class="s2">&quot;pyarrow&quot;</span><span class="p">,</span> <span class="n">filesystem</span><span class="o">=</span><span class="n">fs</span><span class="p">)</span>
</code></pre></div>
Unfortunately, the dataset does not yet follow the <a href="https://karelze.github.io/tclf/naming_conventions/">naming conventions</a> and is missing columns required by <code>tclf</code>. We take care of this next.😅</p>
<div class="highlight"><pre><span></span><code><span class="n">clf</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">X</span><span class="p">)</span>
<span class="o">&gt;&gt;&gt;</span> <span class="ne">ValueError</span><span class="p">:</span> <span class="n">Expected</span> <span class="n">to</span> <span class="n">find</span> <span class="n">columns</span><span class="p">:</span> <span class="p">[</span><span class="s1">&#39;ask_best&#39;</span><span class="p">,</span> <span class="s1">&#39;ask_size_best&#39;</span><span class="p">,</span> <span class="s1">&#39;bid_best&#39;</span><span class="p">,</span> <span class="s1">&#39;bid_size_best&#39;</span><span class="p">,</span> <span class="s1">&#39;trade_price&#39;</span><span class="p">,</span> <span class="s1">&#39;trade_size&#39;</span><span class="p">]</span><span class="o">.</span> <span class="n">Check</span> <span class="n">naming</span><span class="o">/</span><span class="n">presenence</span> <span class="n">of</span> <span class="n">columns</span><span class="o">.</span> <span class="n">See</span><span class="p">:</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">karelze</span><span class="o">.</span><span class="n">github</span><span class="o">.</span><span class="n">io</span><span class="o">/</span><span class="n">tclf</span><span class="o">/</span><span class="n">naming_conventions</span><span class="o">/</span>
</code></pre></div>
<p>The calculation of the <a href="https://github.com/KarelZe/tclf/blob/main/src/tclf/classical_classifier.py#L362C1-L363C1">depth rule</a> requires the columns <code>ask_{subset}</code>, <code>bid_{subset}</code>, and <code>trade_price</code>, as well as <code>ask_size_{subset}</code>, <code>bid_size_{subset}</code> and <code>trade_size</code>. The columns <code>BEST_ASK</code>, <code>BEST_BID</code>, <code>TRADE_PRICE</code>, and <code>TRADE_SIZE</code> are renamed to match our naming conventions of <code>ask_{subset}</code>, <code>bid_{subset}</code>, <code>trade_price</code>, and <code>trade_size</code>.</p>
<p>As there is no <code>{ask/bid}_size_best</code> at the NBBO level (<code>subset="best"</code>), I copy the columns from the trading venue. This allows us to mimic the author's decision to filter for mid-spread at the NBBO level, but classify by the trade size relative to the ask/bid size at the exchange.</p>
<p>We save the true label <code>y_true</code> and the timestamp of the trade <code>QUOTE_DATETIME</code> to a new dataframe, named <code>X_meta</code>, which we use for plotting and remove these columns from the original dataframe.</p>
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Binary file modified sitemap.xml.gz
Binary file not shown.

0 comments on commit 5f2bea1

Please sign in to comment.