<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/rcppquantuccia-0-0-1/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://dirk.eddelbuettel.com/blog/2017/04/19#rcppquantuccia_0.0.1"> Thinking inside the box </a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>New package! And, as it happens, a effectively a subset or variant of one my oldest packages, <a target="_blank" rel="nofollow" href="http://dirk.eddelbuettel.com/code/rquantlib.html">RQuantLib</a>.</p>
<p>Fairly recently, <a target="_blank" rel="nofollow" href="https://github.com/pcaspers">Peter Caspers</a> started to put together a header-only subset of <a target="_blank" rel="nofollow" href="https://github.com/lballabio/quantlib">QuantLib</a>. He called this <a target="_blank" rel="nofollow" href="https://github.com/pcaspers/Quantuccia">Quantuccia</a>, and, upon me asking, said that it stands for <em>&quot;little sister&quot;</em> of <a target="_blank" rel="nofollow" href="https://github.com/lballabio/quantlib">QuantLib</a>. Very nice.</p>
<p>One design goal is to keep <a target="_blank" rel="nofollow" href="https://github.com/pcaspers/Quantuccia">Quantuccia</a> header-only. This makes distribution and deployment <em>much</em> easier. In the fifteen years that we have worked with <a target="_blank" rel="nofollow" href="https://github.com/lballabio/quantlib">QuantLib</a> by providing the R bindings via <a target="_blank" rel="nofollow" href="http://dirk.eddelbuettel.com/code/rquantlib.html">RQuantLib</a>, it has always been a concern to provide current QuantLib libraries on all required operating systems. Many people helped over the years but it is still an issue, and <em>e.g.</em> right now we have <em>no</em> Windows package as there is no library build it against.</p>
<p>Enter <a target="_blank" rel="nofollow" href="http://dirk.eddelbuettel.com/code/rcpp.quantuccia.html">RcppQuantuccia</a>. It only depends on R, <a target="_blank" rel="nofollow" href="http://dirk.eddelbuettel.com/code/rcpp.html">Rcpp</a> (for seamless R and C++ integrations) and <a target="_blank" rel="nofollow" href="http://dirk.eddelbuettel.com/code/bh.html">BH</a> bringing Boost headers. This will make it <em>much</em> easier to have Windows and macOS binaries.</p>
<p>So what can it do right now? We started with calendaring, and you can compute date pertaining to different (ISDA and other) business day conventions, and compute holiday schedules. Here is one example computing <em>inter alia</em> under the NYSE holiday schedule common for US equity and futures markets:</p>
<div>
<pre><code>R><span> </span><span>library</span>(RcppQuantuccia)
R><span> </span>fromD &lt;-<span> </span><span>as.Date</span>(<span>&quot;2017-01-01&quot;</span>)
R><span> </span>toD &lt;-<span> </span><span>as.Date</span>(<span>&quot;2017-12-31&quot;</span>)
R><span> </span><span>getHolidays</span>(fromD, toD)        <span># default calender ie TARGET</span>
[<span>1</span>] <span>&quot;2017-04-14&quot;</span> <span>&quot;2017-04-17&quot;</span> <span>&quot;2017-05-01&quot;</span> <span>&quot;2017-12-25&quot;</span> <span>&quot;2017-12-26&quot;</span>
R><span> </span><span>setCalendar</span>(<span>&quot;UnitedStates&quot;</span>)
R><span> </span><span>getHolidays</span>(fromD, toD)        <span># US aka US::Settlement</span>
[<span>1</span>] <span>&quot;2017-01-02&quot;</span> <span>&quot;2017-01-16&quot;</span> <span>&quot;2017-02-20&quot;</span> <span>&quot;2017-05-29&quot;</span> <span>&quot;2017-07-04&quot;</span> <span>&quot;2017-09-04&quot;</span>
[<span>7</span>] <span>&quot;2017-10-09&quot;</span> <span>&quot;2017-11-10&quot;</span> <span>&quot;2017-11-23&quot;</span> <span>&quot;2017-12-25&quot;</span>
R><span> </span><span>setCalendar</span>(<span>&quot;UnitedStates::NYSE&quot;</span>)
R><span> </span><span>getHolidays</span>(fromD, toD)        <span># US New York Stock Exchange</span>
[<span>1</span>] <span>&quot;2017-01-02&quot;</span> <span>&quot;2017-01-16&quot;</span> <span>&quot;2017-02-20&quot;</span> <span>&quot;2017-04-14&quot;</span> <span>&quot;2017-05-29&quot;</span> <span>&quot;2017-07-04&quot;</span>
[<span>7</span>] <span>&quot;2017-09-04&quot;</span> <span>&quot;2017-11-23&quot;</span> <span>&quot;2017-12-25&quot;</span>
R></code></pre>
</div>
<p>The GitHub repo already has a few more calendars, and more are expected. Help is of course welcome for both this, and for porting over actual quantitative finance calculations.</p>
<p>More information is on the <a target="_blank" rel="nofollow" href="http://dirk.eddelbuettel.com/code/rcpp.quantuccia.html">RcppQuantuccia</a> page. Issues and bugreports should go to the <a target="_blank" rel="nofollow" href="https://github.com/eddelbuettel/rcppquantuccia/issues">GitHub issue tracker</a>.</p>
<p>
This post by <a target="_blank" rel="nofollow" href="http://dirk.eddelbuettel.com/">Dirk Eddelbuettel</a> originated on his <a target="_blank" rel="nofollow" href="http://dirk.eddelbuettel.com/blog/">Thinking inside the box</a> blog. Please report excessive re-aggregation in third-party for-profit settings.</p>
<p>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://dirk.eddelbuettel.com/blog/2017/04/19#rcppquantuccia_0.0.1"> Thinking inside the box </a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/bbAlsWnjppw"></a></div>