PositionRecord

forge.typesclassSince Forge API 1
Signaturepython
forge.types.PositionRecord(id: int,symbol: str,side: PositionSide,size: float,avg_price: float,open_time: int,stop: float | None,target: float | None,unrealized: float,swap: float,commission: float,r_multiple: float | None,risk_cash: float | None,mae: float,mfe: float,bars_held: int,tag: str | None,entry_reason: str,add_count: int = 0,reduce_count: int = 0,peak_size: float = 0.0) -> None

The mutable state behind a Position. The run writes it; a strategy never sees it.

Parameters

NameTypeDefault
idint
symbolstr
sidePositionSide
sizefloat
avg_pricefloat
open_timeint
stopfloat | None
targetfloat | None
unrealizedfloat
swapfloat
commissionfloat
r_multiplefloat | None
risk_cashfloat | None
maefloat
mfefloat
bars_heldint
tagstr | None
entry_reasonstr
add_countint0
reduce_countint0
peak_sizefloat0.0