Skip to content

Instantly share code, notes, and snippets.

@quantra-go-algo
Last active May 21, 2025 23:39
Show Gist options
  • Save quantra-go-algo/49a39734d0fb8272b305af0f48f913e3 to your computer and use it in GitHub Desktop.
Save quantra-go-algo/49a39734d0fb8272b305af0f48f913e3 to your computer and use it in GitHub Desktop.
# Download the GBPUSD data from 2003 to 2013
data = yf.download('GBPUSD=X', start='2003-12-01', end='2023-10-06', auto_adjust=True, group_by='ticker')['GBPUSD=X']
# Compute the log returns
data['returns'] = np.log(data['Close']/data['Close'].shift(1))
# Print the data
data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment