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 \div Average Loss During Down Periods ))]
Average Gain = [(Past Average Gain) \times 13 + Current Gain] \div 14
Average Loss = [(Past Average Loss) \times 13 + Current Loss] \div 14
Notes:
\begin{itemize}
\item Do NOT use any python library functions like Pandas.
\item Make sure to include comments to explain the code.
\end{itemize}