Question: python Consider a scenario where you are tasked with developing an algorithmic trading strategy in Python. The historical price data for a given financial instrument
Consider a scenario where you are tasked with developing an algorithmic trading strategy in Python. The historical price data for a given financial instrument is provided in a CSV file named "orcl.csv." The file contains columns for "Date," "Open," "High," "Low," "Close," and "Volume.". Task-1: Load the historical data from the file orcl.csv into a list of dictionaries. Task-2: Calculate two technical indicators: i) Simple Moving Averages for a 5-day window ii) Relative Strength Index (RSI) for a 14-day window Task-3: Write each indicator to a file: Moving Averages to the file orcl-sma.csv and RSI to the file orcl-rsi.csv. RSI Definition: RSI =100[100(1+( Average Gain During Up Periods Average Loss During Down Periods ))] Average Gain =[( Past Average Gain )13+ Current Gain ]14 Average Loss =[( Past Average Loss )13+ Current Loss ]14 Notes: - Do NOT use any python library functions like Pandas. - Make sure to include comments to explain the code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
