Target

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

Where a winning trade is closed. Build one with a constructor, like fg.Target.r(2.0).

Parameters

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

Members

NameSignatureSummary
atr(mult: float, length: int = 14, *, note: str | None = None) -> TargetA multiple of the average true range over ``length`` bars (1 to 500).
pct(value: float | np.ndarray, *, note: str | None = None) -> TargetA distance as a percent of the price the entry was decided at, at most 1000.
pips(value: float | np.ndarray, *, note: str | None = None) -> TargetA distance in pips from the entry.
points(value: float | np.ndarray, *, note: str | None = None) -> TargetA distance in points from the entry.
price(level: float | np.ndarray, *, note: str | None = None) -> TargetA price level, or an array of them with NaN where a bar has no target.
r(value: float, *, note: str | None = None) -> TargetA multiple of the initial risk: ``r(2.0)`` is twice the distance to the stop.
ticks(value: float | np.ndarray, *, note: str | None = None) -> TargetA distance in ticks from the entry.

pips, points, ticks and pct are distances from the entry and take a number or one per bar. price is a price level, or one per bar where NaN means no target on that bar. atr is a multiple of the average true range, and r a multiple of the risk to the stop.

Used in