Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The pandemic, geo-political instability, and rising inflation have had a significant effect on the price of gold in recent years. The file ce4_Gold. csv contains
The pandemic, geo-political instability, and rising inflation have had a significant effect on the price of gold in recent years. The file ce4_Gold. csv contains data on the daily price of one Troy ounce of gold for the last ten years. Load its content into a DataFrame called gold . Choose the appropriate index for this DataFrame and parse the date variable (as a datetime object). gold = pd.read_csv("ce4_gold.csv", index_col="date", parse_dates=["date" ]) gold. head( ) To test whether a simple momentum strategy would work in the gold market add a new column to gold called signal equal to +1 if the change of the gold price over the previous 126 days is posive and -1 otherwise. At the end of the calculation gold should only have these two columns. (Point 1 Mark). The pandemic, geo-political instability, and rising inflation have had a significant effect on the price of gold in recent years. The file ce4_Gold. csv contains data on the daily price of one Troy ounce of gold for the last ten years. Load its content into a DataFrame called gold . Choose the appropriate index for this DataFrame and parse the date variable (as a datetime object). gold = pd.read_csv("ce4_gold.csv", index_col="date", parse_dates=["date" ]) gold. head( ) To test whether a simple momentum strategy would work in the gold market add a new column to gold called signal equal to +1 if the change of the gold price over the previous 126 days is posive and -1 otherwise. At the end of the calculation gold should only have these two columns. (Point 1 Mark)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started