54

Data Science in Algorithmic Trading

 5 years ago
source link: https://www.tuicool.com/articles/hit/Q7jummu
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

In this article I plan to give you a glimpse into an asset model for algorithmic trading. This model of the world should allow us to make predictions about what will happen, based upon what happened in the past, and to make money by trading on this information. The model and trading stradegy are a toy example, but I am providing the data science part of the code, so that you can get a real sense of the tangibility of this modelling work.

I started writing the code for this article a few months ago, and I’m posting it now along with the news that we got our SEC license for Investifai !

Since my Investifai.com presentation at TMLS in September 2018, I have been getting questions about what our proprietary data is, and frankly, I’m not talking. It is important to point out that with only “standard” market data from Bloomberg and Thompson Reuters, you are up against the whole FinTech world, who pays for access to the same data. And so, novel data sources give you an edge in making predictions for which other market participants may not have the data.

In this article I’m going to show you how to identify economic data and match it up with a tradeable asset. We will get the data, clean it, interrogate it, and set it up in a simple model.

“All models are wrong but some are useful” -George Box

Our asset for this toy exercise is the currency pair USD/CAD . We can obtain the daily historical data for the asset going back to the 1950s from Open Data Canada right here .

The following code cleans up that data, transforming it into a useable format.

Here is the data for USD/CAD in a chart from fxtop.com:

A7fmYjy.png!web

And now here is the data we extracted from the Open Data Canada dataset:

ie222uy.png!web
The exchange rate for trading one USD into CAD excluding fees.

The data dips in the same places on both charts, and with a few more spot checks, we are confident that this is the data we think it is.

So far, we have seen that there is quite a bit of sneaky cleaning up to do in order to get data in a nice format. This is the story in data science: Most of the work is on manipulating the data into the format you need for observing correlations and then making predictions.

Now we move on to get some data we think will help us to predict the movement of the USD/CAD asset. That data will also come from Open Data Canada, in the form of the Industrial Product Price Index (IPPI) which should be related to how the Canadian currency fares relative to the US currency. If stuff costs more, maybe that tells us something about the economy and the currency (relative to the US). There is a lot more info I’ll skip on where this data comes from and how it is collected and calculated. Now hold onto your seat. Here we go…


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK