Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use jupyter notebook to answer You are carrying out the automation of the following investment strategy in Python. An initial investment amount of $50,000 is

use jupyter notebook to answer image text in transcribed

You are carrying out the automation of the following investment strategy in Python. An initial investment amount of $50,000 is used to acquire Stock A. Every month, you are prepared to fork out a monthly amount of $1,000. The average price of Stock A in the portfolio, Sav is defined as the net amount of cash put into the portfolio divided by the total number of units of Stock A in the portfolio. Month Mkt Buy/Sell? Price 0 1 2 3 95 80 102 84 Buy Buy Sell Buy Units Cash Total Total Cash Av Purchased spent Units Cash Remaining Price spent 526 49970 526 49970 30 95 12 960 538 50930 70 94.67 -9 -918 529 50012 70 94.54 12 1008 541 51020 62 94.31 The market price of Stock A, Smkt is defined as the observed trading price of Stock A. If Smkt > Savs you will sell $1,000 worth of Stock A in the portfolio to realise some profits. Else, if Sav > Smkt: you will buy $1,000 worth of A from the market. Only integer units of stock can be purchased. Any remaining cash is used together with the monthly amount of $1,000 for the subsequent stock purchase. For Month 1, show clearly that 12 units of stocks is purchased the cash remaining is $70 and the average price of the stock in the portfolio is $94.67. (8 marks) (6) Given the following initialisation in Python for your examination, design and write down Python code to calculate the integer units of A purchased with the given initial investment amount. Store the results in a Python list. init_invt = 50000 monthly_invt = 1000 init_price - 95 (2 marks) Given the following Python list of the market price of the stock, prices = [80, 102, 84, 41, 74, 55, 32, 77, 92, 40, 91, 26] use a Python_for_loop to implement and experiment with the investment strategy by composing suitable data structures. Report the final observed average price of A in the portfolio. (10 marks) You are carrying out the automation of the following investment strategy in Python. An initial investment amount of $50,000 is used to acquire Stock A. Every month, you are prepared to fork out a monthly amount of $1,000. The average price of Stock A in the portfolio, Sav is defined as the net amount of cash put into the portfolio divided by the total number of units of Stock A in the portfolio. Month Mkt Buy/Sell? Price 0 1 2 3 95 80 102 84 Buy Buy Sell Buy Units Cash Total Total Cash Av Purchased spent Units Cash Remaining Price spent 526 49970 526 49970 30 95 12 960 538 50930 70 94.67 -9 -918 529 50012 70 94.54 12 1008 541 51020 62 94.31 The market price of Stock A, Smkt is defined as the observed trading price of Stock A. If Smkt > Savs you will sell $1,000 worth of Stock A in the portfolio to realise some profits. Else, if Sav > Smkt: you will buy $1,000 worth of A from the market. Only integer units of stock can be purchased. Any remaining cash is used together with the monthly amount of $1,000 for the subsequent stock purchase. For Month 1, show clearly that 12 units of stocks is purchased the cash remaining is $70 and the average price of the stock in the portfolio is $94.67. (8 marks) (6) Given the following initialisation in Python for your examination, design and write down Python code to calculate the integer units of A purchased with the given initial investment amount. Store the results in a Python list. init_invt = 50000 monthly_invt = 1000 init_price - 95 (2 marks) Given the following Python list of the market price of the stock, prices = [80, 102, 84, 41, 74, 55, 32, 77, 92, 40, 91, 26] use a Python_for_loop to implement and experiment with the investment strategy by composing suitable data structures. Report the final observed average price of A in the portfolio. (10 marks)

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

Money Talks Explaining How Money Really Works

Authors: Nina Bandelj ,Frederick F. Wherry ,Viviana A. Zelizer

1st Edition

0691202893, 978-0691202891

More Books

Students also viewed these Finance questions