I'm trying to build an automated forex trading system and I'm trying to understand how to calculate the number of units I should specify for each trade in different scenarios. Say for example I have an account with a broker in USD and I've deposited $1000. Ignoring leverage, I'd like to allocate my entire balance in each of the following scenarios. In each scenario I've tried to explain how I think the calculation should be performed.. # Going Long Long USD/JPY Buy USD, sell JPY USD is the base currency so units (USD) = 1000 Long EUR/USD Buy EUR, sell USD units (EUR) = 1000 / [EUR/USD].Ask Long EUR/JPY Buy euros, sell yen How many yen can we get with 1000 dollars? Buy yen with dollars Instrument = USD/JPY USD (selling) is the base currency so multiply by the bid So yen = 1000 * [USD/JPY].Bid units (EUR) = yen * [EUR/JPY].Ask Update: units (EUR) = yen / [EUR/JPY].Ask Long GBP/NZD Buy GBP, sell NZD How many NZD can we get with 1000 USD Instrument = NZD/USD USD (selling) is the quote currency so divide by the ask So NZD = 1000 / [NZD/USD].Ask units (GBP) = NZD / [GBP/NZD].Ask # Going Short Short USD/JPY Sell dollars for yen units (USD) = 1000 Short EUR/USD Sell euros, buy dollars units (EUR) = 1000 * [EUR/USD].Ask Update: units (EUR) = 1000 / [EUR/USD].Bid Short EUR/JPY Sell euros, buy yen How many euros can I buy with 1000 dollars? Instrument EUR/USD USD (selling) is the quote currency so divide by the ask units (EUR) = 1000 / [EUR/USD].Ask Short CHF/JPY Sell CHF and hold JPY How much CHF can we buy with 1000 USD? Instrument = USD/CHF USD (selling) is the base currency to multiply by the bid units (CHF) = 1000 * [USD/CHF].Bid So the question is - have I got the logic right in each scenario? [ This is a follow up question to my previous question - Calculating units in a cross currency short trade ] • I find it incredibly difficult to get my head around this stuff.. I'd love to know if there is an easier way to remember whether to use the bid or ask price and whether to multiply or divide. – Tom Hunter May 13 '15 at 3:02 • In your EUR/USD example ask your broker to quote you USD/EUR so that you don't have to do the calculation. You can follow the position in USD/EUR. This is commonplace because brokers have clients who have the exact same issue as you and want to, for example, buy or sell$1000 of EUR/USD. – rupweb May 13 '15 at 9:42
• Have a look at my primer on this at webstersystems.co.uk/fxmm.htm#spot fx – rupweb May 13 '15 at 9:50
• Hi @rupweb, it doesn't look like OANDA provides this.. i.imgur.com/MaL84u1.png and i.imgur.com/KlPQ3V8.png – Tom Hunter May 13 '15 at 11:21
• crazy... how do they cope with people who have USD and want to buy EUR? Then you have to use the inverse rate 1/EURUSD to find out the USDEUR rate. Then you can multiply your size by the rate and get the counter size. – rupweb May 13 '15 at 14:18

What you're trying to do is express all your positions in terms of a risk currency. Then you can track your PnL in only one currency. You need to express all this in an Excel spread sheet and include some rates, a bit like the screenshot here.

A currency quote (EURUSD 1.1, for example) put into an equation with units is 1 EUR / 1 USD = 1.1 or 1 EUR = 1.1 USD. Units or volume of a currency pair is expressed in terms of the base currency (EUR in the example), which means bids are buying and asks are selling the base currency.

I glanced a few examples and it looks like you're right, but here's one in equation form:

Buy GBP, sell NZD
We need NZD to sell. Must buy some using NZD/USD.
We are buying NZD/USD from people selling it, so we get the "asking" price
NZD/USD = x (the ask price)
1 NZD / x = 1 USD (re-arrange)
1000/x NZD = 1000 USD (multiply by 1000)