liveBook · Manning

Stop-loss order

As explained in Investing for Programmers

A stop-loss order is a broker instruction to automatically sell a position when its price reaches a predefined threshold, limiting potential loss.

A stop-loss order instructs a broker to sell a position automatically when its price reaches a predefined threshold. It acts as a safety net for limiting losses or protecting gains. section 7.1.1

Raising the threshold

After buying at $8, a stock rises to $25. Raising the stop-loss from $7 to $22 keeps the position open while locking in a potential gain if the price falls. section 7.1.1

Evaluate the trade-offs before applying one to every position:

  • Taxes may apply when selling a profitable position. section 7.1.1
  • Transaction fees and the bid-ask spread can make immediate repurchasing costly. section 7.1.1
  • A temporary fluctuation can trigger a sale before the price recovers. section 7.1.1
Figure 7.1 In this reference for a stop-loss order, the stop loss is adjusted to $22 on day 6 after the share price rises. When the stock goes below $22, the stop loss will be triggered, and the investor will sell at a market price on day 9.
figure

Trace the price rise, threshold adjustment to $22, trigger, and market-price sale. section 7.1.1

How Investing for Programmers covers it

How deep it goes
Explains triggering, threshold adjustment, and trade-offs, while deferring effective API configuration to later automation.
Examples
Demonstrates a position bought at $8, rising to $25, protected by a threshold raised from $7 to $22.
What it assumes
Assumes a held investment position and broker access while defining the order from zero.
What you can do after
Operate/configure a stop-loss through a broker and recognize tax, cost, and premature-sale trade-offs.
How it connects
Connects stop-loss orders with taxes, transaction costs, bid-ask spreads, fluctuations, and broader risk management.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Investing for Programmers. The section links point to the parts of the book it draws on.