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) -> NoneWhere a winning trade is closed. Build one with a constructor, like fg.Target.r(2.0).
Parameters
| Name | Type | Default |
|---|---|---|
| kind | str | |
| note | str | None | None |
| value | float | np.ndarray | None | None |
| mult | float | None | None |
| length | int | None | None |
Members
| Name | Signature | Summary |
|---|---|---|
| atr | (mult: float, length: int = 14, *, note: str | None = None) -> Target | A multiple of the average true range over ``length`` bars (1 to 500). |
| pct | (value: float | np.ndarray, *, note: str | None = None) -> Target | A distance as a percent of the price the entry was decided at, at most 1000. |
| pips | (value: float | np.ndarray, *, note: str | None = None) -> Target | A distance in pips from the entry. |
| points | (value: float | np.ndarray, *, note: str | None = None) -> Target | A distance in points from the entry. |
| price | (level: float | np.ndarray, *, note: str | None = None) -> Target | A price level, or an array of them with NaN where a bar has no target. |
| r | (value: float, *, note: str | None = None) -> Target | A multiple of the initial risk: ``r(2.0)`` is twice the distance to the stop. |
| ticks | (value: float | np.ndarray, *, note: str | None = None) -> Target | A 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.