Algostream_strategy.ActionWhat a strategy emits.
on_event returns actions rather than calling a submit callback. Three things fall out of that choice:
Strategy.S can be driven by a backtest or by a live runner, because neither is baked into the emit path.An intent describes what the strategy wants. Turning it into an Order.order on a venue is the engine's job.
module Order = Algostream_domain_orders.Ordertype intent = {symbol : string;side : Side.t;quantity : float;must be positive; direction lives in side
order_type : Order.order_type;time_in_force : Order.time_in_force;client_order_id : string;strategy-assigned and strategy-unique; the engine assigns venue ids
*)strategy_id : string;urgency : urgency;advisory to the fill model only — it never silently rewrites order_type
tag : string;free-form; lands in the blotter row so a fill can be traced to its reason
*)}type t = | Submit of intent| Cancel of stringclient_order_id
*)| Replace of {}| Set_timer of {}| Log of stringval submit :
symbol:string ->
side:Side.t ->
quantity:float ->
order_type:Order.order_type ->
?time_in_force:Order.time_in_force ->
?urgency:urgency ->
?tag:string ->
client_order_id:string ->
strategy_id:string ->
unit ->
tConvenience constructor with sensible defaults: Good_till_cancel, Normal urgency, empty tag. Raises Invalid_argument on a non-positive quantity — a zero-size order is always a bug in the caller's sizing, and failing loudly beats a silent no-op.
val urgency_to_string : urgency -> stringval to_string : t -> string