+ Reply to Thread
Results 1 to 5 of 5

Currency analysis

  1. #1
    Registered User
    Join Date
    02-20-2013
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    7

    Currency analysis

    Hi Guys,

    Im noob to excel and vba and have a question.

    Iv started currency trading, not the normal forex, but actual money transfers. Im after a template or macro that enables me to choose the best route to transfer money in between say 5-10 diffrent currencies that will enable a profit. for example say i buy 1000 usd using 1000 gbp which gives me 1530.10 usd then i transfer it into euro which gives me 1143.92 then transfer back into gbp which gives me 1000.66 gbp (a profit of 66p) i have the live exchange rates but need a tamplate to run the 5-10 currencies.

    Any help and info would be great.


    Thanks

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Currency analysis

    The problem is the same as traversing a directed graph where each edge is the exchange rate from one currency to the other, and you want to find a circuit (a path that begins and ends on the same node) with the product of the edges > 1 (i.e., more money than you started with). That's the traveling salesman problem (though on a directed graph; the TSP is undirected), which is NP. The general solution is to test all (N-1)! possibilities if you have N currencies and always start and end in one particular one. There are methods to attempt to reduce the number of evaluations, like branch and bound, but for only 10 currencies, there are only about 362K possibilities, so it could be done by exhaustion.

    If you want to test all 10-currency, 9-currency, 8-currency, ..., 3-currency circuits, that brings the total to about 410K possibilities.

    You picked a non-trivial exercise to start your VBA career.
    Last edited by shg; 02-21-2013 at 05:49 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    02-20-2013
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Currency analysis

    Hi Shg,

    Is there is a template around?

    Thanks

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Currency analysis

    None I know of, but I've never looked.

  5. #5
    Registered User
    Join Date
    02-20-2013
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Currency analysis

    No worries, I'll have a look around, Thanks for the info.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1