Stop

forge.signalsclassSince Forge API 1
Signaturepython
forge.signals.Stop(*,kind: str,note: str | None = None,value: float | np.ndarray | None = None,mult: float | None = None,length: int | None = None,lookback: int | None = None) -> None

Where a losing trade is closed. Build one with a constructor, like fg.Stop.atr(2.0).

Parameters

NameTypeDefault
kindstr
notestr | NoneNone
valuefloat | np.ndarray | NoneNone
multfloat | NoneNone
lengthint | NoneNone
lookbackint | NoneNone

Members

NameSignatureSummary
atr(mult: float, length: int = 14, *, note: str | None = None) -> StopA multiple of the average true range over ``length`` bars (1 to 500).
cash(value: float | np.ndarray, *, note: str | None = None) -> StopThe money the trade loses at the stop, in the account currency.
pct(value: float | np.ndarray, *, note: str | None = None) -> StopA distance as a percent of the price the entry was decided at, below 100.
pips(value: float | np.ndarray, *, note: str | None = None) -> StopA distance in pips from the entry.
points(value: float | np.ndarray, *, note: str | None = None) -> StopA distance in points from the entry.
price(level: float | np.ndarray, *, note: str | None = None) -> StopA price level, or an array of them with NaN where a bar has no stop.
swing(lookback: int = 5, *, note: str | None = None) -> StopJust beyond the last swing low (long) or swing high (short) of ``lookback`` bars.
ticks(value: float | np.ndarray, *, note: str | None = None) -> StopA distance in ticks from the entry.

pips, points, ticks, pct (of the decision price) and cash (money lost at the stop) take a number or one per bar. price is a price level, or one per bar where NaN means no stop on that bar. atr is a multiple of the average true range, and swing sits beyond the last swing high or low of that many bars.

Used in