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.

NameKindSummary
ContextclassThe point-in-time context every hook receives as ``ctx``.
EndReasonclassWhy a run ended, handed to ``on_end``.
FillEventclassOne fill: an entry, or a whole or partial exit.
IntentclassWhat ``confirm_entry``, ``confirm_exit`` and ``size`` receive: a trade about to happen.
OrderStatusclassWhere an order is in its life.
OrderTicketclassAn order a strategy sent.
PositionclassAn open position.
RejectReasonclassWhy an order was refused.
RunModeclassHow the run was started.
TradeclassOne closed round trip, or the closed part of one: an entry fill, its exit fill and the money.
CheckResultclassWhat the engine would say about an order sent now.
FillCostsclassWhat one fill cost, each part in account currency and never negative as a cost.
FillReasonconstant
OrderEventclassWhat ``on_order_event`` receives: one thing that happened to one order.
OrderRequestclassAn order a strategy describes before sending it: what ``ctx.check`` and ``calc.margin`` take.
OrderSideconstant
OrderTypeconstant
PositionOwnerclassWhat a position calls to change or close itself.
PositionRecordclassThe mutable state behind a ``Position``.
PositionSideconstant
QuoteclassThe bid, ask and spread at the decision time, in price units.
TicketOwnerclassWhat an order ticket calls to change or cancel itself.
TicketRecordclassThe mutable state behind an ``OrderTicket``.