forge.types
Forge API 1
The types a hook receives, defined by the engine and re-exported here.
Strategy code imports ``forge`` only, so ``fg.OrderTicket`` and the rest are the engine's own objects. Nothing here wraps or copies them.
| Name | Kind | Summary |
|---|---|---|
| Context | class | The point-in-time context every hook receives as ``ctx``. |
| EndReason | class | Why a run ended, handed to ``on_end``. |
| FillEvent | class | One fill: an entry, or a whole or partial exit. |
| Intent | class | What ``confirm_entry``, ``confirm_exit`` and ``size`` receive: a trade about to happen. |
| OrderStatus | class | Where an order is in its life. |
| OrderTicket | class | An order a strategy sent. |
| Position | class | An open position. |
| RejectReason | class | Why an order was refused. |
| RunMode | class | How the run was started. |
| Trade | class | One closed round trip, or the closed part of one: an entry fill, its exit fill and the money. |
| CheckResult | class | What the engine would say about an order sent now. |
| FillCosts | class | What one fill cost, each part in account currency and never negative as a cost. |
| FillReason | constant | |
| OrderEvent | class | What ``on_order_event`` receives: one thing that happened to one order. |
| OrderRequest | class | An order a strategy describes before sending it: what ``ctx.check`` and ``calc.margin`` take. |
| OrderSide | constant | |
| OrderType | constant | |
| PositionOwner | class | What a position calls to change or close itself. |
| PositionRecord | class | The mutable state behind a ``Position``. |
| PositionSide | constant | |
| Quote | class | The bid, ask and spread at the decision time, in price units. |
| TicketOwner | class | What an order ticket calls to change or cancel itself. |
| TicketRecord | class | The mutable state behind an ``OrderTicket``. |