Module Algostream_domain_orders.Order
type order_side = | Buy| Sell
type order_type = | Market| Limit of Base.float| Stop of Base.float| Stop_limit of {stop_price : Base.float;limit_price : Base.float;
}| Iceberg of {display_size : Base.float;total_size : Base.float;
}
type time_in_force = | Good_till_cancel| Immediate_or_cancel| Fill_or_kill| Good_till_date of Timestamp.t
type order_status = | Pending| Open| Partially_filled of {filled_quantity : Base.float;
}| Filled| Cancelled| Rejected of Base.string| Expired
type order = {id : Base.string;client_order_id : Base.string;symbol : Base.string;side : order_side;order_type : order_type;quantity : Base.float;time_in_force : time_in_force;status : order_status;created_at : Timestamp.t;updated_at : Timestamp.t;filled_quantity : Base.float;average_fill_price : Base.float Base.option;commission : Base.float;exchange : Base.string;strategy_id : Base.string Base.option;
}val create_order :
?ts:Timestamp.t ->
id:Base.string ->
client_order_id:Base.string ->
symbol:Base.string ->
side:order_side ->
order_type:order_type ->
quantity:Base.float ->
time_in_force:time_in_force ->
exchange:Base.string ->
?strategy_id:Base.string ->
unit ->
orderval create_market_order :
?ts:Timestamp.t ->
id:Base.string ->
client_order_id:Base.string ->
symbol:Base.string ->
side:order_side ->
quantity:Base.float ->
exchange:Base.string ->
?strategy_id:Base.string ->
unit ->
orderval create_limit_order :
?ts:Timestamp.t ->
id:Base.string ->
client_order_id:Base.string ->
symbol:Base.string ->
side:order_side ->
quantity:Base.float ->
price:Base.float ->
exchange:Base.string ->
?strategy_id:Base.string ->
unit ->
orderval remaining_quantity : order -> Base__Float.tval is_open : order -> boolval is_filled : order -> boolval is_pending : order -> boolval is_cancelled : order -> boolval is_rejected : order -> boolval fill_percentage : order -> Base__Float.tval add_fill :
?ts:Timestamp.t ->
order ->
fill_quantity:Base__Float.t ->
fill_price:Base__Float.t ->
orderval get_limit_price : order -> Base.float optionval get_stop_price : order -> Base.float optionval order_value : order -> Base__Float.t