Home

PortfolioEffectHFT Package for R Software

image

Contents

1. util_plot2d variance_markowitz title Variance shortSalesMode legend markowitz util_line2d variance_lintner legend lintner 4 2 Data Sampling These settings regulate how results of portfolio computations are returned Depending on your usage scenario some of them might bring significantly imporvement to speed of your portfolio computations 4 2 1 Results Sampling Interval Interval to be used for sampling computed results before returning them to the caller Available interval values are e Xs seconds e Xm minutes e Xh hours e Xd trading days 6 5 hours in a trading day e Xw weeks 5 trading days in 1 week e Xmo month 21 trading day in 1 month e Xy years 256 trading days in 1 year e none no sampling e last only the very last data point is returned Large sampling interval would produce smaller vector of results and would require less time spent on data transfer Default value of 1s indicates that data is returned for every second during trading hours require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 01 16 00 00 portfolio_addPosition portfolio c C GO0G c 500 600 sample results every 30 seconds portfolio_settings portfolio resultsSamplingInterval 30s variance_30s portfolio_variance portfolio sample results every 5 minutes portfolio_settings po
2. 2014 09 30 09 30 00 2014 10 01 09 30 00 2014 10 01 15 30 00 20141050211 30200100 enable holdingPeriodsOnly portfolio_settings portfolio holdingPeriodsOnly TRUE variance_holdingPeriodsOnly_TRUE portfolio_variance portfolio disable holdingPeriodsOnly portfolio_settings portfolio holdingPeriodsOnly FALSE variance_holdingPeriodsOnly_FALSE portfolio_variance portfolio util_plot2d variance_holdingPeriodsOnly_TRUE title Variance holdingPeriodsOnly legend TRUE util_line2d variance_holdingPeriodsOnly_FALSE legend FALSE 4 1 3 Short Sales Mode This setting is used to specify how position weights are computed Available modes are e lintner the sum of absolute weights is equal to 1 Lintner assumption e markowitz the sum of weights must equal to 1 Markowitz assumption Defaults to lintner which implies that the sum of absolute weights is used to normalize investment weights require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio AAA c 500 600 weights are normalized based on a simple sum Markowitz portfolio_settings portfolio shortSalesMode markowitz variance_markowitz portfolio_variance portfolio weights are normalized based on a sum of absolute values Lintner portfolio_settings portfolio shortSalesMode lintner variance_lintner portfolio_variance portfolio
3. all actual interval specified during portfolio creation Default value is 1d one trading day require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio c C GO0G c 500 600 1 hour time scale portfolio_settings portfolio timeScale 1h variance_ih portfolio_variance portfolio 1 week time scale portfolio_settings portfolio timeScale 1d variance_1d portfolio_variance portfolio util_plot2d variance_1h title Variance timeScale legend 1h util_line2d variance_1d legend 1d 4 3 3 Microstructure Noise Model Enables market mirostructure noise model of distribution returns Defaults to TRUE which means that microstructure effects are modeled and resulting HF noise is removed from metric caluclations When FALSE HF microstructure noise is not separated from asset returns which at high trading frequences could yield noise contaminated results require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio c C G00G c 500 600 HF noise model is enabled portfolio_settings portfolio noiseModel TRUE variance_noiseModel_TRUE portfolio_variance portfolio HF noise model is disabled portfolio_settings portfolio noiseModel FALSE variance_noiseModel_FALSE portfolio_variance portfolio u
4. 10 01 e t N e g t 5 is latest trading time minus 5 days e UTC timestamp in milliseconds mills from 1970 01 01 00 00 00 in EST time zone Timestamp in yyyy MM dd HH MM SS format portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 Timestamp in yyyy MM dd format portfolio portfolio_create fromTime 2014 10 01 toTime 2014 10 02 Timestamp in t N format portfolio portfolio_create fromTime t 5 toTime t 3 2 2 Get Symbols List Once portfolio is created portfolio_availableSymbols method could be called to receive the list of all available symbols for position creation Each symbol is accompanied by a full company instrument description and listing exchange name portfolio_availableSymbols portfolio ad description exchange 1 BBC BioShares Biotechnology Clinical Trials Fund NASDAQ 2 SCS Steelcase Inc Common Stock NYSE 3 BBD Banco Bradesco Sa American Depositary Shares NYSE 4 BBG Bill Barrett Corporation Common Stock NYSE 5 STPP Barclays PLC iPath US Treasury Steepener ETN NASDAQ 6 BBF BlackRock Municipal Income Investment Trust NYSE 8 BBH Market Vectors Biotech ETF 9 SCON Superconductor Technologies Inc Common Stock 10 SCX L S Starrett Company The Common Stock 11 BBK Blackrock Municipal Bond Trust 3 2 3 Add Positions NYSEARCA NASDAQ NYSE
5. 11 4 3 1 Window Length ioe osoite ee Be ee ee 11 432 Tim Scale sg cso oe ee eee AS ie E Ro Ae A Oo ee ke eS 12 4 3 3 Microstructure Noise Modell e 12 4 3 4 Jumps Outliers Model o o 13 4 3 5 Density Model we e a Ea a e a ee 13 4 36 Hactor Mod ell 2 3 00 ir SA a e ee Oe eg a PR A a 13 4 31 Fractal Price Model ios a a k me e e De ee a ee es 14 E E Be ee A 14 4 4 Transactional Costs e a ano a oe a pa e a aa a a a e a a a 15 4A l Cost Per Share o sosi eai i aa bee bia bbe sad aa we a ee dese paras 15 song ih ap aw a Ria Bd a Wee e e E a AA e Gs A e 15 16 ped bugs wee a Gate Ba es eh ee ah 16 ll Key Features so 206 22 2 eA Dd RR ee ee aR eee eb ea te 16 vhs oO A a te Se BONS Behe do 4 A BS A AA 16 Delo Adding Constraints fed ela gee eee a Rte dE A Re Go ee E a 17 5 1 4 Scalar Constraints aaa ee 18 5 15 Vector Constraints ece e a s ee 19 5 1 6 User Defined Constraints oaa ee 20 1 Package Installation PortfolioEffectHFT package for R relies on the rJava package which assumes that Java runtime is installed and configured on your system To install Java runtime and to configure your R engine to work with it follow these steps 1 1 Install Latest JDK JRE Runtime Download and install latest Java distribution JDK or JRE for your platform from 1 2 Configure Java Environment Optional If you are using Windows installation wizard from the previous step
6. shapes require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio c C G0D0G c 500 600 Using normal density portfolio_settings portfolio densityModel NORMAL util_plotDensity portfolio_pdf portfolio pValueLeft 0 6 pValueRight 1 nPoints 100 addNormalDensity TRUE Using Generalized Lambda density portfolio_settings portfolio densityModel GLD util_plotDensity portfolio_pdf portfolio pValueLeft 0 6 pValueRight 1 nPoints 100 addNormalDensity TRUE 4 3 6 Factor Model Factor model to be used when computing portfolio metrics Available models are e sim portfolio metrics are computed using the Single Index Model 13 e direct portfolio metrics are computed using portfolio value itself experimental Defaults to sim which implies that the Single Index Model is used to compute portfolio metrics require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio c C GO0G c 500 600 Single Index Model is used portfolio_settings portfolio factorModel sim variance_sim portfolio_variance portfolio Direct model is used portfolio_settings portfolio factorModel direct variance_direct portfolio_variance portfolio util_plot2d variance_sim title Variance factorModel legend sim util_li
7. 0 1 0 5 set optimization goal and define constraints optimizer optimization_goal portfolio goal SharpeRatio direction maximize optimizer optimization_constraint_beta optimizer lt constraintValue betaVector run optimization optimalPortfolio optimization_run optimizer plot results util_plot2d portfolio_beta optimalPortfolio title Beta legend Optimal Beta util_line2d portfolio_beta portfolio legend Original Beta 19 5 1 6 User Defined Constraints User defined constraint relies on a provided function which is called during portfolio optimization at specified rebalancing times Function should return a scalar constraint value and would optionally receive portfolio and current time if they are specified as arguments e function automatically converted to a scalar constraint e function time automatically converted to a vector constraint e function portfolio time evaluated during optimization procedure Note When functional constraint specifies portfolio object as a required arguement it could no longer be quickly converted to a scalar or vector based constraint In such case optimization procedure would take a performance hit create portfolio and add positions my_portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition my_portfolio symbol c AAPL GOOG quantity c 500 600 rebalancing every 30m s
8. NYSE Positions are added by calling portfolio _addPosition method on a portfolio object with a list of symbols and quantities For positions that were rebalanced or had non default holding periods a time argument could be used to specify rebalancing timestamps Single position without rebalancing portfolio_addPosition portfolio symbol GO00G quantity 100 Multiple positions without rebalancing portfolio_addPosition portfolio symbol c C G00G quantity c 500 600 Single position with rebalancing portfolio_addPosition portfolio symbol AAPL quantity c 300 150 time c 2014 09 01 09 00 00 2014 09 07 14 30 00 4 Portfolio Settings 4 1 Portfolio Metrics These settings regulate how portfolio returns and return moments are computed 4 1 1 Portfolio Metrics Mode One of the two modes for collecting portfolio metrics that could be used e portfolio portfolio metrics are computed using previous history of position rebalancing Portfolio risk and performance metrics account for the periods with no market exposure i e when no positions are held depending on the holding periods accounting settings see holding periods mode below e price at any given point of time both position and portfolio metrics are computed for a buy and hold strategy This mode is a common for classic portfolio theory and is often used in academic literature for portfolio optimization or when com
9. _CVaR portfolio Drift term is disabled portfolio_settings portfolio driftTerm FALSE CVaR_driftTerm_FALSE portfolio_CVaR portfolio 14 util_plot2d CVaR_driftTerm_TRUE title CVaR driftTerm legend TRUE util_line2d CVaR_driftTerm_FALSE legend FALSE 4 4 Transactional Costs These settings provide a framework for adding variable and fixed transactional costs into return expected return and profit calculations All metrics based on expected return like Sharpe Ratio VaR with drift term enabled would reflect transactional costsin their computations 4 4 1 Cost Per Share Amount of transaction costs per share Default value is 0 require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio c C G00G c 500 600 Transactional costs per share are 0 5 cent portfolio_settings portfolio txnCostPerShare 0 005 return_5 portfolio_return portfolio Transactional costs per share are 0 1 cent portfolio_settings portfolio txnCostPerShare 0 001 return_1 portfolio_return portfolio util_plot2d return_5 title Return txnCostPerShare legend 0 005 util_line2d return_1 legend 0 001 4 4 2 Cost Per Transaction Amount of fixed costs per transaction Defaults to 0 require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfol
10. ce to both constraints e Portfolio metrics change over time but optimization uses only the latest value in the time series Therefore the faster metric series would change the more likely current optimal weights would deviate from the optimal weights at the next time step e Optimization results depend on provided portfolio settings For example short windowLength would produce spot versions of portfolio metrics and computed optimal weights would change faster to reflect shortened metric horizon 5 1 2 Optimization Goals Optimization algorithm requires a single maximization minimization goal to be set using optimization_goal method that operates on a portfolio see portfolio construction Returned optimizer object could be used to add optional optimization costraints and then passed to the method to launch portfolio optimization portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio symbol c C GO0G quantity c 500 600 portfolio_settings portfolio portfolioMetricsMode price resultsSamplingInterval 30m set optimization goal optimizer optimization_goal portfolio goal Return direction maximize launch optimization and obtain optimal portfolio optimalPortfolio optimization_run optimizer util_plot2d portfolio_return portfolio title Portfolio Return legend Simple Portfolio util_line2d portfolio _return o
11. e 2014 10 02 16 00 00 portfolio_addPosition portfolio symbol c C G00G quantity c 500 600 rebalancing every minute static portfolio ignores rebalancing history portfolio_settings portfolio portfolioMetricsMode price resultsSamplingInterval 30m set optimization goal and define constraints optimizer optimization_goal portfolio goal SharpeRatio direction maximize optimization_constraint_beta optimizer lt constraintValue 0 1 run optimization optimalPortfolio optimization_run optimizer plot results util_plot2d portfolio_beta optimalPortfolio title Beta legend Optimal Beta util_line2d portfolio_beta portfolio legend 0riginal Beta 5 1 5 Vector Constraints Instead of using a single scalar one could specify an vector of constraint values with corresponding timestamps Optimization algorithm would then automatically determine when certain constraint value should be applied based on the current rebalancing time create portfolio and add positions portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio symbol c AAPL GO0G quantity c 500 600 rebalancing every minute static portfolio ignores rebalancing history portfolio_settings portfolio portfolioMetricsMode price resultsSamplingInterval 30m betaVector cbind c 2014 10 01 09 30 00 2014 10 01 12 30 00 c
12. ently ignored data spy data Create portfolio portfolio portfolio_create priceDatalx spy data 3 1 2 Add Positions Positions are added using portfolio_addPosition with priceData in the same format as index price data goog data data aapl data Single position without rebalancing portfolio_addPosition portfolio symbol GO00G quantity 100 priceData goog data Single position with rebalancing portfolio_addPosition portfolio symbol AAPL quantity c 300 150 time c 2014 09 01 09 00 00 2014 09 07 14 30 00 priceData aapl data 3 2 Server Data At PortfolioEffect we are capturing and storing 1 second intraday bar history for a all NASDAQ traded equites This server side dataset spans from January 2013 to the latest trading time minus five minutes It could be used to construct asset portfolios and compute intraday portfolio metrics 3 2 1 Create Portfolio Method portfolio_create creates new asset portfolio or overwrites an existing portfolio object with the same name When using server side data it only requires a time interval that would be treated as a default position holding period unless positions are added with rebalancing Index symbol could be specified as well with a default value of SPY SPDR S amp P 500 ETF Trust Interval boundaries are passed in the following format e yyyy MM dd HH MM SS e g 2014 10 01 09 30 00 e yyyy MM dd e g 2014
13. io AAPL c 100 300 500 150 time c 2014 10 01 09 30 00 2014 10 01 11 30 00 2014 10 01 15 30 00 2014 10 02 11 30 00 Fixed costs per transaction are 9 dollars portfolio_settings portfolio txnCostFixed 19 0 return_19 portfolio_return portfolio Fixed costs per transaction are 1 dollar portfolio_settings portfolio txnCostFixed 1 0 return_1 portfolio_return portfolio util_plot2d return_19 title Return txnCostFixed legend 19 0 util_line2d return_1 legend 1 0 15 5 Portfolio Optimization 5 1 Optimization Goals amp Constraints A classic problem of constructing a portfolio that meets certain maximization minimization goals and constraints is addressed in our version of a multi start portfolio optimization algorithm At every time step optimization algorithm tries to find position weights that best meet optimization goals and constraints 5 1 1 Key Features e A multi start approach is used to compare local optima with each other and select a global optimum Local optima are computed using a modified method of parallel tangents PARTAN e When optimization algorithm is supplied with mutually exclusive constraints it would try to produce result that is equally close in absolute terms to all constraint boundaries For instance constraints x gt 6 and x lt 4 are mutually exclusive so the optimization algorithm would choose x 5 which is a value that has the smallest distan
14. ities By default optimal portfolio starts with a value of the initial portfolio Portfolio value could be fixed to a constant level at every optimization step see corresponding constraint below Higher portfolio value could be used to keep difference between computed optimal weights and effective weights based on position quantities small Lower portfolio value or higher asset price would normally increase discretization error create portfolio and add positions portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio symbol c C GO0G quantity c 500 600 portfolio_settings portfolio portfolioMetricsMode price resultsSamplingInterval 30m set optimization goal optimizer optimization_goal portfolio goal SharpeRatio direction maximize 17 add constraints optimization_constraint_beta optimizer 0 optimization_constraint_weight optimizer gt 0 5 GO0G optimization_constraint_variance optimizer lt 0 02 launch optimization and obtain optimal portfolio optimalPortfolio optimization_run optimizer util_plot2d portfolio_sharpeRatio portfolio title Sharpe Ratio legend Simple Portfolio util_line2d portfolio_sharpeRatio optimalPortfolio legend Optimal Portfolio util_plot2d portfolio_beta portfolio title Beta legend Simple Portfolio util_line2d portfolio_beta optimalPortfolio legend Optimal Portf
15. ne2d variance_direct legend direct 4 3 7 Fractal Price Model Used to enable mono fractal price assumptions GBM when time scaling return moments Defaults to TRUE which implies that computed Hurst exponent is used to scale return moments When FALSE price is assumed to follow regular GBM with Hurst exponent 0 5 require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio c C G00G c 500 600 Fractal price model is enabled portfolio_settings portfolio fractalPriceModel TRUE variance_fractal portfolio_variance portfolio Fractal price model is disabled portfolio_settings portfolio fractalPriceModel FALSE variance_nonfractal portfolio_variance portfolio util_plot2d variance_fractal title Variance fractalPriceModel legend enabled util_line2d variance_nonfractal legend disabled 4 3 8 Drift Term Used to enable drift term expected return when computing probability density approximation and related metrics e g CVaR Omega Ratio etc Defaults to FALSE which implies that distribution is centered around expected return require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio c C GO0G c 500 600 Drift term is enabled portfolio_settings portfolio driftTerm TRUE CVaR_driftTerm_TRUE portfolio
16. ode is set to portfolio it is also the length of rebalancing history window to be used Available interval values are e Xs seconds e Xm minutes e Xh hours e Xd trading days 6 5 calendar hours in a trading day e Xw weeks 5 trading days in 1 week e Xmo month 21 trading day in 1 month e Xy years 256 trading days in 1 year e all all observations are used Default value is 1d one trading day require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio c C G00G c 500 600 1 hour rolling window portfolio_settings portfolio windowLength 1h variance_1h portfolio_variance portfolio 1 week rolling window portfolio_settings portfolio windowLength 1d variance_1d portfolio_variance portfolio util_plot2d variance_1h title Variance windowLength legend 1h util_line2d variance_1d legend 1d 11 4 3 2 Time Scale Interval to be used for scaling return distribution statistics and producing metrics forecasts at different horizons Available interval values are e Xs seconds e Xm minutes e Xh hours e Xd trading days 6 5 hours in a trading day e Xw weeks 5 trading days in 1 week e Xmo month 21 trading day in 1 month e Xy years 256 trading days in 1 year e
17. olio util_plot2d portfolio_variance portfolio title Variance legend Simple Portfolio util_line2d portfolio_variance optimalPortfolio legend Optimal Portfolio The following constraint methods are available optimization_constraint_allWeights portfolio weights of all positions e Y aj E N v le 5 Q o 5 a gt 4 E a z 2 09 a portfolio position weights optimization_constraint_sumOfAbs Weights portfolio s sum of absolute positions weights for selected positions optimization_constraint_return portfolio return optimization_constraint_expectedReturn portfolio expected return optimization_constraint_variance portfolio returns variance optimization_constraint_beta portfolio beta optimization_constraint_VaR portfolio Value at Risk optimization_constraint_C VaR portfolio Conditional Value at Risk Expected Tail Loss optimization_constraint_modifiedSharpeRatio portfolio modified Sharpe Ratio optimization_constraint_sharpeRatio portfolio Sharpe Ratio optimization_constraint_starrRatio portfolio STARR Ratio 5 1 4 Scalar Constraints Scalar constraints are the simplest type of optimization boundaries They require a single constant that is applied over a full time span of portfolio optimization An example below sets portfolio beta constraint to be greater or equal to 0 1 18 create portfolio and add positions portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTim
18. ptimalPortfolio legend 0ptimal Portfolio 16 The following portfolio metrics could currently be used as optimization goals Variance portfolio returns variance VaR portfolio Value at Risk CVaR portfolio Conditional Value at Risk Expected Tail Loss ExpectedReturn portfolio expected return Return portfolio return SharpeRatio portfolio Sharpe Ratio ModifiedSharpeRatio portfolio modified Sharpe Ratio StarrRatio portfolio STARR Ratio ContraintsOnly no optimization is performed This is used for returning an arbitrary portfolio that meets specified set of constraints EquiWeight no optimization is performed and constraints are not processes Portfolio positions are returned with equal weights 5 1 3 Adding Constraints Optimization constraints cover both metric based and weight based constraints Metric based constraints limit portfolio level metrics to a certain range of values For example zero beta constraint would produce market neutral optimal portfolio Weight based constraints operate on optimal position weights or sum of weights to give control over position concentration risks or short sales assumptions Constraint methods could be chained to produce complex optimization rules Since position quantities are integer numbers and weights are decimals a discretization error is introduced while converting optimal position weights to corresponding quant
19. puting price statistics By default mode is set to portfolio require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio symbol AAPL quantity c 300 150 time c 2014 10 01 09 30 00 2014 10 02 09 30 00 portfolio_addPosition portfolio symbol G00G quantity c 100 150 time c 2014 10 01 09 30 00 2014 10 02 09 30 00 price mode portfolio_settings portfolio portfolioMetricsMode price variance_price portfolio_variance portfolio portfolio mode portfolio_settings portfolio portfolioMetricsMode portfolio variance_portfolio portfolio_variance portfolio util_plot2d variance_portfolio title Variance portfolioMetricsMode legend price util_line2d variance_price legend portfolio 4 1 2 Holding Periods Only This setting should only be used when portfolio metrics mode is set to portfolio When holdingPeriodsOnly is set to FALSE trading strategy risk and performance metrics will be annualized to include time intervals when strategy had no market exposure at certain points i e when position quantity were zero When set to TRUE trading strategy metrics are annualized only based on actual holding intervals require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio AAPL c 0 300 0 150 time c
20. rtfolio resultsSamplingInterval 15m variance_15m portfolio_variance portfolio util_plot2d variance_30s title Variance resultsSamplingInterval legend 30s util_line2d variance_15m legend 15m 4 2 2 Input Sampling Interval Interval to be used as a minimum step for sampling input prices Available interval values are e Xs seconds e Xm minutes e Xh hours e Xd trading days 6 5 hours in a trading day e Xw weeks 5 trading days in 1 week e Xmo month 21 trading day in 1 month e Xy years 256 trading days in 1 year e none no sampling 10 Default value is none which indicates that no sampling is applied require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio c C GO0G c 500 600 sample input prices every 30 seconds portfolio_settings portfolio inputSamplingInterval 30s variance_30s portfolio_variance portfolio sample input prices every 5 min portfolio_settings portfolio inputSamplingInterval 5m variance_5m portfolio_variance portfolio util_plot2d variance_30s title Variance inputSamplingInterval legend 30s util_line2d variance_5m legend 5m 4 3 Model Pipeline 4 3 1 Window Length Specifies rolling window length that should be used for computing portfolio and position metrics When portfolio m
21. should have done everything for you If you are on Linux or Mac and you used a tarball file you will need to manually append the following lines to etc environment using your favorite text editor export JAVA_HOME path to java folder export PATH PATH JAVA_HOME bin Apply environment changes source etc environment To complete with the set up of Java environment inside R run the following line sudo R CMD javareconf 1 3 Install Required Packages Optional If you are manually installing PortfolioEffectHFT package you don t want to use CRAN repositories for some reason you would need to install all required package dependencies first Start R from the command line or in your GUI editor and type install packages c rJava ggplot2 You are now ready to install the PortfolioEffectHFT package directly from www portfolioeffect com downloads section 2 API Credentials All portfolio computations are performed on PortfolioEffect cloud servers To obtain a free non professional account you need to follow a quick sign up process on our website www portfolioeffect com registration Please use a valid sign up address it will be used to email your account activation link 2 1 Locate API Credentials Log in to you account and locate your API credentials on the main page API Settings API Username API Password Your account password API Key 2 2 Set API Credentials in R Run the following commands to set yo
22. tatic portfolio ignores rebalancing history portfolio_settings my_portfolio portfolioMetricsMode price resultsSamplingInterval 30m define custom optimization constraint method for beta myConstraint lt function portfolio custom function portfolio_beta portfolio 2 0 2 y set optimization goal and define constraints optimizer optimization_goal my_portfolio goal SharpeRatio direction maximize optimizer optimization_constraint_beta optimizer gt constraintValue myConstraint run optimization optimalPortfolio optimization_run optimizer plot results util_plot2d portfolio_beta optimalPortfolio title Beta legend 0ptimal Beta util_line2d portfolio_beta my_portfolio legend Original Beta 20
23. til_plot2d variance_noiseModel_TRUE title Variance noiseModel legend TRUE util_line2d variance_noiseModel_ FALSE legend FALSE 12 4 3 4 Jumps Outliers Model Used to select jump filtering mode when computing return statistics Available modes are e none price jumps are not filtered anywhere e moments price jumps are filtered only when computing return moments i e for expected return variance skewness kurtosis and derived metrics e all price jumps are filtered from computed returns prices and all return metrics require PortfolioEffectHFT portfolio portfolio_create fromTime 2014 10 01 09 30 00 toTime 2014 10 02 16 00 00 portfolio_addPosition portfolio c C GO0G c 500 600 Price jumps detection is enabled for returns and moments portfolio_settings portfolio jumpsModel all variance_all portfolio_variance portfolio Price jumps detection is disabled portfolio_settings portfolio jumpsModel none variance_none portfolio_variance portfolio util_plot2d variance_all title Variance jumpsModel legend a11 util_line2d variance_none legend none 4 3 5 Density Model Used to select density approximation model of return distribution Available models are e GLD Generalized Lambda Distribution e CORNER_FISHER Corner Fisher approximation e NORMAL Gaussian distribution Defaults to GLD which would fit a very broad range of distribution
24. ur account API credentials for the PortfolioEffectHFT R Package installed You will need to do it only once as your credentials are stored between sessions on your local machine to speed up future logons You would need to repeat this procedure if you change your account password or install PortfolioEffectHFT package on another computer require PortfolioEffectHFT util_setCredentials API Username API Password API Key You are now ready to call PortfolioEffectHF T methods 3 Portfolio Construction 3 1 User Data Users may supply their own historical datasets for index and position entries This external data could be one a OHLC bar column element e g 1 second close prices or a vector of actual transaction prices that contains non equidistant data points You might want to pre pend at least N 4 x windowLength data points to the beginning of the interval of interest which would be used for initial calibration of portfolio metrics 3 1 1 Create Portfolio Method portfolio_create takes a vector of index prices in the format UTC timestamp price with UTC timestamp expressed in milliseconds from 1970 01 01 00 00 00 EST Time Value 1 1412256601000 99 30 2 1412256602000 99 33 3 1412256603000 99 30 4 1412256604000 99 26 5 1412256605000 99 36 6 1412256606000 99 36 7 1412256607000 99 36 8 1412256608000 99 38 9 1412256609000 99 40 10 1412256610000 99 37 If index symbol is specified it is sil
25. www portfolioeffect com High Frequency Portfolio Analytics User Manual PortfolioEffectHET Package for R Software Andrey Kostin andrey kostin portfolioeffect com Released Under GPL 8 License by Snowfall Systems Inc August 20 2015 Contents 1 Package Installation 1 1 Install Latest JDK JRE Runtime oaa a 1 2 Configure Java Environment Optional 2 2 ee 1 3 Install Required Packages Optional oo o 2 API Credentials 2 1 Locate API Credentials 00200000002 ee ee 22 Set APT Credentials in_ R creci bk a wok ee ee ke ES Oe A ea ae ee ee ke od Boe oP wad a a a BO ee Da EE RG ee Eee ee bes be dase ene ee th Soe oe ee beds Gy ee we ol ES ee pe a 341 2 Add Positions hice ae ae GERARD a A AAA ee ee a ER E eee dans ie erie GAGS Sant ae Ge we A ete Se eee EL i ee eee ae yes Sie Be ih Dm iis eh me AN 3 2 2 Get symbols List s enes aa ea a eG PEA we ew ae 323 Add Positions lt 2 4 2 G08 ade e PE ed gee a Sed oe A 4 Portfolio Settings 41 Portfolio Metrics s sareari eb e a ae ee OD be Eo A Sas 4 1 1 Portfolio Metrics Mode 2 2 a a 4 1 2 Holding Periods Only e 4 1 3 Short Sales Mode 2 2 42 Data Samplngy ose Se ek a aw ae Ee oe eS ee Sw a be Saree A 9 4 2 1 Results Sampling Interval o aaa 10 4 2 2 Input Sampling Interval 2 362 ea ee ee eR ee eee a 10 ee Gmbh Bech dh ae th Oe a Ae Gh ee BabA Gey ere Soe Geet el Be eee etek

Download Pdf Manuals

image

Related Search

Related Contents

BR-IM70-R BR-IM73-R  TemperaTurschalTer TSM 125  User Guide - Grapevine  取扱説明書ダウンロード(PDF)  HP E2450A Symbol Utility User's Guide  Battery Case for iPhone 4/4S Specification / User Manual  Sunbeam WF6000 User's Manual  V - Greenstone Homes  Le illustrazioni e i dati tecnici si intendono a titolo indicativo e non  RECOMMANDATIONS Langues vivantes - Espace Educatif  

Copyright © All rights reserved.
DMCA: DMCA_mwitty#outlook.com.