IBKR Quant Blog


1 2 3 4 5 2 35


Quant

Join IBKR for a Free Webinar with qplum - Technology Stack of a Systematic Trade Execution Engine


Tuesday, December 18, 2018 12:00 PM EST
 

Register

 

qplum - Technology Stack of a Systematic Trade Execution Engine

 

In this webinar, Hardik Patel will discuss the systematic trading infrastructure that qplum uses to efficiently execute its moderately active, quantitative strategies. He will give a detailed architectural blueprint of the trade execution engine. He will also share how working with brokers like Interactive Brokers can cut trading costs, reduce slippage, and increase transparency.

 

Speaker: Hardik Patel, Machine Learning Engineer at qplum

Sponsored by:  qplum

 

Information posted on IBKR Quant that is provided by third-parties and not by Interactive Brokers does NOT constitute a recommendation by Interactive Brokers that you should contract for the services of that third party. Third-party participants who contribute to IBKR Quant are independent of Interactive Brokers and Interactive Brokers does not make any representations or warranties concerning the services offered, their past or future performance, or the accuracy of the information provided by the third party. Past performance is no guarantee of future results


20897




Quant

Machine Learning Basics


By Shagufta Tahsildar

Quant

We have been learning since the dawn of time. From the basics of talking, walking and eating to learning more advanced skills like cooking, dancing or singing. But in today’s world, learning is not just limited to humans. As machines have taken over many of our manual tasks, they’ve also developed the ability to learn. According to a new research report, the Machine Learning market size is expected to grow from USD 1.41 Billion in 2017 to USD 8.81 Billion by 2022, at a Compound Annual Growth Rate (CAGR) of 44.1%.

To learn more about the development of the field of Machine Learning, you can refer to this blog.

In this blog post, we will be reviewing fundamental machine learning topics for beginners and professionals alike that covers  the machine learning process and more.

What is Machine Learning?

Machine Learning, as the name suggests, provides machines with the ability to learn autonomously based on experiences, observations and analyzing patterns within a given data set without explicitly programming. When we write a program or a code for some specific purpose, we are actually writing a definite set of instructions which the machine will follow. Whereas in machine learning, we input a data set through which the machine will learn by identifying and analyzing the patterns in the data set and learn to take decisions autonomously based on its observations and learnings from the dataset.

Timeline of Machine Learning

An article on machine learning basics would be incomplete without covering the history of machine learning. Below, we’ve covered a brief history highlighting critical events.

Quant

 

The difference between Machine Learning, Artificial Intelligence and Deep Learning

While learning about machine learning basics, one often confuses Machine Learning, Artificial Intelligence and Deep Learning. The below diagram clears the concept of machine learning.

Quant

 

How do Machines learn?

Well, the simpler answer is, just like humans do! First, we receive information and attempt to store it so that we may recognize and contextualize what we processed at a later time. In addition, past experiences help us to making decisions in the future. Our brain trains itself by identifying features and patterns in knowledge/data received, enabling ourselves to successfully identify or distinguish information.

Similarly, we feed knowledge/data to the machine; this data is divided into two parts — training data and testing data. The machine learns the patterns and features from the training data and trains itself to identify, classify and predict new data. We use the testing data to measure the machine’s accuracy. Here’s a basic machine learning example:

You want to predict whether the next day is going to be rainy or sunny. Generally, we will do this by looking at a combination of data like the weather conditions of the past few days and present data such as wind direction, cloud formation etc. Had it been raining for the past few days, we would predict that it would rain for the next day too based on the pattern and vice versa. Similarly, we feed the past few days’ weather data along with the present data to the machine. The machine will analyze the patterns and eventually predict the weather for the next day.

 

Classification of Machine Learning Algorithms

Machine Learning algorithms can be classified into:

  1. Supervised Algorithms – Linear Regression, Logistic Regression, Support Vector Machine (SVM), Decision Trees, Random Forest
  2. Unsupervised Algorithms – K Means Clustering.
  3. Reinforcement Algorithm

 

Visit QuantInsti website to learn more about the different types of Machine Learning Algorithms and their application.

 

 

Disclaimer: All investments and trading in the stock market involve risk. Any decisions to place trades in the financial markets, including trading in stock or options or other financial instruments is a personal decision that should only be made after thorough research, including a personal risk and financial assessment and the engagement of professional assistance to the extent you believe necessary. The trading strategies or related information mentioned in this article is for informational purposes only.

 

If you want to learn more about  quant methods in trading strategies, or to download sample machine learning code to train and test your algos, visit QuantInsti website and the educational offerings at their Executive Programme in Algorithmic Trading (EPAT™).

This article is from QuantInsti and is being posted with QuantInsti’s permission. The views expressed in this article are solely those of the author and/or QuantInsti and IB is not endorsing or recommending any investment or trading discussed in the article. This material is for information only and is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad-based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation by IB to buy, sell or hold such security. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.


20987




Quant

Samssara Capital - Statistics: The Missing Link between Technical Analysis and Algorithmic Trading


Learn how statistical tools like PCA, ARCH, and GARCH are applied in algorithmic trading with this webinar recording:

View the Recording

 

Quant

 

Description

Trading leveraged derivatives using only technical analysis or speculative analysis can lead to windfall losses for even the most disciplined trader and investor. Statistics are often an ignored area of work when it comes to derivatives trading. The webinar will focus upon how volatility can be used for dynamically adjusting stop orders. It will talk about how correlation is an essential method to diversify the class of derivatives being traded or hedged. It will focus on co-integration as a key method to distinguish a mean reverting time series to a non-mean reverting time series. It will touch upon other essential time series econometrics like OU process, VRT as well as statistical tools like PCA, ARCH, GARCH etc. which are essential for derivatives pricing and forecasting the volatility.

Speaker: Manish Jalan, MD and CEO, Samssara Capital

 

Information posted on IBKR Quant that is provided by third-parties and not by Interactive Brokers does NOT constitute a recommendation by Interactive Brokers that you should contract for the services of that third party. Third-party participants who contribute to IBKR Quant are independent of Interactive Brokers and Interactive Brokers does not make any representations or warranties concerning the services offered, their past or future performance, or the accuracy of the information provided by the third party. Past performance is no guarantee of future results.


20911




Quant

Aroon Indicator: How To Use It For Cryptocurrency Trading*


By Varun Divakar

Quant

 

In this blog, we will understand the Aroon Indicator, also known as Aroon Oscillator.

What is Aroon Indicator?

In 1995 Tushar Chande, a principal of Tuscarora Capital Management and author of “The New Technical Trader” (1994) and “Beyond Technical Analysis” (2001), developed the Aroon indicator. It is extremely useful in capturing the trend and identifying range-bound markets.

How to calculate Aroon Indicator?

First, let us understand how Aroon is calculated. Aroon Indicator has two parts to it.

  1. AroonUp
  2. AroonDown

AroonUp is used to measure the upside trend and AroonDown is used to measure the downside trend. Usually, AroonUp is calculated using the Highs and AroonDown is calculated using the Lows, but you can also only use the close prices to calculate them.

To calculate the AroonUp value you need to know 2 things:

  1. The lookback period
  2. The period since the highest high was made

Let us say that you have chosen a 14-period lookback, then we need to check for the highest high/close in the last 14 periods.

 

Quant

Let us say that the highest high occurred at the 4th latest candle. Then AroonUp is calculated as below:

AroonUp = (Lookback – (Periods Since Highest High))/(Lookback)

Therefore, AroonUp = (14- 4)/14

ie. AroonUp = 0.7142

As you must have noticed, the Aroon Indicator is a percentage value. It simply represents how recent are the highest high/ lowest low in the past ‘X’ Periods. The AroonUp value calculated above is multiplied 100 to represent it in a percentage format.

AroonUp = 0.7142*100

ie. AroonUp = 71.42

Similarly, the AroonDown is calculated using the lowest low in the past X periods.

 

Quant

 

The two Aroon indicators are subtracted to calculate the Aroon oscillator.

AroonOscillator = AroonUp – AroonDown

Although the Aroon oscillator is a simple way of representing both the indicators. Let us understand how to interpret these indicators in detail.

Interpretation of Aroon Indicator

Markets are said to be trending up when the AroonUp value is more than the AroonDown value.

But this crossover of Aroon indicators is not considered a strong signal, instead, it is seen as the beginning of the trend. The confirmation of up trend happens only when the AroonUp value goes above 50.

Quant

In the above figure, the green Aroon line represents the AroonUp value which is above the red line or AroonDown line, whenever the market was trending up.

You can also interpret this using an Aroon oscillator, if the Aroon oscillator is above zero it signals an Uptrend and if it is above 100 you consider it as a confirmation of Uptrend and if it is below -100 then we can confirm it as a downtrend.

 

Quant

Aroon indicators can also be used to identify the range bound market. Whenever the AroonUp and AroonDown indicators are parallel or when the Aroon oscillator is flat, it indicates a range bound market. If you are an intraday scalper then this flat range is ideal for your trading.

Like all technical indicators, Aroon is also a lagging indicator. So, it is susceptible to sudden spikes. To protect against such volatility, the traders should have efficient exit criterion in place.

We have successfully applied the Aroon indicator combined with RSI to generate trading signals in our course on Cryptocurrency trading.

 

 

Disclaimer: All investments and trading in the stock market involve risk. Any decisions to place trades in the financial markets, including trading in stock or options or other financial instruments is a personal decision that should only be made after thorough research, including a personal risk and financial assessment and the engagement of professional assistance to the extent you believe necessary. The trading strategies or related information mentioned in this article is for informational purposes only.

*These financial products are not suitable for all investors and customers should read the relevant risk warnings before investing. You should be aware that your losses may exceed the value of your original investment.
TRADING IN BITCOIN FUTURES IS ESPECIALLY RISKY AND IS ONLY FOR CLIENTS WITH A HIGH RISK TOLERANCE AND THE FINANCIAL ABILITY TO SUSTAIN LOSSES.
More information about the risk of trading Bitcoin products can be found on the IB website.

 

If you want to learn more about  quant methods in trading strategies, or to download the code in this article, visit QuantInsti website and the educational offerings at their Executive Programme in Algorithmic Trading (EPAT™).

This article is from QuantInsti and is being posted with QuantInsti’s permission. The views expressed in this article are solely those of the author and/or QuantInsti and IB is not endorsing or recommending any investment or trading discussed in the article. This material is for information only and is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad-based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation by IB to buy, sell or hold such security. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.


20855




Quant

The Beautiful Binomial Logistic Regression


By: Uday Keith, Byte Academy

The Logistic Regression is an important classification model to understand in all its complexity. There are a few reasons to consider it:

  1. It is faster to train than some other classification algorithms like Support Vector Machines and Random Forests.
  2. Since it is a parametric model, one can infer causal relationships between the response and explanatory variables.
  3. Since it can be viewed as a single layer neural network, it is useful to understand and gain a deeper understanding of Neural Networks.

This article seeks to clearly explain the Binomial Logistic Regression, the model used in a binary classification setting.

The Logistic Regression has been around for a long, long time and while it is not going to single-handedly win any kaggle competitions, it is still widely used in the analytics industry. So, what can be a useful point of departure to understand the Logistic Regression intuitively? I actually like to begin with the Naive Bayes model and assume a binary classification setting. In Naive Bayes, we are trying to compute the posterior probability, or in simple terms, the probability of observing that our response variable (Y) is categorized as 1, given some specific values for our variables. The solution to the problem is expressed as:

 

 

Byte Academy

 

The goal of the Binomial Logistic Regression (Logistic Regression or LR for the remainder of this article) is exactly the same, to compute the posterior probability. However, in LR we will compute this probability directly.

The response variables (Y) follows a Binomial distribution (a special case of the Bernoulli distribution) and the probability of observing a certain value of Y (0 or 1) is:

Byte Academy

Note that if yi =1 we obtain πi, and if yi =0 we obtain 1−πi. Now, we would like to have the probabilities πi depend on a vector of observed covariates xi. The simplest idea would be to let πi be a linear function of the covariates, say πi = x′iβ.

One problem with this model is that the probability πi on the left-hand- side has to be between zero and one, but the linear predictor x′iβ on the right-hand-side can take any real value, so there is no guarantee that the predicted values will be in the correct range unless complex restrictions are imposed on the coefficients.

A simple solution to this problem is to transform the probability to remove the range restrictions and model the transformation as a linear function of the covariates. Essentially what we are saying is that we want to map the output of our covariates (not necessarily including the intercept) to a continuous range which corresponds to {0-1}. We use the odds ratio to do this.

The odds ratio gives the probability of an event occurring (πi) over

 

Byte Academy

At this point it is useful to express  πi , the probability of Y as a conditional probability of P(Y|X). If we were to solve for P(Y|X) we would arrive at the following expression:

Byte Academy

Now our posterior probability has been mapped to our covariates and the form of this function is called the sigmoid curve. Here is a visual representation.

Byte Academy

As you can see, the outputs are constrained between the range (0, 1).

Now, what we seek to do is maximize the predicted probabilities as expressed above. Specifically, we will want to maximize P(Y=0|X) when we actually observe Y=0 AND maximize P(Y=1|X) when we observe a 1. Let us call this our objective function L(β). If we were to take the negative log of this expression we would arrive at

 

Byte Academy

 

If we were to plot the two Cost equations above we would see:

 

Byte Academy

 

Since we have taken the negative log likelihood, we are now minimizing our loss function as opposed to maximizing it.

To fit (find the optimum coefficients) for our model we would take the derivative of the loss function with respect to β we would arrive at:

 

Byte Academy

 

The term P here is our predicted probability P(Y|X).

 

Unfortunately, our loss function does not have a closed-form solution and we must arrive at our minimum via stochastic gradient descent. We already have the expression above that tells us now sensitive our Loss/error function is to a small change in β. So now we can plug that expression into the standard gradient update rule.

 

Byte Academy

 

Voila! Now we have everything we want. Let’s put it all together in Python now.

 

Byte Academy

 

 

Byte Academy is based in New York, USA. It offers coding education, classes in FinTech, Blockchain, DataSci, Python + Quant. If you are interested in learning Python, visit their Full Stack Python.

This article is from Byte Academy and is being posted with Byte Academy’s permission. The views expressed in this article are solely those of the author and/or Byte Academy and IB is not endorsing or recommending any investment or trading discussed in the article. This material is for information only and is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad-based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation by IB to buy, sell or hold such security. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.


20854




1 2 3 4 5 2 35

Disclosures

We appreciate your feedback. If you have any questions or comments about IBKR Quant Blog please contact ibkrquant@ibkr.com.

The material (including articles and commentary) provided on IBKR Quant Blog is offered for informational purposes only. The posted material is NOT a recommendation by Interactive Brokers (IB) that you or your clients should contract for the services of or invest with any of the independent advisors or hedge funds or others who may post on IBKR Quant Blog or invest with any advisors or hedge funds. The advisors, hedge funds and other analysts who may post on IBKR Quant Blog are independent of IB and IB does not make any representations or warranties concerning the past or future performance of these advisors, hedge funds and others or the accuracy of the information they provide. Interactive Brokers does not conduct a "suitability review" to make sure the trading of any advisor or hedge fund or other party is suitable for you.

Securities or other financial instruments mentioned in the material posted are not suitable for all investors. The material posted does not take into account your particular investment objectives, financial situations or needs and is not intended as a recommendation to you of any particular securities, financial instruments or strategies. Before making any investment or trade, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice. Past performance is no guarantee of future results.

Any information provided by third parties has been obtained from sources believed to be reliable and accurate; however, IB does not warrant its accuracy and assumes no responsibility for any errors or omissions.

Any information posted by employees of IB or an affiliated company is based upon information that is believed to be reliable. However, neither IB nor its affiliates warrant its completeness, accuracy or adequacy. IB does not make any representations or warranties concerning the past or future performance of any financial instrument. By posting material on IB Quant Blog, IB is not representing that any particular financial instrument or trading strategy is appropriate for you.