Positions and profit
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 position is what you hold after an order fills.
- A long position comes from buying. You gain if the price rises.
- A short position comes from selling first. You gain if the price falls, because you buy back cheaper later.
While a position is open, its gain or loss is unrealized: it changes with every price. When you close it, the gain or loss becomes realized and is added to your balance.
Your balance is your money after closed trades. Your equity is your balance plus the unrealized profit or loss of everything still open: what your account would be worth if you closed it all now.
A worked example
Section titled “A worked example”Long. You buy 10,000 EUR/USD at the ask, 1.08512. Later the bid is 1.08712 and you close.
- Profit: (1.08712 − 1.08512) × 10,000 = 0.0020 × 10,000 = 20 US dollars, or 20 pips.
Short. You sell 10,000 EUR/USD at the bid, 1.08500. Later the ask is 1.08650 and you close.
- Loss: (1.08650 − 1.08500) × 10,000 = 0.0015 × 10,000 = 15 US dollars, or 15 pips.
A long position opens at the ask and closes at the bid, and a short does the opposite, so each trade starts out down by the spread.
In Cloud9Trader
Section titled “In Cloud9Trader”The backtest and trading session dashboards show Unrealized Profit, Realized Profit and Total Profit, and the backtest dashboard also shows Balance and Equity. Every position is listed in Positions.
In an algorithm, BALANCE, EQUITY and UNREALIZED_PROFIT give the same figures in your account currency. Open positions are in OPEN_POSITIONS, each with its DIRECTION ("LONG" or "SHORT"), OPEN_PRICE, QUANTITY and PROFIT, and a close() method. closeAllPositions closes them all.
Read next
Section titled “Read next”- Get started: see these numbers on a backtest of your own.