|
I don't really have much to offer that Naggy hasn't addressed. But I'll say this... it is possible to get the rate data without a broker's margin, but for that kind of feed you'll need to pay some moola or avoid using a broker for the data altogether and stick with Google or Yahoo et al and just accept the lag those APIs will give you.
Also, if you're doing this for an online business, I'd suggest always, always storing prices in a base currency (even for past orders) and also the currency of the sale along with the exchange rate at that point in history. It'll make your life a lot easier if you only have to think about one currency (preferably the currency you'll be paying taxes in for the company) and deal with exchanges on a case-by-case basis.
Not sure who you'll be processing payments through, but services like PayPal will handle this stuff for you btw. It's a pretty common problem...
ConvertCurrency API Operation - PayPal Developer[^]
Jeremy Falcon
|
|
|
|
|
I am using something I found from
http:
[
"https://openexchangerates.org/api/latest.json?app_id=04f370f1bf4a4ea7a386ade58f07d0e5" ]
myConnection.DownloadFile(Dts.Connections["OpenExchCurrency.json"].ConnectionString, true);
Have SQL 2012 so had to implement reading the JSON file format as a flat file, pretty simplistic it just ignores the first six lines of the file and starts with (example data)
"AED": 3.672761,
"AFN": 67.383551,
Once I read that into a table, parse (known 3 character positional for currency code, ":" to "," for value) for the four currencies I care for for the day. Added an AVG30Days and an AVGPeriod calculation. Then as someone else pointed out, I used a web based CSV request to get and add history back as far as my data goes. from before I had this option.
|
|
|
|
|
Great. Thank you.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Probably too simple but I use a call to google:
{
URI = "http://finance.google.com/finance/converter?a=1&from=NZD&to=" + Currencies[Counter];
System.Net.WebRequest req = System.Net.WebRequest.Create(URI);
try
{
System.Net.WebResponse resp = req.GetResponse();
StreamReader sr = new StreamReader(resp.GetResponseStream());
tmp = sr.ReadToEnd().Trim();
sr.Dispose();
}
and then parse the result.
|
|
|
|
|
Cool, thanks.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
|
I use the https://www.oanda.com/fx-for-business/exchange-rates-api API which works just great for my needs - tracking USD <-> GBP every minute 24/7
|
|
|
|
|
Maintain separate accounts.
Only convert on-the-fly when reporting; "actual" conversion when laundering.
Maintain a list of daily conversion rates for reporting.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
And I got to one section ... Survey.jpg
I'm reasonably sure they didn't mean to show the "Randomizing section" to punters, but I do wish they had chosen different letters. Kinda shows what they think of me, really...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
A key to a good customer relations is sincerity.
... such stuff as dreams are made on
|
|
|
|
|
James fan is a Bad Singer with Sting and loses a thousand (8)
modified 30-Oct-17 5:46am.
|
|
|
|
|
Jacobite?
Jacko minus the k + bite = sting?
Bit controversial if I'm right, as Jacko was a a way better singer than Mr. Sting!
98.4% of statistics are made up on the spot.
|
|
|
|
|
Well done you're correct.
Not controversial though as the Bad is capatalised as in the singer of Bad.
|
|
|
|
|
Ah, yes! I'd forgotten that one.
98.4% of statistics are made up on the spot.
|
|
|
|
|
Someone decided to write an entire AngularJS application of ~100k lines in a single file
And now here I am swimming through a lake of javas**t to find out why something works. And, to add to the infinite _crazyness_, the app depends on a cordova plugin that will only run on an android device. (Can't use remote debugging either, due to an ancient cordova version).
Beauty cannot be defined by abscissas and ordinates; neither are circles and ellipses created by their geometrical formulas.
Carl von Clausewitz
Source
|
|
|
|
|
ΑlphaΔeltaΘheta wrote: entire AngularJS application of ~100k lines in a single file
Oh, the laziness that later kills! All the original dev had to do was break it up.
ΑlphaΔeltaΘheta wrote: Can't use remote debugging either
I explained this same problem to a dev long ago -- with another JavaScript-based app (written in classic ASP).
The dev told me, "I don't need a debugger. I debug it in my head." He thought he was a genius.
Well, yeah, I understand that knowing what the code is doing is great and all but using debugging tools is like using power tools (instead of hand tools)...it's quite a bit faster.
Good luck.
|
|
|
|
|
ΑlphaΔeltaΘheta wrote: Can't use remote debugging either
raddevus wrote: written in classic ASP
Reminds me of old times! You had to get creative with debugging...displaying variable contents, redirecting to a special page to show results, etc. Classic ASP (or even php) was way more logical to me than .NET where things can happen all over the place...mostly just building the page from the top down...and everything was a string! Do I miss it? Absolutely not!
"Go forth into the source" - Neal Morse
|
|
|
|
|
You must have upset the gods at some point in your life.
|
|
|
|
|
Same but in C. I still have nightmares.
GCS d-- s-/++ a- C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
100k lines? I will retire now and stop $itching about my 1500 line file....
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
After being assigned this one, I seriously considered retirement now.
Beauty cannot be defined by abscissas and ordinates; neither are circles and ellipses created by their geometrical formulas.
Carl von Clausewitz
Source
|
|
|
|
|
ΑlphaΔeltaΘheta wrote: Someone decided to write an entire AngularJS application of ~100k lines in a single file
I thought there was some sort of rule or even law that mandated that?
Couldn't break it up until the editor would no longer display it.
|
|
|
|
|
|
Sorry all I'm stuck in a meeting all morning and haven't got a CCC prepared - can anyone stand in for me ?
We can’t stop here, this is bat country - Hunter S Thompson RIP
modified 30-Oct-17 5:53am.
|
|
|
|
|