subject
Computers and Technology, 20.11.2020 16:40 krlx

Objective: Write a program that will read and parse data from a file, then make use of lists to solve a problem. Problem: Using python, write a program that will compute the maximum possible profit for a stock trade using historical data on a selection of companies. We would like to find the maximum possible profit that we could have gained, if we had made an ideal investment (if we ever finish that time machine). We must determine the largest increase in value from the purchase date to the sell date, using historical information. We will use the daily low price to purchase and the daily high price to sell a stock. For this assignment, we will use actual freelyavailable stock data stored in .CSV (comma separated values) format from Yahoo finance. A significant part of the exercise is learning to read and parse data from files and to format output.
1. Request the name for the input data file to be used to determine the results. You will have to run your program on all of the data sets to generate the required results. If the program does not exist, print a warning message and allow the user to try again.
2. Read in all the data from the requested file and parse the data; extracting the useful bits into one or more lists.
3. Use the data to determine the largest gain possible in a stock price by comparing Low values as the purchase price and High values as the sale price.
4. Report for each stock symbol (AAPL, AMZN, GOOG, MSFT, and TSLA) the purchase and sale days, the purchase and sale prices, profit per share, and the ratio of the change in value. Enter these results as submission comments in Blackboard.
5. Continue to request file names until the user enters a blank name (empty string), then exit the program.
6. Use good functional style and suitable variable names.
7. In the submission comment, answer the question: If you could travel back in time and invest in one of the five stocks listed, which stock would you pick?
Note: Assume that you must keep stocks for at least one day, no buying and selling on the same day. The data files contain more data than is needed, be sure to use the correct values. Be sure to move the data files into the same folder as your code so that your program can find the data files.
Example Output and Results: Please enter the data file name: BLARG. csv
Error Reading data ...
The file does not exist. Please check the name and try again.
Please enter the data file name: GOOG. csv
Reading data ...

The maximum profit is 1045.88 per share
Buy on 2015-01-12 at a price of 486.23
Sell on 2020-02-19 at a price of 1532.11
Change in value ratio: 3.151

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 15:30
Write a program in plp assembly that counts up by one starting from zero (or one) inside a loop and writes this value to the leds every time the value is increased. the memory address of the leds is 0xf0200000. the table below shows the meaning and an example usage of the instructions covered in the video, plp instructions for project 1. instruction example usage meaning load immediate li $t0, 8 register $t0 is set to the value, 8. store word sw $t2, 0($t1) the value in register $t1 is used as the memory address. the value in register $t2 is copied into this memory address. add addiu $t4, $t3, 29 register $t4 is assigned the sum of 29 and the value in register $t3. jump j your_label_name the program jumps to the line following the label, "your_label_name: ". label your label name: defines a label called "your_label_name: " that can be jumped to
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
Companies that implement and apply an information system effectively can create
Answers: 1
question
Computers and Technology, 23.06.2019 18:20
What is wi-fi infrastructure? a metropolitan area network that uses radio signals to transmit and receive data a communications technology aimed at providing high-speed wireless data over metropolitan area networks a means by which portable devices can connect wirelessly to a local area network, using access points that send and receive data via radio waves includes the inner workings of a wi-fi service or utility, including the signal transmitters, towers, or poles and additional equipment required to send out a wi-fi signal
Answers: 2
question
Computers and Technology, 23.06.2019 21:20
For positive constants a and b, the force between two atoms in a molecule is given f(r) = −a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
Answers: 1
You know the right answer?
Objective: Write a program that will read and parse data from a file, then make use of lists to solv...
Questions
question
World Languages, 05.01.2020 16:31
question
Mathematics, 05.01.2020 16:31
Questions on the website: 13722361