2
$\begingroup$

I'm working with Financial Data and I'm using this code:

DateListPlot[{FinancialData["SP500", 
"CumulativeFractionalChange", {2000}], 
FinancialData["DAX", "CumulativeFractionalChange", {2000}]}, 
ImageSize -> Large, Joined -> True, Filling -> Bottom]

enter image description here

But, my aim is to compare the "cumulative fractional change", of the two time series, in the same currency values (for example all in euro, or all in dollar). Infact, "sp500" is denominated in Dollar, and Dax in Euro. How I can do to convert and plot both in the same currency ?

$\endgroup$

closed as unclear what you're asking by José Antonio Díaz Navas, Henrik Schumacher, PlatoManiac, Carl Woll, MarcoB Mar 27 '18 at 23:28

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    $\begingroup$ I'm not sure about this, but would a fractional change not imply that you have a ratio of say x/y where both x and y are in the same currency and currency unit cancels out? This might be a stupid question though. $\endgroup$ – halirutan Feb 4 '18 at 16:56
  • $\begingroup$ You can try this extremely slow Quantitiy stuff in mma. I think it proves probably @halirutan right. currency = {"USDollars", "Euros"}; convert[Rule[a_?(MemberQ[currency, #] &), b_?(MemberQ[currency, #] &)]][pair_] := If[Length@pair >= 1, With[{val = #}, ({#1, Evaluate@ CurrencyConvert[Quantity[#2, DatedUnit[a, #1]], DatedUnit[b, #1]]} & @@ val) /. Quantity[x_, y__] -> x] & /@ pair, $Failed]; $\endgroup$ – PlatoManiac Feb 4 '18 at 17:35
  • $\begingroup$ Now plot it: {DateListPlot[{FinancialData["SP500","CumulativeFractionalChange",{2018}],convert[ "Euros"-> "USDollars"][FinancialData["DAX","CumulativeFractionalChange",{2018}]]},ImageSize->Large,Joined->True,Filling->Bottom],DateListPlot[{convert[ "USDollars"-> "Euros"][FinancialData["SP500","CumulativeFractionalChange",{2018}]],FinancialData["DAX","CumulativeFractionalChange",{2018}]},ImageSize->Large,Joined->True,Filling->Bottom]}//Row and compare them with your plot for year 2018. It seems units cancels out in this metric. $\endgroup$ – PlatoManiac Feb 4 '18 at 17:37
  • $\begingroup$ @PlatoManiac I tried your code but, seems there's some problem due to inflation adjust in time. When I try the code appears this Message: InflationAdjust::insfferd: Cannot fetch exchange rate conversion data for Euros to USDollars for {.........}. Where in "......" there are a series of data (single event, not continuos) in the time when, I suppose, inflation was adjusted by the provider of the financial data. $\endgroup$ – Giuseppe Vonella Feb 8 '18 at 23:31