What is a stop loss? How to set one

By Oalgo · Last reviewed

A stop loss is a rule that closes a trade when price moves a set distance against it, to limit the loss on that trade. A trade entered at 100 with a 2% stop loss has its stop at 98.

How does a stop loss work?

#
  • The distance is set as a percentage of the entry price. For a long trade, stop price = entry price × (1 − stop %).
  • A fixed stop stays at the same price while the trade is open.
  • On each candle, a test checks whether the lowest price of the candle reached the stop. If it did, the trade closes.
Made-up exampleValue
Entry price100
Stop loss2%
Stop price100 × (1 − 0.02) = 98
Loss if the stop is hit2%, before fees and slippage

What can a stop loss not do?

#
  • It does not promise the exit price. If price jumps past the stop, the trade closes at a price beyond it. In a test, a candle that opens below the stop closes the trade at that open, not at the stop price.
  • A tight stop is hit by normal moves. A wide stop lets each loss grow.
  • It limits one trade, not the whole account. Position sizing decides how much is at stake when the stop is hit.

How do you set a stop loss in Oalgo?

#

In Oalgo the Exit block holds the Stop Loss as a percentage. A new Exit block starts at 1%. You can test it in a backtest like any other rule.

A Live Strategy needs a stop on each side it can enter: a Stop Loss as a percentage, a stop set by ATR or by an indicator, or a trailing stop. An exit target is optional. The ATR stop loss page shows how to turn one into a percentage.

For example, you could tell Oalgo AI: "Use a 1% Stop Loss and a 2% exit target." These numbers are examples to change.

Read next