Category Archives: finance

Graph currency rates over time in C#

This example, which shows how to graph currency rates for a specific currency, is a bit longish. Sorry about that. It uses Yahoo Query Language (YQL), which you can use to perform a wide variety of queries on Yahoo’s data. … Continue reading

Posted in finance, internet, mathematics, web | Tagged , , , , , , , , , , , , , , , , , , , , , , , | 3 Comments

Get currency exchange rates in C#

This example shows how you can get currency exchange rates from finance.yahoo.com. When it starts, the program uses the following code to get the currency exchange rates. // Get the currency symbols. private void Form1_Load(object sender, EventArgs e) { string … Continue reading

Posted in finance, internet, mathematics, web | Tagged , , , , , , , , , , , , , , , , , , , | 3 Comments

Get stock prices from different exchanges in C#

The example Get stock prices from the internet in C# shows how to download stock prices from download.finance.yahoo.com. It builds a URL of the following form to get prices for MCI, DIS, COKE, and PEP: http://download.finance.yahoo.com/d/quotes.csv?s=MCI+DIS+COKE+PEP&f=sl1d1t1c1 To get prices from … Continue reading

Posted in finance, internet, mathematics, web | Tagged , , , , , , , , , , , , , | 1 Comment

Compare fuel efficiency in different units in C#

People in the United States, Canada, the United Kingdom, and several other places measure a car’s fuel efficiency in miles per gallon. As you might expect, countries that use the metric system may measure fuel efficiency in kilometers per liter, … Continue reading

Posted in finance, mathematics | Tagged , , , , , , , , , , , , , , , | Leave a comment

Compare car costs including long term mileage in C#

This example calculates the total car costs including gas use. Some cars that seem less expensive than others actually cost more in the long run because they get worse gas mileage. Enter the total number of city and highway miles … Continue reading

Posted in finance, mathematics | Tagged , , , , , , , , , , | Leave a comment

Test investment strategies with Dow Jones data in C#

Important Note: I am not a tax or investment professional so you need use your own judgement when evaluating these investment strategies. I don’t even pretend to understand this stuff. This is a very simple tool for playing with numbers … Continue reading

Posted in algorithms, finance, graphics, mathematics | Tagged , , , , , , , , , , , , , , | Leave a comment

Graph historical Dow Jones Industrial Average values in C#

This program graphs historical prices for the Dow Jones Industrial Average. I got the data from this URL: ichart.finance.yahoo.com/table.csv?s=^DJI&a=0&b=1&c=1990&d=0&e=1&f=2020&g=d&ignore=.csv The fields in the URL are: s=^DJI – Get Down Jones Industrial data a=0 – The start month number is 0 … Continue reading

Posted in finance, graphics, mathematics | Tagged , , , , , , , , , , , , , , | 3 Comments

Calculate interest for a loan in C#

This example uses three different methods for calculating interest on a loan. Enter the start and end dates for the loan, the annual interest rate, and the initial principle. When you click the Calculate button, the program calculates the loan’s … Continue reading

Posted in algorithms, finance, mathematics | Tagged , , , , , , , , , , | Leave a comment

Calculate credit payments in C#

For each month the program: Calculates the payment first. This is either a percent of the balance or the minimum amount, whichever is greater. Calculates interest after the payment is calculated but before it is subtracted from the balance. Adds … Continue reading

Posted in algorithms, calculations, finance, mathematics | Tagged , , , , , , , , , , , , , | Leave a comment

Calculate the value of a monthly investment in C#

The magic of an investment with compound interest is that, over time, you get interest on the interest. For each month this program calculates the interest on the account balance. It then adds the interest and a monthly contribution to … Continue reading

Posted in algorithms, calculations, finance, mathematics | Tagged , , , , , , , , , , , | 1 Comment