When you see a rate like EUR/USD of 1.6 / 1.61, it means this:

- Bid: 1.6; Quoter buys EUR and sells USD at 1.6
- Ask: 1.61; Quoter sells EUR and sells USD at 1.61

If you are on the receiving end, you always end up paying more or getting less! Note
**Bid <= Ask**
always.

- If you want to sell your 1 EUR, you will get 1.6 USD
- If you want to sell your USD, you will have to fork 1.61 USD for 1 EUR

A Cross Rate is sometimes calculated based on 2 other FX Rates going through a common currency, referred to as the Cross Currency. Given that the rates are following some market conventions whereby the USD is not always the main currency, the calculation is a bit more complex. Note the differences:

- EUR/USD: 1.2; 1 Euro gives you 1.2 USD
- USD/CAD: 1.1; 1 USD gives you 1.1 CAD
- GBP/USD: 1.6; 1 GBP gives you 1.6 USD

So what should the calculation be for EUR/GBP? or GBP/CAD? Furthermore the calculation becomes more confusing if you consider Bid and Ask...To put it simply in the words of "Mastering Financial Calculations":

- Given two exchange rates A/B and A/C, the cross rate are:
- B/C = A/C divided by A/B
- and C/B = A/B divided by A/C
- But you need to use the opposite side when calculating bid/ask, e.g.
- B.C Bid = A.C.bid / A.B.ask
- B.C Ask = A.C.ask / A.B.bid

- Given two exchange rates B/A and A/C, the cross rate are:
- B/C = B/A multiplied by A/C
- and C/B = 1 divided by (B/A multiplied by A/C)
- And you need to use the same side when calculating bid/ask, e.g.
- B.C Bid = A.C.bid * A.B.bid
- B.C Ask = A.C.ask * A.B.ask

The rates may be a bit old but they provide a non trivial set. Assuming, the calculator first checks for GBP cross ccy and then USD and the BASE rates below:

Currency Pair | Bid | Ask |
---|---|---|

EUR/USD | 1.30 | 1.11 |

GBP/CHF | 1.51589 | 1.5156 |

EUR/GBP | 0.79 | 0.796 |

USD/CAD | 103.931 | 103.94 |

USD/JPY | 1.089 | 1.090 |

And now the calculation examples

Currency Pair | Cross Ccy | Bid | Ask | Description |
---|---|---|---|---|

CAD/JPY | USD | 95.349541 [ bid(USD/JPY) / ask(USD/CAD) ]
calc = 103.931 / 1.090 = 95.349541 (rounded) |
95.445363 [ ask(USD/JPY) x ask(USD/CAD) ]
calc = 103.94 / 1.089 = 95.445363 (rounded) |
CAD.JPY Mkt Convention:true Cross Ccy:USD Quoter buys CAD and sells JPY at 95.349541 Quoter sells CAD and buys JPY at 95.445363 |

EUR/CHF | GBP | 1.197553 [ CHF/EUR = bid(GBP/CHF) / ask(GBP/EUR) ]
Note bid(GBP/CHF) = 1.51589
Note ask(GBP/EUR) = 1 / bid(EUR/GBP) = 1 / 0.79 = 1.265822785
calc = 1.51589 / 1.265822785 = 1.197553 |
1.206418 [ ask(GBP/CHF) / bid(GBP/EUR) ]
calc = 1.5156 / 1.256281407035 = 1.206418 (rounded to 6 dp) |
EUR.CHF Mkt Convention:true Cross Ccy:GBP Quoter buys EUR and sells CHF at 1.197553 Quoter sells EUR and buys CHF at 1.206418 |

Once you have an FXRate, you can call:

- getBid: bid (amount the quoter would buy Ccy1 for a given amount of Ccy2).
- getAsk: ask (amount the quoter would sell Ccy1 for a given amount of Ccy2).
- getMid: (bid+ask)/2
- convertAmountUsingBidOrAsk: Given a monetary amount in the original currency, calculate the resulting amount in the other currency, using BID or ASK.
- getPaymentAmountForBuying: to get the amount you would get by buying a currency amount.
- getReceiptAmountForSelling: to get the amount you would get by selling a currency amount.

The code is available here: