Skip to content

Guides

Size positions from your account

Let the stop decide the size, not the other way round.

Trading on margin can lose you more than you put in. Past results, including backtests, do not predict future results. Cloud9Trader provides tools and education, not financial advice. Read the full risk warning.

A fixed quantity risks more when the stop is wide and less when it is tight. Risking a fixed share of the account keeps every loss the same size.

openPosition("BUY", {
riskPercentage: 1,
stopLossPips: 20,
});

Cloud9Trader works out the quantity so that hitting the stop loses about 1% of your balance. A stop is required.

For example, with a 10,000 USD balance, 1% is 100 USD. A 20 pip stop on EUR/USD, where a pip on 10,000 units is worth 1 USD, gives a quantity of about 50,000.

openPosition("SELL", {
riskAmount: 50,
stopLossPips: 25,
});

This risks about 50 in your account currency.

Use quantity in units, or lots, where one lot is 100,000 units. BALANCE, EQUITY and AVAILABLE_MARGIN give you the account figures to work from.

  • The amount is approximate: if your account currency differs from the instrument’s, exchange rates move, and a real broker can fill beyond the stop.
  • The quantity is rounded to the instrument’s trade size.
  • If the account does not have the margin, the order is refused and logged.