## Vote for PortfolioEffect

PortfolioEffect has been selected for paticipating at the Benzinga Fintech Awards.

Vote for us here:

PorfolioEffect Vote

## Webinar: Alpha Generation

### Alpha Generation

Asset returns based on low frequency prices (e.g. end-of-day quotes) are still dominating modern portfolio analysis. To make portfolio metrics more relevant intraday and improve the precision of estimates, new data frequency needs to be explored.

In this presentation we demonstrate how using high frequency market data for portfolio risk management and optimization could improve the classic variance-bias trade-off and bring new insights to strategy backtesting.

Since high frequency prices require special handling, we discuss key components of an automatic model pipeline for microstructure noise, price jumps, outliers, fat tails and long-memory.

We conclude our presentation with an introduction to high frequency portfolio optimization built on top of intraday portfolio metrics. Examples will be shown in Python.

PortfolioEffect service offers portfolio optimization, portfolio backtesting, metrics forecasting and intraday risk metrics through 4 APIs: Python, R, Matlab and Java. The uniqueness of our service is that all calculation are done using high frequency market data which benefits low and high frequency traders. We cover 8,000+ US Equities (stocks, indices, ETFs). Clients can also upload their own market data. PortfolioEffect service employs latest advances in high frequency market microstructure theory to make classic portfolio risk and optimization results available intraday at tick-level resolution. It uses automated model pipeline to process high frequency price returns in a streaming fashion.

### Who should attend?

This webinar will be very beneficial for those who need intraday risk metrics at any frequency, portfolio optimization, portfolio backtesting and metrics forecasting. Example will be shown in Python. The session will be ideal for:

• Researchers
• Quant Analysts
• Traders on Equities, ETF and Indices
• Those who are looking for backtesting strategies
• Python coders interested in financial markets

## Strategy: Selecting the Best End of Day Sharpe Ratio

At PortfolioE ffect, we use high frequency market data to calculate intraday or end of
day risk metrics. This involves a new methodology for the calculation of risk that was
developed through 5 years of research. The results benefi ts low and high frequency
traders and researchers. We off er risk metrics data on volatility and risk factors for
8,000+ fi nancial instruments, including stocks, stock indices and ETFs. Our end of day
risk metrics data are available on Quandl: Vol & Risk FactorsRisk & Performance Metrics.

To illustrate the potential utility of our data, we have built a sample algorithm that uses
it. Using the end of day Sharpe ratio calculated by PortfolioEff ect, we compare the end
of day Sharpe ratio for the last day to the Sharpe ratio for a 1 week window length on 10
stocks: ‘IBM’,’GOOG’,’C’,’F’,’GM’,’GE’,’AAPL’,’AMZN’,’CSCO’,’GS’ since 01/04/2013.
By 1 week window length, it means the window length for calculating the metric is 1
week. Weekly Sharpe ratio is calculated on 5 days windows length. Therefore, we look
at the Sharpe ratio of the daily vs weekly rate. If the daily Sharpe ratio is greater than
the weekly Sharpe ratio, we take a long position, otherwise a short one. At each step of
the algo, we buy and sell. For example, we have 8 shares to buy and 2 shares to sale, we
buy each share with a quantity of 150% / 8 = 18.75% and sell up to 50% / 2 = 25% of
the portfolio. We are creating a changing portfolio containing long and short positions
at any given time.

In summary, we buy stocks with good Sharpe ratio through the sale of shares with
poor Sharpe ratio. Take a look at the attached backtest.

For more info on our end of day risk datasets, see attached description.

portfolioeffect_risk_and_performance_metrics

portfolioeffect_volatility_and_risk_factors

# Alpha Generation: Controlling Intraday Risk Profile with Python

Friday, February 10 2017, 10:30 AM – 5:30 PM [CST]

## Chicago, 10th of  Frebruary

You will learn why the use of high frequency market data is necessary to be able to measure correctly the risk and rebalance your portfolio adequately. You will also learn how to build strategies to generate alpha. You will study how to build your own portfolio, create a strategy, backtest it, optimize it, and use vol forecasting with PortfolioEffect hft Python package.

## Prerequisite

Beginner knowledge of Python and finance, college level math, laptop with Anaconda2 installed

## Aagenda

10:30 AM-11:00 AM   Welcome

11:00 AM-11:30 AM   Introduction to high frequency market data

11:30 AM-12:00 PM   Intraday risk metrics

12:00 PM-12:30 PM   Exercise-build intraday risk metrics on portfolio

12:30 PM-1:00 PM    Backtesting portfolio and build your own strategies

1:00 PM-1:30 PM     Lunch break

1:30 PM-2:00 PM     Exercise on backtesting

2:00 PM-2:30 PM     Vol forecasting

3:00 PM-3:30 PM     Exercise on vol forecasting

3:30 PM-4:00 PM     Portfolio optimization & Alpha generation

4:00 PM-5:00 PM     Exercise-build your own optimization for alpha generation

5:00 PM-5:30PM     Closing remarks

## Organizers

Andrey Kostin, PhD & Stephanie Toper
For any questions, email info@portfolioeffect.com

## Very interesting R and Python Workshops in NYC

During our 2 workshops, we covered how to compute intraday risk, backtest strategies, forecast metrics and optimize your portfolio to get more alpha. We went through classic moving average strategies to comparing high frequency strategies to low frequencies. Attendees from different background have been present from banks to hedge funds to academics. It gave a stimulating environment.

Next workshop is in Chicago February 10th. Use discount EARLY to get \$150 saving. Saving expire on January 10th.

Alpha Generation: Controlling Intraday Risk Profile with Python, Chicago, Feb 10th

## Intraday Strategy Backtesting, Portfolio Optimization and Risk Forecasting with R

Nov 17th, NYC

You will learn why the use of high frequency market data is necessary to be able to measure correctly the risk and rebalance your portfolio adequately. You will also study how to build your own portfolio, create a strategy, backtest it, optimize it, and use vol forecasting with PortfolioEffectHFT package available on CRAN.

#### Prerequisite:

Beginner knowledge of R and finance, college level math, laptop with RStudio installed

#### Agenda:

10:30 AM-11:00 AM    Welcome

11:00 AM-11:30 AM    Introduction to high frequency market data

11:30 AM-12:00 PM    Intraday risk metrics

12:00 PM-12:30 PM    Exercise-build intraday risk metrics on portfolio

12:30 PM-1:00 PM      Backtesting portfolio and build your own strategies

1:00 PM-1:30 PM         Lunch break

1:30 PM-2:00 PM         Exercise on backtesting

2:00 PM-2:30 PM         Vol forecasting

3:00 PM-3:30 PM         Exercise

3:30 PM-4:00 PM         Portfolio optimization

4:00 PM-5:00 PM         Exercise Built your own optimization

5:00 PM-5:30PM           Closing remarks

For a student discount, please email info@portfolioeffect.com

## Intraday Strategy Backtesting, Portfolio Optimization and Risk Forecasting with Python

Nov 16th, NYC

You will learn why the use of high frequency market data is necessary to be able to measure correctly the risk and rebalance your portfolio adequately. You will also study how to build your own portfolio, create a strategy, backtest it, optimize it, and use vol forecasting with PortfolioEffect hft package available on Anaconda.

#### Prerequisite:

Beginner knowledge of Python and finance, college level math, laptop with Anaconda2 installed

#### Agenda:

10:30 AM-11:00 AM    Welcome

11:00 AM-11:30 AM    Introduction to high frequency market data

11:30 AM-12:00 PM    Intraday risk metrics

12:00 PM-12:30 PM    Exercise-build intraday risk metrics on portfolio

12:30 PM-1:00 PM      Backtesting portfolio and build your own strategies

1:00 PM-1:30 PM         Lunch break

1:30 PM-2:00 PM         Exercise on backtesting

2:00 PM-2:30 PM         Vol forecasting

3:00 PM-3:30 PM         Exercise

3:30 PM-4:00 PM         Portfolio optimization

4:00 PM-5:00 PM         Exercise Built your own optimization

5:00 PM-5:30PM           Closing remarks

For a student discount, please email info@portfolioeffect.com

## New R/MATLAB Package Released: High Frequency Price Estimators & Models

We are happy to announce PortfolioEffectEstim toolbox availability for both R & MATLAB.
It is designed for high frequency market microstructure analysis and contains popular estimators for price variance, quarticity and noise.

### Features

Package features key estimators for working with high frequency market data.

Microstructure Noise:

• Autocovariance Noise Variance
• Realized Noise Variance
• Unbiased Realized Noise Variance
• Noise-to-Signal Ratio

Price Variance:

• Two Series Realized Variance
• Multiple Series Realized Variance
• Modulated Realized Variance
• Jump Robust Modulated Realized Variance
• Uncertainty Zones Realized Variance
• Kernel Realized Variance (Bartlett, Cubic, 5th/6th/7th/8th-order, Epanichnikov, Parzen, Tukey-Hanning kernels)

Price Quarticity:

• Realized Quarticity
• Realized Tri-power Quarticity
• Modulated Realized Quarticity

Use could provide your own high frequency market data or use our server-side high frequency prices for all major US equities.

### Client-side Market Data

To run an estimator using client-side data:

data(goog.data)
estimator<-estimator_create(priceData=goog.data)
rv.data = variance_tsrv(estimator)
util_plot2d(rv.data,title="Realized Variance of GOOG")

### Server-side Market Data

To run an estimator using server-side data:

estimator<-estimator_create(asset='GOOG',fromTime="2014-09-01", toTime="2014-09-14")
tsrv.data = variance_tsrv(estimator,K=2)
util_plot2d(tsrv.data,title="Two Series Realized Variance of GOOG")


More details in the package manual:
https://cran.r-project.org/web/packages/PortfolioEffectEstim/vignettes/PortfolioEffectEstim.pdf

# Market Microstructure Noise¶

Microstructure noise describes price deviation from its fundamental value induced by certain features of the market under consideration. Common sources of microstructure noise are:

• order arrival latency
• asymmetry of information
• discreteness of price changes

Noise makes high frequency estimates of some parameters (e.g. realized volatility) very unstable. The situation gets even worse for high order moments like kurtosis, which makes tail risk estimation using HF data very problematic. We will investigate how severe could be noise contamination for different stocks as the we move towards transactional frequencies.

## Intraday Strategy Backtesting in R – Part 2 (Rule-based Strategies)

In this post we take intraday backtesting with PortfolioEffectHFT package one step further by adding a simple signal-based rebalancing rule. Using this rule we will create two trading portfolios – a high frequency strategy portfolio and a low frequency portfolio and compare them with each other in terms of their intraday risk and performance.

Both strategies would employ a price moving average signal with a window of different calendar length to simulate position entry and exit with different holding period durations. Our trading portfolio would consist of a single GOOG position to keep matters simple.

First, we define a moving average method that receives a price vector and a window length for averaging.

# Create function of moving average
MA=function(x,order){
result=x
x1=c(0,x)
result[(order):NROW(x)]=(cumsum(x1)[-(1:(order))]-cumsum(x1)[-((NROW(x1)-order+1):NROW(x1))])/order
result[1:(order-1)]=cumsum(x[1:(order-1)])/(1:(order-1))
return(result-0.0000000001)
}


The high frequency trading strategy has a window length of 150 seconds, while the low frequency strategy uses 800 second window. When the stock price exceeds the N-second moving average, each strategy would buy 100 shares of the stock. If moving average goes above the current price while we are still in position, the strategy would issue a sell signal. Now that we defined our position holding rules, we can construct our trading portfolio for further analysis.