IBKR Quant Blog


1 2 3 4 5 2 40


Quant

qplum - How is Artificial Intelligence/Deep Learning disrupting trading? And why now?


Webinar Recording

In case you missed it! Watch it on IBKR’s YouTube Channel:

 

https://youtu.be/3YLO8NvLY2s

 

Deep Learning

 

Deep learning has been very successful in social sciences and especially in areas where there is a lot of data. Trading and investment management is also considered a social science and not a pure science, and we are generating petabytes of data every day. With the advent of Deep Learning and Big Data technologies for efficient computation, we are finally able to use the same methods in investment management as we would in face recognition or making chat-bots. This focus on learning a hierarchical set of concepts is truly making investing a scientific process. Sponsored by qplum
 

Speaker:    Gaurav Chakravorty, Principal, qplum

Sponsored by:     https://www.qplum.co/

 

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.


21525




Quant

Forward Propagation In Neural Networks - Part I


By Varun Divakar

 

Quant

 

In this blog, we will intuitively understand how a neural network functions and the math behind it with the help of an example. In this example, we will be using a 3-layer network (with 2 input units, 2 hidden layer units, and 2 output units). The network and parameters (or weights) can be represented as follows.

Quant

Let us say that we want to train this neural network to predict whether the market will go up or down. For this, we assign two classes Class 0 and Class 1. Here, Class 0 indicates the datapoint where the market closes down, and conversely, Class 1 indicates that the market closes up. To make this prediction, a train data(X) consisting of two features x1, and x2. Here x1 represents the correlation between the close prices and the 10- day simple moving average (SMA) of close prices, and x2 refers to the difference between the close price and the 10-day SMA.

In this example below, the datapoint belongs to the class 1. The mathematical representation of the input data is as follows:

 

X = [x1, x2] = [0.85,.25] y= [1]

 

Example with two data points:

Quant

Quant

The output of the model is categorical or a discrete number. We need to convert this output data also into a matrix form. This enables the model to predict the probability of a datapoint belonging to different classes. When we make this matrix conversion, the columns represent the classes to which that example belongs, and the rows represent each of the input examples.

Quant

In the matrix y, the first column represents class 0 and second column represents class 1. Since our example belongs to the Class 1, we have 1 in the second column, and zero in the first.

Quant

This process of converting discrete/categorical classes to logical vectors/ matrix is called One Hot Encoding. We use one hot encoding as the neural network cannot operate on label data directly. They require all input variables and output variables to be numeric.

In a neural network, apart from the input variable we add a bias term to every layer other than the output layer. This bias term is a constant, mostly initialized to 1. The bias enables moving the activation threshold along the x-axis.

 

Quant

Quant

 

When the bias is negative the movement is made to the right side, and when the bias is positive the movement is made to the left side. So a biased neuron should be capable of learning even such input vectors that an unbiased neuron is not able to learn. In the dataset X, to introduce this bias we add a new column denoted by ones, as shown below.

 

Quant

Let us visualize the neural network, with the bias included in the input layer.

Quant

 

 

The second layer in the neural network is the hidden layer, which takes the outputs of the first layer as its input. The third layer is the output layer which gives the output of the neural network.

In the next post Varun will show us how to randomly initialize the weights or parameters for each of the neurons in the first layer.

 

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.


21523




Quant

Join IBKR for a Free Webinar with Sentieo: Optimize Your Research Process: Fight data overload and get the info you want - fast


Monday, December 10, 2018 12:00 EST

Register

 

Are you spending too much time searching for data in external and internal documents? In this webinar, we’ll show you how to cut your research time in half — from idea generation through idea/ company/ portfolio management. We’ll use the Sentieo research platform to show you how to:

  • review documents quickly
  • track an idea
  • build models
  • compile findings into an investment thesis
  • manage various theses

 

Sponsored by Sentieo

 

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


21430




Quant

Too Much Arbitrage Contributes to Overreaction in Post Earnings Announcement Drift


A new financial research paper has been published and is related to all equity long short strategies but mainly to:
#33 - Post-Earnings Announcement Effect

Authors: Xiao Li

Title: Does Too Much Arbitrage Destablize Stock Price? Evidence from Short Selling and Post Earnings Announcement Drift.

Link: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3249254

Abstract:

Stein (2009) suggests that too much arbitrage capital exploiting underreaction can lead to overreaction, pushing price further away from fundamental value. I test this hypothesis by investigating the relation between changes in short interest ratio around earning announcement and the subsequent drift return. There are two main findings in this paper. First, my results suggest that too much arbitrage capital does contribute to overreaction (with a t-statistics around 4 on average). These findings are robust to alternative sample periods or length of the window for drift calculation. Second, contrary to the findings in prior literature that show that short sellers mitigate the magnitude of drift, my results show that almost all of this effect are actually contributed by the observations that are more likely to represent overreaction.

 

Quantpedia

 

To learn more about this paper, view the full article on Quantpedia website:
https://www.quantpedia.com/Blog/Details/too-much-arbitrage-contributes-to-overreaction-in-post-earnings-announcement-dr

About Quantpedia

Quantpedia Mission is to process financial academic research into a more user-friendly form to help anyone who seeks new quantitative trading strategy ideas. Quantpedia team consists of members with strong financial and mathematical background (former quantitative portfolio managers and founders of Quantconferences.com) combined with members with outstanding IT and technical knowledge. Learn more about Quantpedia here: https://quantpedia.com

This article is from Quantpedia and is being posted with Quantpedia’s permission. The views expressed in this article are solely those of the author and/or Quantpedia 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.


21429




Quant

The Hurst Exponent


By Varun Divakar and Ashish Garg

Quant

 

In this blog, we will be discussing an important concept in time series analysis: The Hurst exponent. We will learn how to calculate it with the help of an example. First, let us understand what Hurst exponent is.

Hurst Exponent Definition
The Hurst exponent is used as a measure of long-term memory of time series. It relates to the autocorrelations of the time series and the rate at which these decrease as the lag between pairs of values increases.

Hurst Value

Hurst Value is more than 0.5
If the Hurst value is more than 0.5 then it would indicate a persistent time series (roughly translates to a trending market).
Hurst Value is less than 0.5
If the Hurst Value is less than 0.5 then it can be considered as an anti-persistent time series (roughly translates to sideways market).
Hurst Value is 0.5
If the Hurst value is 0.5 then it would indicate a random walk or a market where prediction of future based on past data is not possible.

How To Calculate The Hurst Exponent
To calculate the Exponent, we need to divide the data into different chunks. For example, if you have the return data of BTC/USD for the past 8 days’ data, then you divide it into halves as follows:
Following the example of 8 observations for illustrative purposes only1:
Quant

1Length of the subseries in practical applications is usually much longer and affects the mean and standard deviation of the R/S statistic.

Then we divide the data into 3 different chinks as follows:

  1. Division 1 – one chunk of 8 observations
  2. Division 2 – two chunks of 4 observations each
  3. Division 3 – four chunks of 2 observations each

Quant

After dividing the data into chunks, we perform the following calculations on each chunk:

1. First we calculate the mean of the chunk, with say n observations,

.M = (1/n) [ h(1)+h(2)+...+h(n) ]

Quant

2. Then we calculate the standard deviation (S) of the n observations

s(n) = STD( h(1)+h(2)+...+h(n))

Quant

3. Then we create a mean centered series by subtracting the mean from the observations,

x(1) = h(1) – M
x(2) = h(2) – M
...
x(n) = h(n) - M

Quant

Then we calculate the cumulative deviation by summing up the mean centered values,

Y(1) = x(1)
Y(2) = x(1) + x(2)
...
Y(n) = x(1) + x(2) + ...+ x(n)

5. Next, we calculate the Range (R), which is the difference between the maximum value of the cumulative deviation and the minimum value of the cumulative deviation,

R(n) = MAX[Y(1),Y(2)...Y(n)] - MIN[Y(1),Y(2)...Y(n)]

6. And finally, we compute the ratio of the range R to the standard deviation S. This also known as the rescaled range.

Quant

Once we have the rescaled range for all the chunks, we compute the mean of each Division and note it along with the number of samples in each chunk of that Division as shown.

Quant

Quant

Next, we calculate the logarithmic values for the size of each region and for each region’s rescaled range.

Quant

The Hurst exponent ‘H’ is nothing but the slope of the plot of each range’s log(R/S) versus each range’s log(size). Here log(R/S) is the dependent or the y variable and log(size) is the independent or the x variable:

Quant

This Hurst exponent value is indicating that our data is a persistent one, but we have to keep in mind that our data set is too small to draw such a conclusion. For example, if you want to calculate Hurst exponent in Python using the ‘hurst’ library, it requires you to give at least 100 data points.

 

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.

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.


21428




1 2 3 4 5 2 40

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.