search for: currencies

Displaying 20 results from an estimated 276 matches for "currencies".

2011 Oct 12
1
scopes related question
Hello, Have a question related scope definition. I need to define a scope based on related model attribute values like this. class Product < ActiveRecord::Base belongs_to :currency scope :with_currency, lambda { |currency| unless currency.to_s.upcase == ''ALL'' # here I need to define a scope that would test for currency.char_code to match a passed value # something
2006 Jun 18
13
Currency calculation
I''m thinking of experimenting with some currency conversion. However, I''d like the conversions to be in synch with the current rates. Anyone know (and this maybe out in left field) if there is some online (perhaps xml) or other data stream I can connect with in my code to output values based on user selection ? TIA Stuart
2006 Mar 25
4
Rails PayPal and Currencies other than USD
Has anyone been able to make direct API calls to PayPal in currencies other than USD? I get an error message "The currency code submitted is not supported. Check the currency code and try again." I''m using the PayPal plugin for Rails. I can successfully transact in USD, but not AUD (Australian Dollars). Cheers, Dan
2013 Apr 03
4
Better way of writing R code
...  }     else if (as.character(other_currency) == "EURO" & (days_to_maturity > 1 & days_to_maturity <= 7))   {   libor_rate1 = df_LIBOR_rates$USD_1w   libor_rate2 = df_LIBOR_rates$EUR_1w   } ............................ ............................ Similarly for other currencies too ... # __________________________________________________ # My PROBLEM In reality, I am dealing with at least (for the time being and will only increase in future) 10 currencies (LIBORs) only and each currency has about 15 tenors. So effectively, I have ended up writing 45*15*15 = 10125 such...
2011 Jan 07
1
Calculating Returns : (Extremely sorry for earlier incomplete mail)
Dear R forum helpers, I am extremely sorry for the receipt of my incomplete mail yesterday. There was connectivity problem at my end and so I chose to send the mail through my cell, only to realize today about the way mail has been transmitted. I am again sending my complete mail through regular channel and sincerely apologize for the inconvenience caused. ## Here is my actual mail Dear R
2011 Apr 09
1
How do I make this faster?
...g changes. I've marked the places where Rprof showed me it was slowing down: currencyCorrelation <- function(lagtime = 1) { require(quantmod) dataTrack <- getSymbols(commandArgs(trailingOnly=T)[1], from='2009-11-21', to='2011-04-03') stockData <- get(dataTrack) currencies <- row.names(oanda.currencies[grep(pattern='oz.', fixed=T, x =as.vector(oanda.currencies$oanda.df.1.length.oanda.df...2....1.)) == F]) correlations <- vector() values <- list() # optimise these loops using the apply family for (i in currencies) { for (j in currencies) {...
2011 Jan 07
1
Currency return calculations
...URO = c(42.71, 42.68, 41.86, 44.71, 44.14, 44.58, 41.07, 42.23, 44.55, 41.12), CHF  = c(41.5, 41.47, 42.84, 43.44, 43.69, 42.3, 42.05, 41.23, 42.76, 43.79), AUD  = c(109.55, 102.52, 114.91, 122.48, 122.12, 123.96, 100.36, 110.19, 121.58, 103.46))   I have a portfolio consisting of some of these currencies.   At this moment, suppose my portfolio has following currency transactions. i.e following is my current portfolio and has 2 USD transactions, 2 EURO transactions and a CHF transactions.   portfolio_currency_names = c("USD", "USD", "EURO", "CHF", "...
2006 Feb 28
12
Examples for Money library ?
Can anybody share some examples of their Money implementation ? I''m trying to setup a Model to use this library, but can''t seem to wrap my head around how it is exactly supposed to work. My Model (Foo) looks like: =============== composed_of :commission, :class_name => "Money", :mapping => [ %w(commission_cents cents), %w(commission_currency currency) ] Yet, in
2013 Apr 25
1
Linear Interpolation : Missing rates
...EURO_2w  1.98 31   EURO_2w  1.97 32   EURO_2w  1.97 33   EURO_2m  2.10 34   EURO_2m  2.09 35   EURO_2m  2.09 36   EURO_2m  2.11 As can be seen that USD_2w, GBP_2w and EURO_1m are missing and I need to INTERPOLATE these rates, which can be done using approx or approxfun. In reality I can have many currencies with many tenors. Problem is when the data.frame "df" is read or accessed in R, I am not aware which tenor is missing. For a given currency, it is possible that mare than 1 consecutive tenors may be missing e.g. in case of EURO, I may have EURO_1w, EURO_2w and then EURO_4m. So EURO_1m, EU...
2008 Jun 29
2
How to write test about validates_associated
Here is my model: class Account < ActiveRecord::Base has_many :users, :dependent => :destroy has_many :bus belongs_to :currency has_many :mylogs, :dependent => :destroy has_many :batchuserdefines, :dependent => :destroy has_many :materialuserdefines, :dependent => :destroy has_many :materials has_many :inventories has_many :batchs has_many :courses has_many
2013 Apr 16
3
Splitting the Elements of character vector
Dear R forum I have a data.frame df = data.frame(currency_type = c("EURO_o_n", "EURO_o_n", "EURO_1w", "EURO_1w", "USD_o_n", "USD_o_n", "USD_1w", "USD_1w"), rates = c(0.47, 0.475, 0.461, 0.464, 1.21, 1.19, 1.41, 1.43))   currency_type     rates 1      EURO_o_n   0.470 2      EURO_o_n   0.475 3       EURO_1w   0.461
2006 Mar 03
1
number_to_currency() helper == non DRY == could be improved
...newbie ;-) Going through the Apple ADC RoR tutorial it suddenly occurred to me that the ''number_to_currency()'' helper method was not DRY streamlined. Scenario:: The "number_to_currency()" methods options hash works great when I need to dynamically display different currencies when I call "number_to_currency()", as long a I have an idea of what the currency should be each time ;-) But, what if I want all instances of a currency to display as GBP, ?, SEK or any other currency ? Then I would have to create a CONSTANT for that currency and then include th...
2011 Jan 07
0
Odp: Currency return calculations
....86, 44.71, 44.14, 44.58, 41.07, 42.23, 44.55, 41.12), > CHF  = c(41.5, 41.47, 42.84, 43.44, 43.69, 42.3, 42.05, 41.23, 42.76, 43.79), > AUD  = c(109.55, 102.52, 114.91, 122.48, 122.12, 123.96, 100.36, 110.19, 121. > 58, 103.46)) > > I have a portfolio consisting of some of these currencies. > > At this moment, suppose my portfolio has following currency transactions. i.e > following is my current portfolio and > has 2 USD transactions, 2 EURO transactions and a CHF transactions. > > portfolio_currency_names = c("USD", "USD", "EURO"...
2009 Oct 14
3
currency conversion function?
Dear all Is there any R function that would perform currency conversion using up-to-date exchange rates? I would be looking for a function that allows to download recent exchange rates (say, from Yahoo!) and then use these in converting currencies (say, USD to EUR). I am not sure whether r-sig-finance would be more appropriate, but the (off-)topic feels general enough to me. Thank you Liviu -- Do you know how to read? http://www.alienetworks.com/srtest.cfm Do you know how to write? http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#...
2006 Sep 17
2
currency or stock trading strategy
Hi, are there any good charting and analysis tools for use with currencies, stocks, etc. in R? I have some tools to download currency data from the NYFRB using python and XML. Can we get and parse an XML download using R? Can we have interaction in R plots? Does anyone use R for back-testing trading strategies? Are there any forums for discussion of using R for this...
2006 Jan 17
2
money data types
What data type is best for storing currency? I''m trying to come up with a reliable cross-database solution for rails that is not too complicated. Since I''m going to have currency fields all over the place, I''m not so sure that using two integer fields for each amount would qualify as uncomplicated. I''d like to be able to use database functions like SUM to
2006 May 08
2
Creating a "Foo has_many bars" association where bar isn''t a model.
Hi Let''s say we have model Foo. Each Foo instance can have several bars. Those bars are primitive, so they shouldn''t be models. For example, Foo might be a type of convention, and the bars might be years the convention was held in. Naively, we would have a conventions_years date, and put: has_many :years inside class Convention. But then we''d get an error, since for
2010 Feb 24
2
How to read percentage and currency data?
I'm struggling to find any help on this seemingly simple question - how does one read data with percentage (%) or currency (?,$ etc.) signs? When I try to read a data file which has any of those symbols in the data fields, they are read as characters rather than values. Is there a function or library which can deal with such values? As an example, I use this sample from one of chinna's
2012 Nov 21
3
Problems understanding use of regular expression (in gsub) for manipulating currency
Hello, After reading help file, various threads on this board, and other online tutorials, I've attempted to use gsub (using Perl-like syntax) to change a currency string into something that can be converted to numeric type using only one regular expression.  Can anybody point out my error?  Note that >  x <- "\"$ 1,200,300,400.50\"" Tried the following in an
2009 Sep 24
1
Downloading currency data from from Yahoo
Hi, I wanted to download some currency data using "quantmod" package, however got following error : > getSymbols('USD/GBP',src='yahoo') Error in download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, : cannot open URL