Advertisement

Concept of Stationarity | Time Series Analysis for Financial Data | Mean Reversion

Concept of Stationarity | Time Series Analysis for Financial Data | Mean Reversion Start for Free:

Timestamp:
00:06 - 00:40 - Concept of stationarity
00:40 - 01:40 - Example of non-stationary series

Welcome, to this video lecture. In this, you will learn about stationarity. The concept of stationarity is the foundation upon which pairs trading and other cointegrated trading is built. The stock market data is usually referred to as time-series data, that is, a discrete data type which is indexed in time. E.g, daily OHLC data is time-series data indexed at every trading day in a year. A time series is called ‘stationary’ if its standard deviation from the mean doesn’t increase too fast with time. The time series stays around the mean. A random walk is not a stationary series.

For example, the price of gold ETF (GLD) is a geometric random walk and is not stationary. Another example of a non-stationary series is the gold miners ETF (GDX). Let’s look at a spread between GLD and 1.63 * GDX. The standard deviation of this spread doesn’t vary with time and hence the spread is stationary.
The stationarity concept is somewhat of a misnomer: It doesn’t mean that the prices necessarily range bound but it merely means that the variance increases slower than normal diffusion. If the price or market value of an instrument is stationary, we can profit easily by a simple mean-reverting strategy: buy low and sell high. Alas, most instruments' prices are not stationary.
A possible exception is AUD, CAD. We will learn in the next unit a statistical technique to determine if price series is stationary or not but visually the price series seems to be stationary. Stationarity applies only to the long-term properties of a time series. A price series can show short-term mean-reverting behavior without being stationary. For example, in between earnings announcements stock might fluctuate around an equilibrium level. This is known as seasonal or temporary mean reversion.

In the next unit, we will use augmented Dickey-Fuller to test for stationarity. Then the difference between the two is $230. Since 230 is greater than zero, the factor model would buy the stock. The momentum factor works by buying stocks that have a positive difference and selling stocks that have a negative difference.
The assumption for this factor model is that the existing momentum will continue. So you go with the current trend in the market. In the next video, you will learn how to create a short-term reversal factor and then combine these two factors to create a multi-factor model.

In the upcoming units, your concepts will be tested through a couple of multiple-choice questions after which there will be an IPython notebook to implement the cross-validation technique. is created by taking the average of 2 data points in the ‘close’ column. Now if we split the data into two parts, where the first 10 data points belong to the train data, and the last 4 belong to the simulation data. Then in the column of ‘2 period rolling mean‘ of simulation data, the value in row 11 is obtained by taking the average of close values in rows 10 and 11 as shown here. Usage of train data points to compute the features in the simulation data results in what we call the data leakage. The best way to avoid this data leakage is to create the features and target datasets separately for the train and the simulation data as shown here.

You can also run a demo of the machine learning model in the Interactive Brokers TWS environment by using the IBridgepy library. Please read “A Short Guide on Automated Execution” provided in the next section to install the TWS and IBridgepy. We have also provided the sample code to paper trade or live trade the decision tree model strategy on Interactive Brokers’ TWS. To access this sample code, go to the last unit of the Downloadable Code section, download the Downloadables_DT.zip file and then copy the file sample_DT_deploy_strategy.py' in the IBridgePy strategies folder and run it. In this section, you learned about the various challenges that you can face while using a machine learning model in live trading. You understood how to save and retrieve a model, how to update the data, and how to retain a model based on its performance.
In the end, you learned how to perform a trading simulation to test the model’s performance. With this, you are all set to deploy your own models and face these challenges in live trading. In the Ipython notebook following this video, you can go through the simulation code in detail. Good Luck.

Quantra is an online education portal that specializes in Algorithmic and Quantitative trading. Quantra offers various bite-sized, self-paced and interactive courses that are perfect for busy professionals, seeking implementable knowledge in this domain.

Find more info on -
Like us on Facebook:
Follow us on Twitter:

day trading,day trading stocks,daytrading,intraday,intra-day,intraday trading,online stock trading software,online trading,stock exchange,stock market,stock market chart,stock market for beginners,stock market live,stock trading,technicalanalysis,trading,trading account,trading charts,day trading strategies,technical analysis,mean reversion,quantra,quantinsti,python for trading,python backtesting,back testing,Stationarity,

Post a Comment

0 Comments