Skip to main content
留学咨询

辅导案例-COMP226

By May 15, 2020No Comments

PAPER CODE NO. EXAMINER : Rahul Savani Tel. No. 0151 795 0397 COMP226 DEPARTMENT : Computer Science 20 Example Exam Questions Computer-Based Trading in Financial Markets TIME ALLOWED : 48 minutes (The actual exam will be Two Hours and will have 50 questions.) INSTRUCTIONS TO CANDIDATES NAME OF CANDIDATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . STUDENT ID NO . . . . . . . . . . . . . . . . . . USUAL SIGNATURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . READ THE FOLLOWING CAREFULLY: 1. Each of the following questions comprise 5 statements, for which you should select the one most appropriate answer. 2. On this exam paper, place a tick in the appropriate box to indicate your answer. 3. The exam mark is based on the overall number of correctly answered questions. The more questions you answer correctly the higher your mark, incorrectly answered questions do not count against you. 4. Enter your name and student ID number IN PENCIL on the computer answer sheet according to the instruction on that sheet. The digits should be entered in the boxes under ‘Student ID Number’ and entered by means of horizontal lines in the appropriate boxes underneath, exactly as when answering questions. 5. When you have completed this exam paper, read the instructions on the computer answer sheet carefully and transfer your answers from the exam paper. Use a HB pencil to mark the computer answer sheet and if you change your mind be sure to erase the mark you have made. You may then mark the alternative answer. 6. At the end of the examination, be absolutely sure to hand in BOTH this exam paper AND the computer answer sheet. THIS PAPER MUST NOT BE REMOVED FROM THE EXAMINATION ROOM PAPER CODE COMP226 page 1 of 8 Continued 1. Consider the following R code. 1 mat Which of the following will remove the third row from mat? A. mat B. mat C. mat D. mat E. mat 2. Consider the following R code. 1 x 2 func 3 func() 4 k Which of the following corresponds to the resulting element of k? A. 1 B. 2 C. 3 D. 4 E. 5 3. Consider the following R code. 1 available 2 desired 3 traded Which of the following corresponds to the resulting element of traded? A. 2 B. 4 C. 6 D. 34 E. 30 PAPER CODE COMP226 page 2 of 8 Continued 4. Which of the following types of price are best for backtesting equities using daily data? A. Open B. High C. Low D. Close E. Adjusted 5. Consider a 2-for-1 stock split. Which of the following describes the new additional step in the stock price adjustment process (for prices before the dividend date)? A. Add 2 B. Subtract 2 C. Subtract 3 D. Divide by 2 E. Multiply by 3 6. Suppose that the state of the limit order book is as follows. Price Offers 110 6 100 4 5 90 5 80 Bids Suppose that a limit order arrives to buy 4 units at prices no worse that 105. What will be the best offer price after the order is processed? A. 80 B. 90 C. 100 D. 105 E. 110 PAPER CODE COMP226 page 3 of 8 Continued 7. Suppose that the state of the limit order book is as follows. Price Offers 11 6 10 4 5 9 5 8 Bids Suppose that a limit order arrives to sell 6 units at prices no worse than 8. What will be the value of the spread after the order is processed? A. -1 B. 0 C. 1 D. 2 E. 3 8. Consider the following incomplete R code, which takes as its first argument a variable askBookwhich is a matrix with two columns with names “price” and “volume”. The function checkAvailability should return the total number of units available for sale in askBook at prices no worse than priceThresh, its second argument, which represents a price level. 1 checkAvailability 2 available 3 return(available) 4 } Which of the following correctly completes line 2 of the code? A. max(askBook[askBook[,”price”]>= priceThresh),”volume”]) B. min(askBook[askBook[,”price”]<= priceThresh),"volume"]) C. max(askBook[askBook[,"price"]<= priceThresh),"volume"]) D. sum(askBook[askBook[,"price"]<= priceThresh),"volume"]) E. sum(askBook[askBook[,"price"]>= priceThresh),”volume”]) 9. Let the price of an asset in periods t − 1 and t be Pt−1 and Pt, respectively. Which of the following is the correct formula for the simple return of taking a short position from t− 1 to t: A. Pt−Pt−1 Pt B. Pt−Pt−1 Pt−1 C. log(Pt/Pt−1) D. log(Pt−1/Pt) E. Pt−1−Pt Pt PAPER CODE COMP226 page 4 of 8 Continued 10. Which of the following expressions describes the simple return for a short position in terms of the corresponding simple return for a long position Rt? A. (Rt − 1)/Rt. B. 1−Rt C. −Rt D. −Rt/(Rt + 1). E. −(Rt + 1)/Rt. 11. Consider the following R code. The vector log ret represents the log returns of an asset. The vector pos represents unit positions in this asset taken by a trading strategy, where 1, 0, -1, represents long, flat, and short, respectively. The function cumulativeLogReturns should compute the cumulative log returns corresponding to log ret and pos. 1 log_ret 2 pos 3 cumulativeLogReturns 4 cumLogRets 5 } Which of the following correctly completes line 4? A. cummax(log_ret*pos) B. cumsum(log_ret*pos) C. cumprod(log_ret*pos + 1) – 1 D. cumprod(log_ret*pos + 1) E. cummax(log_ret*pos) – 1 12. Consider the following R code. 1 cm Which of the following corresponds to resulting elements of cm? A. 1 1 2 2 3 3 B. -1 1 2 2 3 3 C. -1 1 1 2 2 3 D. -1 1 -2 2 -3 3 E. 3 3 3 3 3 3 PAPER CODE COMP226 page 5 of 8 Continued 13. Suppose that wealthIndex is a vector in R that represents the Wealth Index of a trading strategy. Which of the following pieces of R code computes the corresponding maximum drawdown? A. max(cummax(wealthIndex)/wealthIndex-1) B. max(wealthIndex/cummax(wealthIndex)-1) C. max(1-wealthIndex/cummax(wealthIndex)) D. max(cummax(wealthIndex)-wealthIndex) E. max(cummin(wealthIndex)-wealthIndex) 14. Consider the following R code for computing a simple moving average 1 prices 2 s 3 n 4 s[1] 5 for (i in n:length(prices)) 6 s[i] Which of the following correspond to the entries of the vector s after this code has been run? A. 100 102.5 103.5 104.5 B. 102 103 104 105 C. 100 102 103 104 D. 100.0 101.0 102.5 103.5 E. 101 103 103.5 104 15. Which of the following implement a high-pass filter using an input signal and the output of a simple moving average applied to the input? A. Add the original signal to the output of the simple moving average B. Subtract the original signal from the output of the moving average C. Multiply the original signal and the output of the simple moving average D. Subtract the output of the simple moving average from the signal E. Divide the output of the simple moving average by the original signal 16. If there is a universe of 5 stocks, how many different pairs of stocks are there? A. 10 B. 21 C. 28 D. 30 E. 32 PAPER CODE COMP226 page 6 of 8 Continued 17. Consider the following R code. 1 prices 2 n 3 long 4 for (i in (n+1):(length(prices))) { 5 long[i] prices[(i-1):(i-n)]), 1,0) 6 short[i] 7 } 8 signal Which of the following corresponds to the resulting elements of signal? A. 1 -1 1 1 0 0 -1 1 B. 0 -1 0 0 1 1 1 0 C. 0 0 -1 -1 0 1 -1 1 D. 0 0 1 1 0 -1 1 -1 E. 1 1 0 0 1 -1 0 -1 18. Suppose a trading strategy has k parameters labelled 1, 2, . . . , k, and that the number of parameter values that each parameter can take on is pi for each parameter i = 1, 2, . . . , k. How many parameter combinations are there in total? A. ∑ i=1,…,k pi B. ∏ i=1,…,k pi C. (maxi=1,…,k pi)k D. (mini=1,…,k pi)k E. exp( ∑ i=1,…,k pi) 19. Consider the following R code that defines the parameters of a trading strategy and computes the number of parameter combinations. 1 n 2 hold 3 flag 4 params 5 nParams Which of the following corresponds to the resulting element of nParams? A. 100 B. 200 C. 220 D. 242 E. 244 PAPER CODE COMP226 page 7 of 8 Continued 20. Suppose that vector pos in R encodes the position sizes of a strategy as follows: if pos[i] is equal to k then the strategy was k units long if k > 0 and −k units short if k < 0, and flat otherwise, if k = 0. The vector pos is of length n. Assume that pos[1] is 0. Which of the following is correct R code for the number of units of slippage that would be incurred assu ming that every time the position changes by x > 0 units in absolute value then x units of slippage are incurred? A. sum(abs(pos[1:n] – pos[2:(n-1)])) B. abs(sum(pos[1:n] – pos[2:(n-1)])) C. abs(sum(pos[2:n] – pos[1:(n-1)])) D. sum(abs(pos[2:n] – pos[1:(n-1)])) E. abs(sum(pos[1:n] + pos[2:(n-1)])) PAPER CODE COMP226 page 8 of 8 End

admin

Author admin

More posts by admin