AUD vs USD Gold

GVAD vs VGS

start_date = "2019-01-13"

read_csv("fx_rates/AUD_EUR.csv") %>%
  filter(date >= start_date) %>%
  mutate(date = as.Date(date)) %>%
  mutate(cum_return = fx_rate) %>%
  select(date, cum_return) %>%
  mutate(signal = "AUD_EUR") -> to_bind3


tq_get(c("VGAD.AX", "VGS.AX")) %>%
  filter(date >= start_date) %>%
  select(symbol, date, adjusted) %>%
  filter(!is.na(adjusted)) %>%
  arrange(date) %>%
  group_by(symbol) %>%
  mutate(simple_return = (adjusted/lag(adjusted) - 1)) %>%
  mutate(simple_return = ifelse(is.na(simple_return), 0 , simple_return)) %>%
  mutate(cum_return = cumprod(1 + simple_return) - 1) %>%
  ungroup() %>%
  mutate(signal = symbol) %>%
  select(date, cum_return, signal) %>%
  bind_rows(to_bind1, to_bind3) %>%
  ggplot(aes(x = date, y = cum_return, colour = signal)) +
  geom_line() +
  scale_x_date(date_breaks = "2 weeks") +
  theme(axis.text.x=element_text(angle=60, hjust=1))
LS0tCnRpdGxlOiAiUiBOb3RlYm9vayIKb3V0cHV0OiBodG1sX25vdGVib29rCi0tLQoKYGBge3Igc2V0dXAsIGluY2x1ZGU9RkFMU0UsIGVjaG89RkFMU0V9CmtuaXRyOjpvcHRzX2NodW5rJHNldChlY2hvID0gVFJVRSkKCmxpYnJhcnkocmVhZHhsKQpsaWJyYXJ5KGh0dHIpCmxpYnJhcnkodGlkeXF1YW50KQpsaWJyYXJ5KHRpZHl2ZXJzZSkKbGlicmFyeShsdWJyaWRhdGUpCgojIGRpc2FibGUgc2NpZW50aWZpYyBub3RhdGlvbgpvcHRpb25zKHNjaXBlbj05OTkpCgojIFNldCBxdWFuZGwgQVBJIGtleQpxdWFuZGxfYXBpX2tleShTeXMuZ2V0ZW52KCJRVUFORExfS0VZIikpCiMgU2V0IGFscGhhIHZhbnRhZ2UgQVBJIGtleQphdl9hcGlfa2V5KCIiKSAjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMK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