Algo Trading

This is my github repository where I post trading strategies, tutorials and research on quantitative finance with R, C++ and Python. Some of the topics explored include: machine learning, high frequency trading, NLP, technical analysis and more. Hope you enjoy it!

116
31
R

Quant Finance Repository

Hi everyone! This is my respository where I store all my code and research within Quantitative Finance with the programming languages: C++, R and Python.

Some of the things you can find here are trading strategies, research and tutorials on topics such as algorithmic trading, market microstructure analysis and machine learning, amongst others.

Below is a list explaining all the topics covered within the repository:

Technical Analysis (TA)

These are the documents starting with ‘TA’. The files with those initials contain analysis of strategies and research done utilising some of the most poplar and powerful technical indicators.

Fundamental Analysis (FA)

Fundamental analysis is a method of measuring a security’s intrinsic value by examining related economic and financial factors. Fundamental analysis involves studying anything that can affect the security’s value, from macroeconomic factors such as the state of the economy and industry conditions to microeconomic factors like the effectiveness of the company’s management. Files with the initials ‘FA’ will contain work done with this methodology.

Quantstrat

Quantstrat is a library in R that provides a generic infrastructure to model and backtest signal-based quantitative strategies. It is a high-level abstraction layer (built on xts, FinancialInstrument, blotter, etc.) that allows you to build and backtest strategies. The files starting with the name of this library contain strategies built utilising it’s infrastructure.

Statistical Arbitrage (SA)

Statistical arbitrage (often abbreviated as Stat Arb) is a class of short-term financial trading strategies that employ mean reversion models involving broadly diversified portfolios of securities held for short periods of time (generally seconds to days). The files starting with the initals ‘SA’ contain strategies based on this type of trading (a common example is pairs trading).

Machine Learning (ML)

Machine learning is an application of artificial intelligence (AI) that provides systems the ability to automatically learn and improve from experience without being explicitly programmed. In this case, files with the initials ‘ML’ will contain code where I have applied different algorithms of machine learning to analyse and trade on financial markets.
Machine learning can be divided into three types of learning:

Supervised Learning (SL):

Supervised learning occurs when an algorithm learns from data and associated target responses that can consist of numeric values or string labels, such as classes or tags, in order to later predict the correct response when posed with new data. The supervised approach is indeed similar to human learning under the supervision of a teacher. The teacher provides good examples for the student to memorize, and the student then derives general rules from these specific examples.

Common algorithms: Linear Regression, Logistic Regression, SVM, KNN, etc.

Unsupervised Learning (UL):

Unsupervised learning occurs when an algorithm learns from plain examples without any associated response, leaving to the algorithm to determine the data patterns on its own. As a kind of learning, it resembles the methods humans use to figure out that certain objects or events are from the same class, such as by observing the degree of similarity between objects.

Common algorithms: K-Means clustering, Apriori, Principal Component Analysis, etc.

Reinforc Learning (RL):

Reinforcement learning is when a machine or an agent interacts with a given environment by performing actions and learning by a trial-and-error method, many times being rewarded or punished depending on whether it’s action was good or not. A good example of this is a robot that learns to play chess. The chess board is the environment, it’s reward function was the pieces beaten, and it learned how to “play” the game to improve it’s reward.

Common algorithms: Q-Learning, SARSA, etc.

Deep Learning (DL):

Deep Learning is a sub domain of all the above categories and machine learning overall. Deep learning is an AI function that mimics the workings of the human brain in processing data for use in detecting objects, recognizing speech, translating languages, and making decisions. The label ‘Deep Learning’ can be applied to any algorithm that specifically uses a multi-layer neural network, a deep network.

Common algorithms: Multilayer Perceptron Neural Network (MLPNN), Convolutional Neural Network (CNN), Recurrent Neural Network (RNN), etc.

High Frequency Trading (HFT):

High-frequency trading is a type of algorithmic trading characterized by high speeds, high turnover rates, and high order-to-trade ratios that leverages high-frequency financial data and electronic trading tools. The files including ‘HFT’ will contain amongst other things: market microstructure analysis, HFT strategies, tutorials on packages that help explore the HFT world.

General Quant Finance (GQF):

In here you will find general code on Quantitative Finance such as: Monte Carlo sumilations, Markov Chain processes, Risk Management, Derivative Calcultions, etc.