讲解:Frequency Data、R、R、parametersR|R

Quantitative strategies on HighFrequency DataAssessment of the sections (labs)dr Piotr Wójcikacademic year 2018/2019General informationIn teams of at most 2 persons students will build and backtest different trading strategiesfor 2 groups of assets. Please inform the lecturer about the team members by [email protected] (mailto:[email protected]) the latest by midnight 2018-12-14.The data is exactly the same for all teams and consists of intraday data of 1 minutefrequency (in xts format). The data covers real market data for the period of 2011-01 –2012-03 (just trading hours 9:30-16:00 NY time) and is divided in 5 quarterly files.For the purpose of strategy selection and parameters search students are initially giventhe data just for 3 in-sample quarters. The remaining data for 2 out-of-sample quarterswill be delivered by the lecturer after the submission of presentations (see below).General informationQuantitative strategies on High Frequency Data Page 1 of 7file:///D:/FR%20video/warsaw/Quantitative%20Strategies%20on%20High%20Freque... 2018/12/30Groups of assetsThe groups of assets include:1. Group 1 – a single asset: ES – futures contract for S&P 500 index (transaction cost = 4$, 1 index point= 50$).2. Group 2 – three assets: MSFT – Microsoft stocks (transaction cost = 0.2$) AAPL – Apple stocks (transaction cost = 1$), NQ – futures contract for NASDAQ index (transaction cost = 4$, 1 index point= 25$).CAUTION: The quarterly data files include all four assets –please remember to treat ES (group 1) and MSFT , AAPL , NQ(group 2) separately in your trading strategies.Any combinations within groupallowedWithin each of the above groups of assets you can: trade just a single asset, or put assets together in pair(s) as spreads, or trade each asset separately and treat them as a portfolio.If trading more than one asset ( spread ), remember to include positive transactioncosts for each of them.Trading sizesAssume trading just with one unit of any security/spread, so the only positions availableare: flat / neutral ( 0 ), short ( -1 ), long ( +1 ).Different approaches, entry/exittechniquesFor each of the (groups of) assets please consider and compare at least 2 different typesof entry techniques (approaches), each with several combinations of parameters(memories of moving statistics, multipliers, etc.).As different approaches one may treat (each for the trend following or mean revertingstrategy) for example an entry/exit technique based on:Quantitative strategies on High Frequency Data Page 2 of 7file:///D:/FR%20video/warsaw/Quantitative%20Strategies%20on%20High%20Freque... 2018/12/30? a single moving average/moving median/moving quantile, two or more intersecting moving averages/moving medians/moving quantiles, a single moving average/moving median/moving quantile and a selected volatilitymeasure (breakout models), any other that comes to your mind.Additional filteringAdditional filtering may be added (eg. in pair trading strategies): based on correlation between two (or more) assets, based on regression between two (or more) assets, based on testing for cointegration between two (or more) assets, based on testing for Granger causality between two (or more) assets, any other that comes to your mind.Common assumptionsCommon assumptions for all strategies: do not use in calculations the data from the first and last 10 minutes of thesession ( 9:31--9:40 and 15:51--16:00 ) – put missing values there, do not hold positions overnight (exit all positions 15 minutes before the sessionend, i.e. at 15:45 ), do not trade within the first 20 minutes of stocks quotations ( 9:31--9:50 ), but DOuse the data for 9:41--9:50 in calculations of signal, volatility, etc.,One may make additional assumptions, however they should be clearly explained andjustified, e.g. stop-loss condition, etc.Selection of best strategyCAUTION !!!!! As mentioned before, the data are divided in twoparts – in-sample quarters and out-of-sample quarters. At firstteams are provided just with the in-sample data to do a researchand select the best strategy for each group of assetsseparately.Exactly the same strategy (the same entry/exit technique and parameters) has to beapplied for a particular group of assets in each quarter.For example if after research you find that for assets in group 1 the best strategy is a trendfollowing strategy based on the cross-over of two exponential moving averages – EMA60and EMA10 – you should apply this particular strategy with the same parameters and allother assumptions to every quarter of your data (first in-sample, then out-of-sample onceavailable) and report the results. The same in case of the second group of assets – thebest/optimal strategy may be different than in case of assets from group 1, but again – ithas to be consistently applied on all quarters of data.Quantitative strategies on High Frequency Data Page 3 of 7file:///D:/FR%20video/warsaw/Quantitative%20Strategies%20on%20High%20Freque... 2018/12/30Selecting different best strategies (or just different parameters) forthe same group of assets in different quarters of the data is notallowed.Performance measuresFor the selected best strategy for each group of assets aggregate the strategy P&Lsto daily and based on daily results calculate the following measures (separately for eachquarter): gross SR – Sharpe ratio based on gross daily P&L (without transaction costs,denoted in monetary terms), net代做Frequency Data作业、R课程设计作业代写、代做R实验作业、代写parameters作业 代写R语言编程| SR – Sharpe ratio based on net daily P&L (with transaction costs included,denoted in monetary terms), gross cumP&L – cumulative profit and loss at the end of the investment period(last value of the cumP&L series) without transaction costs, denoted in monetaryterms, net cumP&L – cumulative profit and loss at the end of the investment period (lastvalue of the cumP&L series) with transaction costs included, denoted in monetaryterms, av.ntrades – average daily number of trades.and report them in a table at the end of the presentation and report.Based on the above mentioned measures the final summary statistic will be calculatedfor each quarter separately. The formula for the summary statistic is the following:This promotes strategies which give high net Sharpe ratios and higher net pnl and stronglyawards for higher trading frequency.Please add this statistic to the summary table and in addition use codes that will savethis table as a csv file.The above mentioned summary statistic will be averaged separately for in-sample andout-of-sample quarters and finally its weighted average ( 50\% for in-sample and 50\%for out-of-sample results) will be used to rank the teams, divide them in quartile groupsand give points for strategy performance.PointsIn total 100 points can be collected, given for: presentation in class prepared in RMarkdown including working R codes( 20 pts ), final written report prepared in RMarkdown including working R codes ( 40 pts ), strategies performance ( 40 pts ) – ranking based on a summary statisticdescribed above, max. 20 pts. per each (group) of assets results:stat = max(1, ln(1 + av. ntrades)) abs(netSR) sign(netSR)abs(net. PnL) √10Quantitative strategies on High Frequency Data Page 4 of 7file:///D:/FR%20video/warsaw/Quantitative%20Strategies%20on%20High%20Freque... 2018/12/30? 20 if strategy performance in top quartile group (best), 15 if strategy performance in the 2nd quartile group (good), 10 if strategy performance in the 3rd quartile group (below average), 5 if strategy performance in the 4th quartile group (unlucky),PresentationsThe presentation prepared in RMarkdown has to be submitted by email to the [email protected] (mailto:[email protected]) until midnight 2019-01-20(presentation should be submitted both as the source *.Rmd file and also in the versioncompiled to html , pdf or docx format). The R codes included in the Rmd file shouldload the data from source files for each quarter, apply the BEST finally selected strategyon the data for ALL quarters, calculate P&Ls and report the results in the desired form.Do NOT include all the testing codes which you applied forstrategy selection, parameter search, etc. ONLY a simple code fora FINALLY selected strategy i.e. with the selected set of bestperforming parameters for each group of assets – check theattached sample Rmd files prepared by the lecturer.All teams will give presentations (10 minutes) informing about strategies considered andtheir in-sample results. The presentations do not have to inform about all the details ofconsidered strategies.Only teams that submit presentations in a desired format withworking R codes behind will obtain the out-of-sample data.Teams which do not provide Rmd file with working R codes behindwhich apply their best strategies will not be valued.All presentations will take place on 2019-01-22 (labs time, 9:45-13:05 in room I).Groups that do NOT present their results in class will get 0points for presentation and for the out-of-sampleperformance part.Out-of-sample dataAfter all the presentations on 2019-01-23 the lecturer will provide the out-of-sampledata to enable verifying the strategy performance and finishing a final report. Havingprepared the report in R Markdown with working R codes behind will make your analysis ofthe out-of-sample data very quick and on the other hand would allow the lecturer to verifyreported results and check if all assumptions are met.Quantitative strategies on High Frequency Data Page 5 of 7file:///D:/FR%20video/warsaw/Quantitative%20Strategies%20on%20High%20Freque... 2018/12/30Final reportThe final written report should be submitted by midnight 2019-01-29 (report should besubmitted both as the source *.Rmd file and also in the version compiled to html , pdfor docx format). It should include a detailed explanation of the finally selected strategyfor each group of assets (approach, type and elements of the strategy, entry technique,assumptions, parameter values, etc.) and also shortly explain the process of final strategyselection. Measures of strategy performance should also be reported in a table (gross andnet SR, gross and net cum P&L, average daily number of trades) together with at leastone figure showing gross and net cumulative P&L of the strategy (based on dailyaggregated data).Students who do not submit their final report before the deadlinewill not be allowed to take the final written exam in wintersession.Important dates again 2018-12-14 by 23:59 – submission of information about the team members 2019-01-20 by 23:59 – submission of presentations of in-sample results in RMarkdown with working R codes behind, 2019-01-22 – in class presentations of in-sample results – after that obtaining outof-sampledata. 2019-01-29 by 23:59 – final report submissionEach submission should be done via email to [email protected](mailto:[email protected]) before midnight of the deadline day if not statedotherwise.GOOD LUCK !!!!!!!!!!!!!!转自:http://ass.3daixie.com/2019012368012024.html

你可能感兴趣的:(讲解:Frequency Data、R、R、parametersR|R)