python

Posted on Jun 03, 2020 by Ajet Luka
2 comments.
0 Views

In the world of Big Data, there are lots of tools and technologies to choose from. Choosing the "right" one depends on the things that you are building and the problems you are trying to solve. Trading firms have skilled teams that monitor and deploy data pipelines for their organisation and the technical overhead that comes with that. Firms invest in data infrastructure and research because data is at the centre of what they do. Data pipelines need to be robust and meet the technical requirements set by the organisation,  and they also need to be cost-efficient. These are challenges that a sole systematic trader can have a hard time tackling. This is especially true when you take into account that solo-traders also need to allocate their time in other parts of their trading business. So choosing a technology that is easy to manage and deploy pipelines with, and also offers good price efficiency is very important for a systematic trader. Enter Apache Beam... Apache Beam is a unified programming model for batch and streaming data processing jobs. It comes...

Posted on May 04, 2020 by Ajet Luka
9 comments.
0 Views

In today's post we are going to be extracting CoT (Commitment of Traders) reports from the CFTC website using a pipeline built on Apache Airflow. What is CoT data? The CoT report is a weekly publication which reports the open positions of market participants in the U.S futures market. It's published every Friday at 3:30 E.T but the actual report from the participants is compiled on the same week Tuesday. See here for more information on it. Getting Data From "Everywhere" to "here" I'm sure you heard of the term data is everywhere. It definitely is. However, you often want it "here" where you can analyze it, not out there. There are many ways of getting data from everywhere to here. The path which time- and resource-constrained traders should choose is the one that offers the most return on their effort. For example, chances are you are not going to get any improvement in productivity if you decide to code a bespoke system that fits your "needs". Simply using the ones that are already there will be more than enough. A python library...

Posted on Jul 10, 2018 by Kris Longmore
1 Comment.
0 Views

One of the ongoing research projects inside the Robot Wealth community involves an FX strategy with some multi-week hold periods. Such a strategy can be significantly impacted by the swap, or the cost of financing the position. These costs change over time, and we decided that for the sake of more accurate simulations, we would incorporate these changes into our backtests. This post shows you how to simulate variable FX swaps in both Python and the Zorro trading automation software platform. What is Swap? The swap (also called the roll) is the cost of financing an FX position. It is typically derived from the central bank interest rate differential of the two currencies in the exchange rate being traded, plus some additional fee for your broker. Most brokers apply it on a daily basis, and typically apply three times the regular amount on a Wednesday to account for the weekend. Swap can be both credited to and debited from a trader's account, depending on the actual position taken. Why is it Important? Swap can have a big impact on strategies...

Posted on Jun 11, 2018 by Kris Longmore
1 Comment.
0 Views

Cryptocompare is a platform providing data and insights on pretty much everything in the crypto-sphere, from market data for cryptocurrencies to comparisons of the various crytpo-exchanges, to recommendations for where to spend your crypto assets. The user-experience is quite pleasant, as you can see from the screenshot of their real-time coin comparison table: As nice as the user-interface is, what I really like about Cryptocompare is its API, which provides programmatic access to a wealth of crypto-related data. It is possible to drill down and extract information from individual exchanges, and even to take aggregated price feeds from all the exchanges that Cryptocompare is plugged into - and there are quite a few! Interacting with the Cryptocompare API When it comes to interacting with Cryptocompare's API, there are already some nice Python libraries that take care of most of the heavy lifting for us. For this post, I decided to use a library called cryptocompare . Check it out on Git Hub here. You can install the current stable release by doing pip install cryptocompare , but I installed the latest development...

Posted on Jan 03, 2017 by Kris Longmore
10 comments.
0 Views

What if you had a tool that could help you decide when to apply mean reversion strategies and when to apply momentum to a particular time series? That's the promise of the Hurst exponent, which helps characterise a time series as mean reverting, trending, or a random walk. For a brief introduction to Hurst, including some Python code for its calculation, check out our previous post. Even if you have read this post previously, it is worth checking out again as we have updated our method for calculating Hurst and believe this new implementation is more accurate. It would be great if we could plug some historical time series data into the Hurst algorithm and know whether we expect the time series to mean revert or trend. But as is usually the case when we apply such tools to the financial domain, it isn't quite that straightforward. In the last post, we noted that Hurst gives different results depending on how it is calculated; this begs the question of how to choose a calculation method intelligently so that we avoid choosing...