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


Buy USD, sell JPY
USD is the base currency so units (USD) = 1000


Buy EUR, sell USD
units (EUR) = 1000 / [EUR/USD].Ask


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


units (EUR) = yen / [EUR/JPY].Ask


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


Sell dollars for yen
units (USD) = 1000


Sell euros, buy dollars
units (EUR) = 1000 * [EUR/USD].Ask


units (EUR) = 1000 / [EUR/USD].Bid


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


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 ]

  • $\begingroup$ 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. $\endgroup$
    – Tom Hunter
    May 13, 2015 at 3:02
  • $\begingroup$ 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. $\endgroup$
    – rupweb
    May 13, 2015 at 9:42
  • $\begingroup$ Have a look at my primer on this at webstersystems.co.uk/fxmm.htm#spot fx $\endgroup$
    – rupweb
    May 13, 2015 at 9:50
  • $\begingroup$ Hi @rupweb, it doesn't look like OANDA provides this.. i.imgur.com/MaL84u1.png and i.imgur.com/KlPQ3V8.png $\endgroup$
    – Tom Hunter
    May 13, 2015 at 11:21
  • $\begingroup$ 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. $\endgroup$
    – rupweb
    May 13, 2015 at 14:18

2 Answers 2


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.

enter image description 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)
GBP/NZD = y (also buying GBP, so use ask)
(1000/x)/y GBP = (1000/x) NZD (multiply both sides by amount of NZD we can sell)
thus you can long (1000/x)/y units of GBP/NZD with 1000 USD.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.