Orders
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.
An order is an instruction to your broker to buy or sell.
- A market order buys or sells straight away at the current price: buys at the ask, sells at the bid. It always fills, but the price can move between the moment you decide and the moment it fills.
- A limit order waits until the price reaches a level you set, or better. A stop order waits until the price passes a level you set, then becomes a market order.
Two kinds of order close a position for you:
- A stop loss closes it if the price moves against you to a set level. It caps how much you lose on that trade, as long as the price does not jump past it.
- A take profit closes it if the price moves your way to a set level, locking in the gain.
A trailing stop is a stop loss that follows the price as it moves in your favour and stays put when it moves against you.
An order that waits also has a time in force: how long it stays active if it does not fill. Common choices are good till cancelled, good for the day, and fill immediately or cancel. A market order fills at once, so it needs none.
A worked example
Section titled “A worked example”You buy 10,000 EUR/USD with a market order. The ask is 1.08512, so that is your opening price. You set:
- a stop loss 15 pips below: 1.08512 − 0.0015 = 1.08362
- a take profit 25 pips above: 1.08512 + 0.0025 = 1.08762
A long position closes at the bid. If the bid falls to 1.08362, the stop loss closes it for a loss of 15 pips: 10,000 × 0.0015 = 15 US dollars. If the bid rises to 1.08762, the take profit closes it for a gain of 25 pips: 25 US dollars. These figures leave out any further slippage if the price jumps past your level.
In Cloud9Trader
Section titled “In Cloud9Trader”An algorithm opens a position with openPosition, which sends a market order: "BUY" fills at the ask and "SELL" at the bid. You can attach:
stopLossorstopLossPipstakeProfitortakeProfitPipstrailingStoportrailingStopPips
openPosition("BUY", { quantity: 10000, stopLossPips: 15, takeProfitPips: 25,});Algorithms do not place limit or stop orders to open a position at a future price. To enter at a level, check the price in onTick and call openPosition when it is reached. Set a stop loss on every position.
Read next
Section titled “Read next”- Positions and profit: long and short, and how profit and loss are counted.