SlideShare uma empresa Scribd logo
1 de 25
Lujiazui Hedge Fund Inc.
Ryota Arafuka
Kuang-Po Lee
Krunal Naik
Jiaqi Wang
Jianhua Yen
Investment Portfolio Diversification
• Asset allocation diversification
 Horizontal diversification
 Vertical diversification
• Geographic diversification
Hedge Fund Investment Portfolio
Source: “Global Survey Hedge Fund and Investor Survey 2012” by Ernst & Young
Our Investment Style
• Relative value
 Fixed income arbitrage
 Convertible arbitrage
 Equity market neutral
 Event driven
• Directional
 Equity long/short
 Macro
 CTA
Our Objectives
Equal Contribution to
•Weight
- Gives the portfolio diversification
•Variance
- Allocates portfolio variance equally across the
portfolio components
•Risk
- Directly diversify downside risk among
components by using ETL contribution
Random Portfolio
• Random permutations of weights
• Selected criteria
• High frequency long/short
• Multi-strategy
• Model should be self sustained with decisions confined
by set of constraints
• Assign probabilities to strategies corresponding to
calculated risks in given scenario
R Language for Random Portfolio
Application Example
• Total value : $10m
• No. of selected assets for RP=50
• Constraints
 Long-only
 50 to 60 names
 No asset may have more than 4% weight
 Industry spread : 10
 S&P 500, random portfolio, and previous portfolio will be
benchmark
 Duration considered 12 months
 Frequency 10
(Relatively low for us, but this is for testing model)
Cumulative Trading
Comparison of Value with S&P 500
Industries Port wt
Consumer
Discretionary 29.56
Consumer Staples 11.26
Energy 7.01
Financials 4.43
Health Care 11.61
Industrials 9.63
Information
Technology 10.57
Materials 11.42
Telecommunications
Services 0
Utilities 4.51
Total 100
Weight Distribution
Industries Port ret Bench ret
Consumer
Discretionary 7.33 1.36
Consumer Staples -1.13 4.98
Energy 31.2 30.52
Financials 8.41 7.96
Health Care 27.33 7.8
Industrials 17.3 22.47
Information
Technology 14.26 19.65
Materials 84.71 48.53
Telecommunications
Services 0 0
Utilities 3.92 5.96
Total 20.79 13.64
Cumulative Returns
Portfolio optimization Using R
Efficient Frontier
Efficient Frontier with Short-selling
Measure of Portfolio Performance:
•Annualized return
•Annualized standard deviation
•VAR and ES (Expected shortfall)
•Sharp ratio, Omega Ratio, Sortino Ratio
Implementation of R –
Using package PerformanceAnalytics
Code to Create Artificial Stocks
• # create the antithetic pair of stocks and publish it into the environment
• # generate sequence of dates
• times <- seq(as.POSIXct(strptime('2011-01-1 16:00:00', '%Y-%m-%d %H:%M:%S')),
• as.POSIXct(strptime('2011-12-1 16:00:00', '%Y-%m-%d %H:%M:%S')),
• by="1 months")
•
• # generate and store dummy price series = 200,100,200,100,200 ...
• prices.xts <- xts(rep(c(200,100),length(times)/2), order.by=as.POSIXct(times))
• stk <- 'STK1'
• colnames(prices.xts) <- paste(stk,'.Adjusted',sep="")
• assign(x=stk, value=prices.xts, envir=global.env )
•
• # generate and store dummy price series = 100,200,100,200,100 ...
• prices.xts <- xts(rep(c(100,200),length(times)/2), order.by=as.POSIXct(times))
• stk <- 'STK2'
• colnames(prices.xts) <- paste(stk,'.Adjusted',sep="")
• assign(x=stk, value=prices.xts, envir=global.env )
•
• # run the strategy and create a plot
• strategy(portfolio= c("STK1","STK2"),threshold=.9,doplot=TRUE,title="Artificial Portfolio Example")
Download Option Data from Yahoo Finance
• # Goal: download adjusted price data for selected security, convert to returns, and write to output file
•
• library(tseries)
•
• # Load security data from Yahoo! Finance
• prices1 <- get.hist.quote("SPY", quote="Adj", start="2005-12-25", retclass="zoo")
•
• prices1 <- na.locf(prices1) # Copy last traded price when NA
•
• # To make week end prices:
• nextfri.Date <- function(x) 7 * ceiling(as.numeric(x - 1)/7) + as.Date(1)
• weekly.prices <- aggregate(prices, nextfri.Date,tail,1)
•
• # To convert month end prices:
• monthly.prices <- aggregate(prices1, as.yearmon, tail, 1)
•
• # Convert weekly prices into weekly returns
• r.weekly <- diff(log(weekly.prices)) # convert prices to log returns
• r1.weekly <- exp(r.weekly)-1 # back to simple returns
•
• # Convert monthly prices into monthly returns
• r.monthly <- diff(log(monthly.prices)) # convert prices to log returns
• r1.monthly <- exp(r.monthly)-1 # back to simple returns
•
• # Write output data to csv file
• write.zoo(r1.weekly, file="weekly.csv",sep=",",col.names=c("Dates","Percent Return"))
• write.zoo(r1.monthly, file="monthly.csv",sep=",",col.names=c("Dates","Percent Return"))
Code to Generate Random Portfolio
require(PortfolioProbe)
rp100w05 <- random.portfolio(1e4, prices=sp5.close[1,],
gross=1e6, long.only=TRUE, port.size=100,
max.weight=.05)
Then the returns are computed:
sret.rp100w05 <- valuation(rp100w05, prices=sp5.close[c language="(1,1511),"][/c],
returns="simple") lret.rp100w05 <- valuation(rp100w05, prices=sp5.close[c
language="(1,1511),"][/c], returns="log")
R code for Adjusting Weight
> pp.bootsim
function (retmat, weight, times=252)
{ dlar <- retmat[sample(nrow(retmat), times,
replace=TRUE),]
pp.porteval(dlar, weight) }
R Code for Portfolio Optimization
R Code for Portfolio Evaluation
> pp.porteval
function (dlar, weight)
{
(exp(colSums(dlar[, names(weight)])) - 1) %*%
weight
}
Optimization with Truncated Straddle using R
Simulation Result for Portfolio 100

Mais conteúdo relacionado

Semelhante a Random Portfolio using R to create investment strategy for Hedge Fund

Performance analysis with R
Performance analysis with RPerformance analysis with R
Performance analysis with RJérémy Morvan
 
EvoFIN2015
EvoFIN2015EvoFIN2015
EvoFIN2015mausolos
 
Big Data Day LA 2016/ Data Science Track - Decision Making and Lambda Archite...
Big Data Day LA 2016/ Data Science Track - Decision Making and Lambda Archite...Big Data Day LA 2016/ Data Science Track - Decision Making and Lambda Archite...
Big Data Day LA 2016/ Data Science Track - Decision Making and Lambda Archite...Data Con LA
 
Predicting Stock Market Price Using Support Vector Regression
Predicting Stock Market Price Using Support Vector RegressionPredicting Stock Market Price Using Support Vector Regression
Predicting Stock Market Price Using Support Vector RegressionChittagong Independent University
 
How to valuate and determine standard essential patents
How to valuate and determine standard essential patentsHow to valuate and determine standard essential patents
How to valuate and determine standard essential patentsMIPLM
 
SQLBits Module 2 RStats Introduction to R and Statistics
SQLBits Module 2 RStats Introduction to R and StatisticsSQLBits Module 2 RStats Introduction to R and Statistics
SQLBits Module 2 RStats Introduction to R and StatisticsJen Stirrup
 
The Pill for Your Migration Hell
The Pill for Your Migration HellThe Pill for Your Migration Hell
The Pill for Your Migration HellDatabricks
 
Market basket analysis
Market basket analysisMarket basket analysis
Market basket analysisVermaAkash32
 
Performance evaluation of IR models
Performance evaluation of IR modelsPerformance evaluation of IR models
Performance evaluation of IR modelsNisha Arankandath
 
Stock-market-prediction.pptx
Stock-market-prediction.pptxStock-market-prediction.pptx
Stock-market-prediction.pptxrikritiKoirala1
 
Perfmeasure.ppt
Perfmeasure.pptPerfmeasure.ppt
Perfmeasure.pptMmdmmd4
 
Portfolio Selection with Artificial Neural Networks
Portfolio Selection with Artificial Neural NetworksPortfolio Selection with Artificial Neural Networks
Portfolio Selection with Artificial Neural NetworksAndrew Ashwood
 
capacity planning and Forecasting.pptx
capacity planning and Forecasting.pptxcapacity planning and Forecasting.pptx
capacity planning and Forecasting.pptxHiteshKumar874262
 
09 planning techniques
09 planning techniques09 planning techniques
09 planning techniquesAman Palway
 
2 b agile domains
2 b agile domains2 b agile domains
2 b agile domainsqtntpam
 
Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...
Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...
Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...Lucidworks
 
Where Should You Deliver Database Services From?
Where Should You Deliver Database Services From?Where Should You Deliver Database Services From?
Where Should You Deliver Database Services From?EDB
 
Relevance in the Wild - Daniel Gomez Vilanueva, Findwise
Relevance in the Wild - Daniel Gomez Vilanueva, FindwiseRelevance in the Wild - Daniel Gomez Vilanueva, Findwise
Relevance in the Wild - Daniel Gomez Vilanueva, FindwiseLucidworks
 

Semelhante a Random Portfolio using R to create investment strategy for Hedge Fund (20)

Performance analysis with R
Performance analysis with RPerformance analysis with R
Performance analysis with R
 
EvoFIN2015
EvoFIN2015EvoFIN2015
EvoFIN2015
 
Big Data Day LA 2016/ Data Science Track - Decision Making and Lambda Archite...
Big Data Day LA 2016/ Data Science Track - Decision Making and Lambda Archite...Big Data Day LA 2016/ Data Science Track - Decision Making and Lambda Archite...
Big Data Day LA 2016/ Data Science Track - Decision Making and Lambda Archite...
 
Predicting Stock Market Price Using Support Vector Regression
Predicting Stock Market Price Using Support Vector RegressionPredicting Stock Market Price Using Support Vector Regression
Predicting Stock Market Price Using Support Vector Regression
 
Pinecone Vector Database.pdf
Pinecone Vector Database.pdfPinecone Vector Database.pdf
Pinecone Vector Database.pdf
 
How to valuate and determine standard essential patents
How to valuate and determine standard essential patentsHow to valuate and determine standard essential patents
How to valuate and determine standard essential patents
 
SQLBits Module 2 RStats Introduction to R and Statistics
SQLBits Module 2 RStats Introduction to R and StatisticsSQLBits Module 2 RStats Introduction to R and Statistics
SQLBits Module 2 RStats Introduction to R and Statistics
 
The Pill for Your Migration Hell
The Pill for Your Migration HellThe Pill for Your Migration Hell
The Pill for Your Migration Hell
 
Market basket analysis
Market basket analysisMarket basket analysis
Market basket analysis
 
Performance evaluation of IR models
Performance evaluation of IR modelsPerformance evaluation of IR models
Performance evaluation of IR models
 
Stock-market-prediction.pptx
Stock-market-prediction.pptxStock-market-prediction.pptx
Stock-market-prediction.pptx
 
Perfmeasure.ppt
Perfmeasure.pptPerfmeasure.ppt
Perfmeasure.ppt
 
Portfolio Selection with Artificial Neural Networks
Portfolio Selection with Artificial Neural NetworksPortfolio Selection with Artificial Neural Networks
Portfolio Selection with Artificial Neural Networks
 
capacity planning and Forecasting.pptx
capacity planning and Forecasting.pptxcapacity planning and Forecasting.pptx
capacity planning and Forecasting.pptx
 
IISc Project Presentation
IISc Project PresentationIISc Project Presentation
IISc Project Presentation
 
09 planning techniques
09 planning techniques09 planning techniques
09 planning techniques
 
2 b agile domains
2 b agile domains2 b agile domains
2 b agile domains
 
Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...
Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...
Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...
 
Where Should You Deliver Database Services From?
Where Should You Deliver Database Services From?Where Should You Deliver Database Services From?
Where Should You Deliver Database Services From?
 
Relevance in the Wild - Daniel Gomez Vilanueva, Findwise
Relevance in the Wild - Daniel Gomez Vilanueva, FindwiseRelevance in the Wild - Daniel Gomez Vilanueva, Findwise
Relevance in the Wild - Daniel Gomez Vilanueva, Findwise
 

Mais de Krunal Naik, MBA, PMP, CSM

Mais de Krunal Naik, MBA, PMP, CSM (6)

Product development methods agile, scrum and lean startup
Product development methods  agile, scrum and lean startupProduct development methods  agile, scrum and lean startup
Product development methods agile, scrum and lean startup
 
Intro to pmi certifications 60216
Intro to pmi certifications 60216Intro to pmi certifications 60216
Intro to pmi certifications 60216
 
Recommendation
RecommendationRecommendation
Recommendation
 
Covered call strategy to invest $100,000 for short duration position
Covered call strategy to invest $100,000 for short duration positionCovered call strategy to invest $100,000 for short duration position
Covered call strategy to invest $100,000 for short duration position
 
Used Straddle for long volatility startegy on Netflix
Used Straddle for long volatility startegy on NetflixUsed Straddle for long volatility startegy on Netflix
Used Straddle for long volatility startegy on Netflix
 
CDS forecasting for EU countries to invest $10m
CDS forecasting for EU countries to invest $10mCDS forecasting for EU countries to invest $10m
CDS forecasting for EU countries to invest $10m
 

Último

Keppel Ltd. 1Q 2024 Business Update Presentation Slides
Keppel Ltd. 1Q 2024 Business Update  Presentation SlidesKeppel Ltd. 1Q 2024 Business Update  Presentation Slides
Keppel Ltd. 1Q 2024 Business Update Presentation SlidesKeppelCorporation
 
Islamabad Escorts | Call 03070433345 | Escort Service in Islamabad
Islamabad Escorts | Call 03070433345 | Escort Service in IslamabadIslamabad Escorts | Call 03070433345 | Escort Service in Islamabad
Islamabad Escorts | Call 03070433345 | Escort Service in IslamabadAyesha Khan
 
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...lizamodels9
 
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,noida100girls
 
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort ServiceCall US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Servicecallgirls2057
 
The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024christinemoorman
 
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis UsageNeil Kimberley
 
International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...ssuserf63bd7
 
Kenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby AfricaKenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby Africaictsugar
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCRashishs7044
 
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...lizamodels9
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Riya Pathan
 
8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCRashishs7044
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03DallasHaselhorst
 
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdfNewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdfKhaled Al Awadi
 
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607dollysharma2066
 
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu MenzaYouth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menzaictsugar
 
Buy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy Verified Accounts
 
Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Kirill Klimov
 
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...lizamodels9
 

Último (20)

Keppel Ltd. 1Q 2024 Business Update Presentation Slides
Keppel Ltd. 1Q 2024 Business Update  Presentation SlidesKeppel Ltd. 1Q 2024 Business Update  Presentation Slides
Keppel Ltd. 1Q 2024 Business Update Presentation Slides
 
Islamabad Escorts | Call 03070433345 | Escort Service in Islamabad
Islamabad Escorts | Call 03070433345 | Escort Service in IslamabadIslamabad Escorts | Call 03070433345 | Escort Service in Islamabad
Islamabad Escorts | Call 03070433345 | Escort Service in Islamabad
 
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
 
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
 
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort ServiceCall US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
 
The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024
 
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage
 
International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...
 
Kenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby AfricaKenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby Africa
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
 
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737
 
8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03
 
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdfNewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
 
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
 
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu MenzaYouth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
 
Buy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail Accounts
 
Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024
 
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
 

Random Portfolio using R to create investment strategy for Hedge Fund

  • 1. Lujiazui Hedge Fund Inc. Ryota Arafuka Kuang-Po Lee Krunal Naik Jiaqi Wang Jianhua Yen
  • 2. Investment Portfolio Diversification • Asset allocation diversification  Horizontal diversification  Vertical diversification • Geographic diversification
  • 3. Hedge Fund Investment Portfolio Source: “Global Survey Hedge Fund and Investor Survey 2012” by Ernst & Young
  • 4. Our Investment Style • Relative value  Fixed income arbitrage  Convertible arbitrage  Equity market neutral  Event driven • Directional  Equity long/short  Macro  CTA
  • 5. Our Objectives Equal Contribution to •Weight - Gives the portfolio diversification •Variance - Allocates portfolio variance equally across the portfolio components •Risk - Directly diversify downside risk among components by using ETL contribution
  • 6. Random Portfolio • Random permutations of weights • Selected criteria • High frequency long/short • Multi-strategy • Model should be self sustained with decisions confined by set of constraints • Assign probabilities to strategies corresponding to calculated risks in given scenario
  • 7. R Language for Random Portfolio
  • 8. Application Example • Total value : $10m • No. of selected assets for RP=50 • Constraints  Long-only  50 to 60 names  No asset may have more than 4% weight  Industry spread : 10  S&P 500, random portfolio, and previous portfolio will be benchmark  Duration considered 12 months  Frequency 10 (Relatively low for us, but this is for testing model)
  • 10. Comparison of Value with S&P 500
  • 11. Industries Port wt Consumer Discretionary 29.56 Consumer Staples 11.26 Energy 7.01 Financials 4.43 Health Care 11.61 Industrials 9.63 Information Technology 10.57 Materials 11.42 Telecommunications Services 0 Utilities 4.51 Total 100 Weight Distribution
  • 12. Industries Port ret Bench ret Consumer Discretionary 7.33 1.36 Consumer Staples -1.13 4.98 Energy 31.2 30.52 Financials 8.41 7.96 Health Care 27.33 7.8 Industrials 17.3 22.47 Information Technology 14.26 19.65 Materials 84.71 48.53 Telecommunications Services 0 0 Utilities 3.92 5.96 Total 20.79 13.64 Cumulative Returns
  • 15. Efficient Frontier with Short-selling
  • 16. Measure of Portfolio Performance: •Annualized return •Annualized standard deviation •VAR and ES (Expected shortfall) •Sharp ratio, Omega Ratio, Sortino Ratio Implementation of R – Using package PerformanceAnalytics
  • 17. Code to Create Artificial Stocks • # create the antithetic pair of stocks and publish it into the environment • # generate sequence of dates • times <- seq(as.POSIXct(strptime('2011-01-1 16:00:00', '%Y-%m-%d %H:%M:%S')), • as.POSIXct(strptime('2011-12-1 16:00:00', '%Y-%m-%d %H:%M:%S')), • by="1 months") • • # generate and store dummy price series = 200,100,200,100,200 ... • prices.xts <- xts(rep(c(200,100),length(times)/2), order.by=as.POSIXct(times)) • stk <- 'STK1' • colnames(prices.xts) <- paste(stk,'.Adjusted',sep="") • assign(x=stk, value=prices.xts, envir=global.env ) • • # generate and store dummy price series = 100,200,100,200,100 ... • prices.xts <- xts(rep(c(100,200),length(times)/2), order.by=as.POSIXct(times)) • stk <- 'STK2' • colnames(prices.xts) <- paste(stk,'.Adjusted',sep="") • assign(x=stk, value=prices.xts, envir=global.env ) • • # run the strategy and create a plot • strategy(portfolio= c("STK1","STK2"),threshold=.9,doplot=TRUE,title="Artificial Portfolio Example")
  • 18. Download Option Data from Yahoo Finance • # Goal: download adjusted price data for selected security, convert to returns, and write to output file • • library(tseries) • • # Load security data from Yahoo! Finance • prices1 <- get.hist.quote("SPY", quote="Adj", start="2005-12-25", retclass="zoo") • • prices1 <- na.locf(prices1) # Copy last traded price when NA • • # To make week end prices: • nextfri.Date <- function(x) 7 * ceiling(as.numeric(x - 1)/7) + as.Date(1) • weekly.prices <- aggregate(prices, nextfri.Date,tail,1) • • # To convert month end prices: • monthly.prices <- aggregate(prices1, as.yearmon, tail, 1) • • # Convert weekly prices into weekly returns • r.weekly <- diff(log(weekly.prices)) # convert prices to log returns • r1.weekly <- exp(r.weekly)-1 # back to simple returns • • # Convert monthly prices into monthly returns • r.monthly <- diff(log(monthly.prices)) # convert prices to log returns • r1.monthly <- exp(r.monthly)-1 # back to simple returns • • # Write output data to csv file • write.zoo(r1.weekly, file="weekly.csv",sep=",",col.names=c("Dates","Percent Return")) • write.zoo(r1.monthly, file="monthly.csv",sep=",",col.names=c("Dates","Percent Return"))
  • 19. Code to Generate Random Portfolio require(PortfolioProbe) rp100w05 <- random.portfolio(1e4, prices=sp5.close[1,], gross=1e6, long.only=TRUE, port.size=100, max.weight=.05) Then the returns are computed: sret.rp100w05 <- valuation(rp100w05, prices=sp5.close[c language="(1,1511),"][/c], returns="simple") lret.rp100w05 <- valuation(rp100w05, prices=sp5.close[c language="(1,1511),"][/c], returns="log")
  • 20. R code for Adjusting Weight > pp.bootsim function (retmat, weight, times=252) { dlar <- retmat[sample(nrow(retmat), times, replace=TRUE),] pp.porteval(dlar, weight) }
  • 21. R Code for Portfolio Optimization
  • 22. R Code for Portfolio Evaluation > pp.porteval function (dlar, weight) { (exp(colSums(dlar[, names(weight)])) - 1) %*% weight }
  • 23.
  • 24. Optimization with Truncated Straddle using R
  • 25. Simulation Result for Portfolio 100

Notas do Editor

  1. There are two methods of performance measurement in common use: benchmarks and peer groups. Using a benchmark requires a long time (as in decades) to get reasonable statistical power. Using peer groups looks superficially a lot like using random portfolios. Both use a single time period, both compare our fund of interest to a group of alternative portfolios. CVAR: Unlike Value-at-Risk (VaR), CVaR has all the properties a risk measure should have to be coherent and is a convex function of the portfolio weights