-Load the daily stock prices for Apple Corporation (stock tickerAAPL) data from yahoo finance, from Jan 2nd 2020 through Dec 31st 2020. note: you will not include Jan 1st 2020 since its a holiday (New Years day) -Run a mean reversion trading strategy on the data. -Output the results of the strategy including the profits (see sample output below).finance.yahoo.com -> search “AAPL” -> Historical data -> enter Time Period: start date 01/02/2020, end date 01/01/2021 (one day higher than 12/31/2020) -> Apply -> click Download (right under Apply)# Note: your file path below needs to match the full file path of the file your created in c9# Some of your paths will be /home/ubuntu/environment# You can check that in cloud9 by looking next to the top level folder with the same# name as your environmentfile = open(“/home/ec2-user/environment/hw4/AAPL.txt”)lines = file.readlines()for line in lines:price = float(line) price = round(price, 2) # to round the price to 2 decimalsprint(price)I do know goes after this codeCoding Requirements-Loop through all the prices, calculating a 5 day moving average each time.-Each iteration of the loop should update the current_price (the newest line), and the 5 day moving average (the average of the previous 5 days).-Add an if statement which checks to see if the current price is below the 5 day moving average * .95. If it is, “buy” the stock, meaning keep track of the price you bought at. Update a variable called “buy” with the buy price.-Add an elif statement along with the if statement which checks to see if the current price is above the 5 day moving average * 1.05. If it is, “sell” the stock, meaning calculate the profit of that trade: sell – buy. You want to buy low and sell high, so sell – buy is hopefully positive.-Add an else statement along with the if else if which does not buy or sell.Can someone help with this it seems a lot but professor says it not that bad. thank youComputer ScienceEngineering & TechnologyPython Programming DATA ANALY 3500
solved : -Load the daily stock prices for Apple Corporation (stock
How it works
- Paste your instructions in the instructions box. You can also attach an instructions file
- Select the writer category, deadline, education level and review the instructionsÂ
- Make a payment for the order to be assigned to a writer
- Â Download the paper after the writer uploads itÂ
Will the writer plagiarize my essay?
You will get a plagiarism-free paper and you can get an originality report upon request.
Is this service safe?
All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades
LET THE PROFESSIONALS WRITE YOUR PAPER!