Message Boards Message Boards

0
|
246 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

CurrencyConvert in version 14.1

Posted 23 days ago

Hello! I just upgraded Mathematica from v. 12.1 to 14.1, and I have a quite basic problem with currency conversion! Formerly, the code hereunder

Clear["Global`*"];

port = {"NASDAQ:COST", "NASDAQ:NFLX", "NYSE:LMT", "PA:SU", 
   "NASDAQ:AMZN", "PA:AM"};
EnClair = Map[FinancialData[#, "Name"] &, port]
début = DayRound[DatePlus[{-18, "Month"}], "BusinessDay"]
Prix = CurrencyConvert[
     FinancialData[#, "Price", {début, Date[]}, "DateValue"], 
     "USDollars"] & /@ port;  
\[Eta] = 0.9;
Fractiles = Map[QuantityMagnitude@Quantile[#, \[Eta]] &, Prix];
Print@MapThread[
   DateListPlot[#1, Frame -> True, Filling -> #2, PlotRange -> All, 
     PlotLabel -> #3 <> " ; \[Eta]=" <> ToString@\[Eta]] &, {Prix, 
    Fractiles, EnClair}];

resulted in a plot of time series, but this doesn't work in v14, because "Prix" cannot be computed anymore (this is endless). What should I do?

Best regards, Claude.

POSTED BY: Claude Mante
2 Replies
Posted 23 days ago

I have tried your example in 12.3 where it works as expected. But 14.0 and 14.1 seems unable to handle Schneider Electric and Dassault Aviation. Removing them returns a result:

port = {"NASDAQ:COST", "NASDAQ:NFLX", "NYSE:LMT", "NASDAQ:AMZN"};
EnClair = Map[FinancialData[#, "Name"] &, port]
début = DayRound[DatePlus[{-18, "Month"}], "BusinessDay"]
Prix = CurrencyConvert[
     FinancialData[#, "Price", {début, Date[]}, "DateValue"], 
     "USDollars"] & /@ port;  
\[Eta] = 0.9;
Fractiles = Map[QuantityMagnitude@Quantile[#, \[Eta]] &, Prix];
Print@MapThread[
   DateListPlot[#1, Frame -> True, Filling -> #2, PlotRange -> All, 
     PlotLabel -> #3 <> " ; \[Eta]=" <> ToString@\[Eta]] &, {Prix, 
    Fractiles, EnClair}]
POSTED BY: Hans Milton

Thanks for your answer, Hans.

But, excepted both these cases, all the assets of the list are labelled in $, while Schneider Electric and Dassault Aviation are labelled in € and need a conversion.

Regards,

Claude

POSTED BY: Claude Mante
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract