Risk Platform

High frequency portfolio backtesting and optimization
PortfolioEffect Service
Product Datasheet (.pdf)
  • API for R, MATLAB, Python, Java
  • Intraday portfolio backtesting
  • Intraday portfolio optimization
  • Market microstructure analysis
  • Historical prices since 2013
  • 8,000+ symbols (stocks, ETFs & indices)
  • Client-side market data
  • 40+ portfolio & position metrics

Intraday Backtesting

PortfolioEffect service provides cloud-based microstructure-aware backtesting for both high and low frequency trading strategies.

With APIs for R, MATLAB, Python, Java, PortfolioEffect service features auto-calibrating model pipeline for market microstructure noise, risk factors, price jumps/outliers, tail risk (high-order moments) and price fractality (long memory). Portfolios could be constructed with client-side market data or using our intraday prices database for US equities.

Tutorials Manuals

Tutorials
Code Snippets
1. Create Portfolio
Create buy-and-hold portfolio of Google and Apple using server-side market data.
# create empty portfolio
portfolio=portfolio_create(fromTime="2014-10-01", 
          toTime="2014-10-02")

# add GOOG and AAPL positions
portfolio_addPosition(portfolio,"AAPL",100)
portfolio_addPosition(portfolio,"GOOG",200)
portfolio_addPosition(portfolio,"C",100)

# display summary table and chart
print(portfolio)
plot(portfolio)
Output in RStudio
Portfolio Summary
% create empty portfolio
portfolio=portfolio_create('fromTime','2014-10-01',...
          'toTime','2014-10-02');

% add GOOG and AAPL positions
portfolio_addPosition(portfolio,'AAPL',100);
portfolio_addPosition(portfolio,'GOOG',200);
portfolio_addPosition(portfolio,'C',100);

% display summary table and chart
display(portfolio);
plot(portfolio);
Output in Matlab
Portfolio Summary
2. Compute Sharpe Ratio
Compute position and portfolio-level intraday Sharpe Ratio on a daily time scale (default settings).
# position-level Sharpe ratio
aapl.ratio = position_sharpeRatio(portfolio,"AAPL")
goog.ratio = position_sharpeRatio(portfolio,"GOOG")
c.ratio = position_sharpeRatio(portfolio,"C")
portf.ratio = portfolio_sharpeRatio(portfolio)

# plot metrics
util_plot2d(aapl.ratio,title="Sharpe Ratio, daily",
         legend="AAPL")+
util_line2d(goog.ratio,legend="GOOG")+
util_line2d(c.ratio,legend="C")+
util_line2d(port.ratio,legend="Portfolio")
Output in RStudio
Portfolio Sharpe Ratio
% position-level Sharpe ratio
aapl.ratio = position_sharpeRatio(portfolio,'AAPL');
goog.ratio = position_sharpeRatio(portfolio,'GOOG');
c.ratio = position_sharpeRatio(portfolio,'C');
portf.ratio = portfolio_sharpeRatio(portfolio);

% plot metrics
util_plot2d(aapl.ratio,'AAPL','Title',...
      'Sharpe Ratio, daily')+...
util_line2d(goog.ratio,'GOOG')+...
util_line2d(c.ratio,'C')+...
util_line2d(portf.ratio,'Portfolio')
Output in Matlab
Portfolio Sharpe Ratio

Intraday Optimization

PortfolioEffect's optimization module performs microstructure-aware multi-constraint global portfolio optimization. Optimization results are available for a broad range of data frequencies including tick-by-tick resolution.

With APIs for R, MATLAB, Python, Java, PortfolioEffect service features auto-calibrating model pipeline for market microstructure noise, risk factors, price jumps/outliers, tail risk (high-order moments) and price fractality (long memory). Portfolios could be constructed with client-side market data or using our intraday prices database for US equities.

Tutorials Manuals

Tutorials
Code Snippets
1. Create Portfolio
Create buy-and-hold portfolio of Google and Apple using server-side market data.
# create empty portfolio
portfolio=portfolio_create(fromTime="2014-10-01", 
         toTime="2014-10-02")

# add GOOG and AAPL positions
portfolio_addPosition(portfolio,"AAPL",100)
portfolio_addPosition(portfolio,"GOOG",200)
portfolio_addPosition(portfolio,"C",100)

# display summary table and chart
print(portfolio)
plot(portfolio)
Output in RStudio
Portfolio Summary
% create empty portfolio
portfolio=portfolio_create('fromTime','2014-10-01',...
          'toTime','2014-10-02');

% add GOOG and AAPL positions
portfolio_addPosition(portfolio,'AAPL',100);
portfolio_addPosition(portfolio,'GOOG',200);
portfolio_addPosition(portfolio,'C',100);

% display summary table and chart
display(portfolio);
plot(portfolio);
Output in Matlab
Portfolio Summary
2. Run Optimization
Compute position and portfolio-level intraday Sharpe Ratio on a daily time scale (default settings).
# set goals, constraints an perform optimization
opt=optimization_goal(portfolio,10^9,
         "Variance","minimize")
opt=optimization_constraint_expectedReturn(opt,">=",0)

opt.portfolio=optimization_run(opt)

# compare expected return of both portfolios
util_plot2d(portfolio_expectedReturn(portfolio), 
        "Exp. Return, daily", legend="Original Portfolio")+
util_line2d(portfolio_expectedReturn(opt.portfolio),
         Legend="Optimal Portfolio")
                          
Output in RStudio
Optimal vs Original Portfolio - Expected Return
% set goals, constraints an perform optimization                
opt=optimization_goal(portfolio,10^9,...
        'Variance','minimize');
opt=optimization_constraint_expectedReturn(opt,'>=',0);

opt.portfolio=optimization_run(opt);

% compare expected return of both portfolios
util_plot2d(portfolio_expectedReturn(portfolio),...
        'Original Portfolio','Title','Exp. Return, daily')+...
util_line2d(portfolio_expectedReturn(opt.portfolio),...
        'Optimal Portfolio')
Output in Matlab
Optimal vs Original Portfolio - Expected Return