Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are required to provide the code for this entire question. Only when requested, you are required to write down the result coming from the

image text in transcribed

image text in transcribed

image text in transcribed

You are required to provide the code for this entire question. Only when requested, you are required to write down the result coming from the code in your examination script. A trading analyst is trying to design and test a trading strategy for the crypto market. He is observing the transactions that are taking place in the blockchains of the various crypto assets. For example, when he is observing the Bitcoin (BTC) blockchain, he noted a BTC coinbase transaction. (a) Discuss the purpose of a BTC coinbase transaction. (10 marks) The analyst decided to implement a trading strategy by observing the general sentiment in the entire crypto market in the following way: At the end of day t, the strategy will make use of the daily return to evaluate the market equilibrium for the day. The daily return of a crypto asset on day t is defined as rt=SopenSclose1 where Sopen and Sclose are the opening and closing prices of the asset for the day. If the return spread in the universe is greater than dr, the analyst believes that the market has reached a new equilibrium on day t. The return spread is defined as MAX(Rt)MIN(Rt) where Rt is the daily return of all the assets in the universe on day t. If a new market equilibrium is observed at the end of day t, the strategy will acquire the loser asset at the start of day t+1 at the opening price. The loser is defined as the asset that has the lowest (intra-day) return in day t. At the end of day t+1, the strategy will again sense the market by evaluating the return spread in the universe. If a new equilibrium is detected again, the corresponding loser asset is determined and the previous loser is sold to buy the new loser at the start of t+ 2. If a new equilibrium is not detected on day t+1, the same loser asset is held until a new loser asset emerged. This process will be repeated on every trading day till the end of the strategy. The strategy is initialized by holding an equal-weighed (EW) portfolio until the first determination of a loser asset. The table below documents some sample calculations of the strategy, given dr=0.6. Table 2: Sample calculations for the trading strategy From the table, a new market equilibrium was first observed on 3-Jan. Therefore prior to 3-Jan, an EW portfolio is held. The loser asset is determined to be asset_05 on the 3-Jan and the asset is acquired at the start of 4-Jan. asset_05 is held until the end of 8-Jan because a new market equilibrium and hence a (new) loser asset was identified on the 8Jan. Given the following inputs to the trading strategy: Figure 3: Initialization of inputs to trading strategy. (b) Describe the purpose of Line 3 in Figure 3. Why is it required? (5marks) (c) Implement code such that the daily returns data generated from Figure 3 are formatted into a pandas dataframe with the same index and column names given in Figure 4. You are reminded that your code must be driven entirely by the inputs given in Figure 3. Figure 4: Expected output for Question 3c. Only a subset of columns and the first 3 rows of the daily return dataframe is printed. (10marks) (d) Implement code that will determine the days where a new market equilibrium is detected. Write down the list of dates, using the inputs given in Figure 3 . (10 marks) (e) Implement code that will determine the loser asset. Write down the list of loser assets for the inputs given in Figure 3. (5 marks) (f) Implement code that will evaluate the daily return for the trading strategy for entire trading period. Write down the daily return of the trading strategy for the following dates - 1Jan-2020 and 23-Jan-2020. Hence, solve and write down the final wealth of the strategy, to two (2) decimal points, on the end_dt given an initial wealth of $1,000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions

Question

What is meant by Career Planning and development ?

Answered: 1 week ago

Question

What are Fringe Benefits ? List out some.

Answered: 1 week ago