Requires

forge.strategyclassSince Forge API 1
Signaturepython
forge.strategy.Requires(*, hedging: bool) -> None

The account behaviour a strategy needs: account = fg.Requires(hedging=True).

Parameters

NameType
hedgingbool

Members

NameSignatureSummary
to_spec(self) -> dict[str, Any]The declaration as plain JSON.

hedging=True needs an account that holds a long and a short position in one symbol at the same time, and hedging=False one that nets them. The run's broker account decides which it is, and a run on the other kind of account is refused, never changed.