sig
type t = private {
contract : Raw_contract.t;
size : Volume.t;
market_price : Price.t;
market_value : Price.t;
average_cost : Price.t;
unrealized_pnl : Price.t;
realized_pnl : Price.t;
account_code : Account_code.t;
}
val account_code : Response.Position.t -> Account_code.t
val realized_pnl : Response.Position.t -> Price.t
val unrealized_pnl : Response.Position.t -> Price.t
val average_cost : Response.Position.t -> Price.t
val market_value : Response.Position.t -> Price.t
val market_price : Response.Position.t -> Price.t
val size : Response.Position.t -> Volume.t
module Fields :
sig
val names : string list
val account_code :
(Response.Position.t, Account_code.t) Fieldslib.Field.readonly_t
val realized_pnl :
(Response.Position.t, Price.t) Fieldslib.Field.readonly_t
val unrealized_pnl :
(Response.Position.t, Price.t) Fieldslib.Field.readonly_t
val average_cost :
(Response.Position.t, Price.t) Fieldslib.Field.readonly_t
val market_value :
(Response.Position.t, Price.t) Fieldslib.Field.readonly_t
val market_price :
(Response.Position.t, Price.t) Fieldslib.Field.readonly_t
val size : (Response.Position.t, Volume.t) Fieldslib.Field.readonly_t
val contract :
(Response.Position.t, Raw_contract.t) Fieldslib.Field.readonly_t
val fold :
init:'acc__ ->
contract:('acc__ ->
(Response.Position.t, Raw_contract.t)
Fieldslib.Field.readonly_t -> 'acc__) ->
size:('acc__ ->
(Response.Position.t, Volume.t) Fieldslib.Field.readonly_t ->
'acc__) ->
market_price:('acc__ ->
(Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> 'acc__) ->
market_value:('acc__ ->
(Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> 'acc__) ->
average_cost:('acc__ ->
(Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> 'acc__) ->
unrealized_pnl:('acc__ ->
(Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> 'acc__) ->
realized_pnl:('acc__ ->
(Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> 'acc__) ->
account_code:('acc__ ->
(Response.Position.t, Account_code.t)
Fieldslib.Field.readonly_t -> 'acc__) ->
'acc__
val iter :
contract:((Response.Position.t, Raw_contract.t)
Fieldslib.Field.readonly_t -> unit) ->
size:((Response.Position.t, Volume.t) Fieldslib.Field.readonly_t ->
unit) ->
market_price:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> unit) ->
market_value:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> unit) ->
average_cost:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> unit) ->
unrealized_pnl:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> unit) ->
realized_pnl:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> unit) ->
account_code:((Response.Position.t, Account_code.t)
Fieldslib.Field.readonly_t -> unit) ->
unit
val for_all :
contract:((Response.Position.t, Raw_contract.t)
Fieldslib.Field.readonly_t -> bool) ->
size:((Response.Position.t, Volume.t) Fieldslib.Field.readonly_t ->
bool) ->
market_price:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> bool) ->
market_value:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> bool) ->
average_cost:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> bool) ->
unrealized_pnl:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> bool) ->
realized_pnl:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> bool) ->
account_code:((Response.Position.t, Account_code.t)
Fieldslib.Field.readonly_t -> bool) ->
bool
val exists :
contract:((Response.Position.t, Raw_contract.t)
Fieldslib.Field.readonly_t -> bool) ->
size:((Response.Position.t, Volume.t) Fieldslib.Field.readonly_t ->
bool) ->
market_price:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> bool) ->
market_value:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> bool) ->
average_cost:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> bool) ->
unrealized_pnl:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> bool) ->
realized_pnl:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> bool) ->
account_code:((Response.Position.t, Account_code.t)
Fieldslib.Field.readonly_t -> bool) ->
bool
val to_list :
contract:((Response.Position.t, Raw_contract.t)
Fieldslib.Field.readonly_t -> 'elem__) ->
size:((Response.Position.t, Volume.t) Fieldslib.Field.readonly_t ->
'elem__) ->
market_price:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> 'elem__) ->
market_value:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> 'elem__) ->
average_cost:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> 'elem__) ->
unrealized_pnl:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> 'elem__) ->
realized_pnl:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t -> 'elem__) ->
account_code:((Response.Position.t, Account_code.t)
Fieldslib.Field.readonly_t -> 'elem__) ->
'elem__ list
val map_poly :
([< `Read ], Response.Position.t, 'x0) Fieldslib.Field.user ->
'x0 list
module Direct :
sig
val iter :
Response.Position.t ->
contract:((Response.Position.t, Raw_contract.t)
Fieldslib.Field.readonly_t ->
Response.Position.t -> Raw_contract.t -> unit) ->
size:((Response.Position.t, Volume.t) Fieldslib.Field.readonly_t ->
Response.Position.t -> Volume.t -> unit) ->
market_price:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t ->
Response.Position.t -> Price.t -> unit) ->
market_value:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t ->
Response.Position.t -> Price.t -> unit) ->
average_cost:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t ->
Response.Position.t -> Price.t -> unit) ->
unrealized_pnl:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t ->
Response.Position.t -> Price.t -> unit) ->
realized_pnl:((Response.Position.t, Price.t)
Fieldslib.Field.readonly_t ->
Response.Position.t -> Price.t -> unit) ->
account_code:((Response.Position.t, Account_code.t)
Fieldslib.Field.readonly_t ->
Response.Position.t -> Account_code.t -> unit) ->
unit
val fold :
Response.Position.t ->
init:'acc__ ->
contract:('acc__ ->
(Response.Position.t, Raw_contract.t)
Fieldslib.Field.readonly_t ->
Response.Position.t -> Raw_contract.t -> 'acc__) ->
size:('acc__ ->
(Response.Position.t, Volume.t) Fieldslib.Field.readonly_t ->
Response.Position.t -> Volume.t -> 'acc__) ->
market_price:('acc__ ->
(Response.Position.t, Price.t)
Fieldslib.Field.readonly_t ->
Response.Position.t -> Price.t -> 'acc__) ->
market_value:('acc__ ->
(Response.Position.t, Price.t)
Fieldslib.Field.readonly_t ->
Response.Position.t -> Price.t -> 'acc__) ->
average_cost:('acc__ ->
(Response.Position.t, Price.t)
Fieldslib.Field.readonly_t ->
Response.Position.t -> Price.t -> 'acc__) ->
unrealized_pnl:('acc__ ->
(Response.Position.t, Price.t)
Fieldslib.Field.readonly_t ->
Response.Position.t -> Price.t -> 'acc__) ->
realized_pnl:('acc__ ->
(Response.Position.t, Price.t)
Fieldslib.Field.readonly_t ->
Response.Position.t -> Price.t -> 'acc__) ->
account_code:('acc__ ->
(Response.Position.t, Account_code.t)
Fieldslib.Field.readonly_t ->
Response.Position.t -> Account_code.t -> 'acc__) ->
'acc__
end
end
val unpickler : t Tws_prot.Unpickler.t
val pickler : t Tws_prot.Pickler.t Core.Std.Only_in_test.t
val ( = ) : t -> t -> bool
val create :
contract:[< Security_type.t ] Contract.t ->
size:Volume.t ->
market_price:Price.t ->
market_value:Price.t ->
average_cost:Price.t ->
unrealized_pnl:Price.t ->
realized_pnl:Price.t ->
account_code:Account_code.t -> Response.Position.t
val contract : Response.Position.t -> [< Security_type.t ] Contract.t
val total_pnl : Response.Position.t -> Price.t
val return : Response.Position.t -> float
val t_of_sexp : Sexplib.Sexp.t -> Response.Position.t
val sexp_of_t : Response.Position.t -> Sexplib.Sexp.t
end