Articles by R - datawookie

Asset Price Data

October 23, 2024 | R - datawookie

In a previous post I looked at retrieving a list of assets from the Alpaca API using the {alpacar} R package. Now we’ll explore how to retrieve historical and current price data.
[Read more...]

Authenticate with Alpaca API

October 12, 2024 | R - datawookie

The {alpacar} package for R is a wrapper around the Alpaca API. API documentation can be found here. In this introductory post I show how to install and load the package, then authenticate with the API and retrieve account information. [Read more...]

Economic Calendar

October 1, 2024 | R - datawookie

I needed an offline copy of an economic calendar with all of the major international economic events. After grubbing around the internet I found the Economic Calendar on Myfxbook which had everything that I needed.
[Read more...]

Your Life in Weeks

August 12, 2024 | R - datawookie

A few months ago I listened to an episode on the Founder’s Journal podcast. The episode reviewed an essay, The Opportunity Cost of Everything, by Jack Raines. If you haven’t read it, then I suggest you invest 10 minutes in doing so. It will be time well spent.
[Read more...]

Unpacking cURL Commands

July 9, 2024 | R - datawookie

cURL is the ultimate Swiss Army Knife for interacting with network protocols. But to be honest, I really only scratch the surface of what’s possible. Usually my workflow is something like this: Copy a cURL command from my browser’s Developer Tools. Test out the cURL command in a ...
[Read more...]

Updates to the Big Book of R

June 25, 2024 | R - datawookie

The Big Book of R provides a comprehensive and ever-growing overview of a broad selection of R programming books. It was created and is maintained by Oscar Baruffa. The collection began with approximately 100 books and, with the help of contributions from the R community, has subsequently expanded to over 400. The ...
[Read more...]

{emayili} Support for Mailtrap

April 22, 2024 | R - datawookie

The {emayili} package has adapters which make it simple to send email via a variety of services. For example, it caters specifically for ZeptoMail, MailerSend, Mailfence and Sendinblue. The latest version of {emayili}, 0.8.0 published on 23 April 2024, adds an an adapter for Mailtrap.
[Read more...]

Backtesting

April 19, 2024 | R - datawookie

The key to successful backtesting is to ensure that you only use the data that were available at the time of the prediction. No “future” data can be included in the model training set, otherwise the model will suffer from look-ahead bias (having unrealistic access to future data).
[Read more...]

Asset Allocation

April 18, 2024 | R - datawookie

The Two-Fund Separation Theorem introduced by James Tobin, a Nobel Prize-winning economist, is a fundamental concept in investment theory. It addresses how investors can optimally allocate their assets. In an efficient market an optimal portfolio is a combination of a risk-free asset and a market portfolio.
[Read more...]

Risk/Reward Tradeoff

April 14, 2024 | R - datawookie

The two quantities we have been modelling (the time-dependent average and standard deviation of the returns) represent respectively the (potential) risk and reward associated with an asset. The relationship between these two quantities is implicit in the GARCH model. However, sometimes the return depends directly on the risk. A variant ... [Read more...]

Model Validation

April 13, 2024 | R - datawookie

Is this a “good” model? How to validate a model and determine whether it’s a good representation of the training data and likely to produce robust and reliable predictions.
[Read more...]

Leverage Effect

April 11, 2024 | R - datawookie

The models we have been looking at do not differentiate between positive and negative residuals: both errors are treated the same. However, this does not align with reality, where the volatility resulting from a large negative return is higher than that for the corresponding positive return.
[Read more...]

Loading Financial Time Series

April 7, 2024 | R - datawookie

I’m going to be writing a series of posts which will look at some applications of R (and perhaps Python) to financial modelling. We’ll start here by pulling some stock data into R, calculating the daily returns and then looking at correlations and simple volatility estimates.
[Read more...]
1 2 3 4

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)