[R-SIG-Finance] calendar to trading days

Jeff Ryan jeff.a.ryan at gmail.com
Wed Nov 21 16:12:33 CET 2007


Hi Alex,

I think 'trading days' may be open to interpretation with respect to
FX - sort of up to you : )

As a start with quantmod ( http://www.quantmod.com and on CRAN ) you can try:

# get the rates in a zoo object indexed by Date as an object JPYUSD in
your environment
getSymbols("JPYUSD",src='oanda')

# now just the weekdays:
USDJPY[!weekdays(JPYUSD) %in% c('Sunday','Saturday')]

# and if you always take off monday as well ; )
USDJPY[!weekdays(JPYUSD) %in% c('Monday','Sunday','Saturday')]

You could further subset that by by a list of trading holidays...
One of probably an infinite solution set.

Another option from quantmod is sourcing the data from FRED, which is
the noon spot rate
per US weekday:

getSymbols("DEXJPUS",src="FRED")

Info on FRED FX is here: http://research.stlouisfed.org/fred2/categories/94

Without quantmod you won't have the quantmod weekdays.zoo function so
you'll have to spend a bit more
time typing to get what you want.

Jeff


On Nov 20, 2007 10:38 PM, Alexander Moreno <alexander.f.moreno at gmail.com> wrote:
> Hi,
>
> Is there some way to convert Oanda's get.hist.quote to trading days
> instead of calendar days using some simple technique?
>
> Thanks,
> Alex
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>



More information about the R-SIG-Finance mailing list