sig
module Query_id : Core.Std.Unique_id
type t
val with_client :
?do_logging:bool ->
?client_id:Client_id.t ->
host:string ->
port:int ->
on_handler_error:[ `Call of Core.Std.Error.t -> unit | `Ignore | `Raise ] ->
(Tws.t -> unit Async.Std.Deferred.t) -> unit Async.Std.Deferred.t
val with_client_or_error :
?do_logging:bool ->
?client_id:Client_id.t ->
host:string ->
port:int ->
(Tws.t -> unit Async.Std.Deferred.t) ->
unit Core.Std.Or_error.t Async.Std.Deferred.t
val is_connected : Tws.t -> bool
val state : Tws.t -> [ `Connected | `Connecting | `Disconnected ]
val set_server_log_level :
Tws.t ->
level:[ `Detail | `Error | `Information | `System | `Warning ] -> unit
val server_time :
Tws.t -> Core.Std.Time.t Core.Std.Or_error.t Async.Std.Deferred.t
val server_time_exn : Tws.t -> Core.Std.Time.t Async.Std.Deferred.t
val server_version : Tws.t -> int option
val connection_time : Tws.t -> Core.Std.Time.t option
val account_code : Tws.t -> Account_code.t option
module Market_data :
sig
type t =
[ `Tick_option of Std_internal.Tick_option.t
| `Tick_price of Std_internal.Tick_price.t
| `Tick_size of Std_internal.Tick_size.t
| `Tick_string of Std_internal.Tick_string.t ]
val ( = ) : t -> t -> bool
val pp : Format.formatter -> Tws.Market_data.t -> unit
val t_of_sexp : Sexplib.Sexp.t -> Tws.Market_data.t
val __t_of_sexp__ : Sexplib.Sexp.t -> Tws.Market_data.t
val sexp_of_t : Tws.Market_data.t -> Sexplib.Sexp.t
end
val market_data :
?snapshot:bool ->
?tick_types:Tick_type.t list ->
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
(Tws.Market_data.t Tws_result.t Async.Std.Pipe.Reader.t * Query_id.t)
Core.Std.Or_error.t Async.Std.Deferred.t
val market_data_exn :
?snapshot:bool ->
?tick_types:Tick_type.t list ->
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
(Tws.Market_data.t Async.Std.Pipe.Reader.t * Query_id.t)
Async.Std.Deferred.t
val cancel_market_data : Tws.t -> Query_id.t -> unit
val option_price :
Tws.t ->
contract:[ `Option ] Contract.t ->
volatility:float ->
underlying_price:Price.t ->
Price.t Core.Std.Or_error.t Async.Std.Deferred.t
val option_price_exn :
Tws.t ->
contract:[ `Option ] Contract.t ->
volatility:float ->
underlying_price:Price.t -> Price.t Async.Std.Deferred.t
val implied_volatility :
Tws.t ->
contract:[ `Option ] Contract.t ->
option_price:Price.t ->
underlying_price:Price.t ->
float Core.Std.Or_error.t Async.Std.Deferred.t
val implied_volatility_exn :
Tws.t ->
contract:[ `Option ] Contract.t ->
option_price:Price.t ->
underlying_price:Price.t -> float Async.Std.Deferred.t
val submit_order :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
order:([< Order_action.t ], [< Order_type.t ]) Order.t ->
(Std_internal.Order_status.t Tws_result.t Async.Std.Pipe.Reader.t *
Std_internal.Order_id.t)
Core.Std.Or_error.t Async.Std.Deferred.t
val submit_order_exn :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
order:([< Order_action.t ], [< Order_type.t ]) Order.t ->
(Std_internal.Order_status.t Async.Std.Pipe.Reader.t *
Std_internal.Order_id.t)
Async.Std.Deferred.t
val cancel_order_status : Tws.t -> Std_internal.Order_id.t -> unit
val account_updates :
Tws.t ->
Std_internal.Account_update.t Async.Std.Pipe.Reader.t Core.Std.Or_error.t
Async.Std.Deferred.t
val account_updates_exn :
Tws.t ->
Std_internal.Account_update.t Async.Std.Pipe.Reader.t
Async.Std.Deferred.t
val portfolio :
Tws.t ->
Std_internal.Position.t Async.Std.Pipe.Reader.t Core.Std.Or_error.t
Async.Std.Deferred.t
val portfolio_exn :
Tws.t ->
Std_internal.Position.t Async.Std.Pipe.Reader.t Async.Std.Deferred.t
val commissions :
Tws.t -> Std_internal.Commission.t Async.Std.Pipe.Reader.t
val executions : Tws.t -> Std_internal.Execution.t Async.Std.Pipe.Reader.t
val filter_executions :
?time:Core.Std.Time.t ->
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
action:Order_action.t ->
Std_internal.Execution.t Tws_result.t Async.Std.Pipe.Reader.t
Core.Std.Or_error.t Async.Std.Deferred.t
val filter_executions_exn :
?time:Core.Std.Time.t ->
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
action:Order_action.t ->
Std_internal.Execution.t Async.Std.Pipe.Reader.t Async.Std.Deferred.t
val contract_details :
Tws.t ->
?con_id:Std_internal.Contract_id.t ->
?multiplier:int ->
?listing_exchange:Exchange.t ->
?local_symbol:Symbol.t ->
?sec_id:Std_internal.Security_id.t ->
?include_expired:bool ->
?exchange:Exchange.t ->
?option_right:Std_internal.Option_right.t ->
?expiry:Core.Std.Date.t ->
?strike:Price.t ->
currency:Currency.t ->
sec_type:Security_type.t ->
Symbol.t ->
Std_internal.Contract_data.t Tws_result.t Async.Std.Pipe.Reader.t
Core.Std.Or_error.t Async.Std.Deferred.t
val contract_details_exn :
Tws.t ->
?con_id:Std_internal.Contract_id.t ->
?multiplier:int ->
?listing_exchange:Exchange.t ->
?local_symbol:Symbol.t ->
?sec_id:Std_internal.Security_id.t ->
?include_expired:bool ->
?exchange:Exchange.t ->
?option_right:Std_internal.Option_right.t ->
?expiry:Core.Std.Date.t ->
?strike:Price.t ->
currency:Currency.t ->
sec_type:Security_type.t ->
Symbol.t ->
Std_internal.Contract_data.t Async.Std.Pipe.Reader.t Async.Std.Deferred.t
val contract_data :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
Std_internal.Contract_data.t Core.Std.Or_error.t Async.Std.Deferred.t
val contract_data_exn :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
Std_internal.Contract_data.t Async.Std.Deferred.t
val futures_chain :
Tws.t ->
?con_id:Std_internal.Contract_id.t ->
?multiplier:int ->
?listing_exchange:Exchange.t ->
?local_symbol:Symbol.t ->
?sec_id:Std_internal.Security_id.t ->
?include_expired:bool ->
?exchange:Exchange.t ->
currency:Currency.t ->
Symbol.t ->
[< Security_type.t > `Futures ] Contract.t list Core.Std.Or_error.t
Async.Std.Deferred.t
val futures_chain_exn :
Tws.t ->
?con_id:Std_internal.Contract_id.t ->
?multiplier:int ->
?listing_exchange:Exchange.t ->
?local_symbol:Symbol.t ->
?sec_id:Std_internal.Security_id.t ->
?include_expired:bool ->
?exchange:Exchange.t ->
currency:Currency.t ->
Symbol.t ->
[< Security_type.t > `Futures ] Contract.t list Async.Std.Deferred.t
val option_chain :
Tws.t ->
?con_id:Std_internal.Contract_id.t ->
?multiplier:int ->
?listing_exchange:Exchange.t ->
?local_symbol:Symbol.t ->
?sec_id:Std_internal.Security_id.t ->
?include_expired:bool ->
?exchange:Exchange.t ->
?expiry:Core.Std.Date.t ->
?strike:Price.t ->
option_right:Std_internal.Option_right.t ->
currency:Currency.t ->
Symbol.t ->
[< Security_type.t > `Option ] Contract.t list Core.Std.Or_error.t
Async.Std.Deferred.t
val option_chain_exn :
Tws.t ->
?con_id:Std_internal.Contract_id.t ->
?multiplier:int ->
?listing_exchange:Exchange.t ->
?local_symbol:Symbol.t ->
?sec_id:Std_internal.Security_id.t ->
?include_expired:bool ->
?exchange:Exchange.t ->
?expiry:Core.Std.Date.t ->
?strike:Price.t ->
option_right:Std_internal.Option_right.t ->
currency:Currency.t ->
Symbol.t ->
[< Security_type.t > `Option ] Contract.t list Async.Std.Deferred.t
val market_depth :
?num_rows:int ->
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
(Std_internal.Book_update.t Tws_result.t Async.Std.Pipe.Reader.t *
Query_id.t)
Core.Std.Or_error.t Async.Std.Deferred.t
val market_depth_exn :
?num_rows:int ->
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
(Std_internal.Book_update.t Async.Std.Pipe.Reader.t * Query_id.t)
Async.Std.Deferred.t
val cancel_market_depth : Tws.t -> Query_id.t -> unit
val history :
?bar_size:[ `Fifteen_min
| `Fifteen_sec
| `Five_min
| `Five_sec
| `One_day
| `One_hour
| `One_min
| `One_sec
| `Thirty_min
| `Thirty_sec
| `Three_min
| `Two_min ] ->
?bar_span:[ `Day of int
| `Month of int
| `Sec of int
| `Week of int
| `Year of int ] ->
?use_tradehours:bool ->
?tick_type:[ `Ask
| `Bid
| `Bid_ask
| `Historical_volatility
| `Implied_volatility
| `Midpoint
| `Option_volume
| `Trades ] ->
?until:Core.Std.Time.t ->
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
Std_internal.History.t Tws_result.t Core.Std.Or_error.t
Async.Std.Deferred.t
val history_exn :
?bar_size:[ `Fifteen_min
| `Fifteen_sec
| `Five_min
| `Five_sec
| `One_day
| `One_hour
| `One_min
| `One_sec
| `Thirty_min
| `Thirty_sec
| `Three_min
| `Two_min ] ->
?bar_span:[ `Day of int
| `Month of int
| `Sec of int
| `Week of int
| `Year of int ] ->
?use_tradehours:bool ->
?tick_type:[ `Ask
| `Bid
| `Bid_ask
| `Historical_volatility
| `Implied_volatility
| `Midpoint
| `Option_volume
| `Trades ] ->
?until:Core.Std.Time.t ->
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
Std_internal.History.t Async.Std.Deferred.t
val realtime_bars :
?bar_size:[ `Fifteen_min
| `Fifteen_sec
| `Five_min
| `Five_sec
| `One_min
| `Thirty_min
| `Thirty_sec
| `Three_min
| `Two_min ] ->
?tick_type:[ `Ask | `Bid | `Midpoint | `Trades ] ->
?use_tradehours:bool ->
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
(Std_internal.Bar.t Tws_result.t Async.Std.Pipe.Reader.t * Query_id.t)
Core.Std.Or_error.t Async.Std.Deferred.t
val realtime_bars_exn :
?bar_size:[ `Fifteen_min
| `Fifteen_sec
| `Five_min
| `Five_sec
| `One_min
| `Thirty_min
| `Thirty_sec
| `Three_min
| `Two_min ] ->
?tick_type:[ `Ask | `Bid | `Midpoint | `Trades ] ->
?use_tradehours:bool ->
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
(Std_internal.Bar.t Async.Std.Pipe.Reader.t * Query_id.t)
Async.Std.Deferred.t
val cancel_realtime_bars : Tws.t -> Query_id.t -> unit
module Trade :
sig
type t = private {
stamp : Core.Std.Time.t;
price : Price.t;
size : Volume.t;
}
val size : Tws.Trade.t -> Volume.t
val price : Tws.Trade.t -> Price.t
val stamp : Tws.Trade.t -> Core.Std.Time.t
module Fields :
sig
val names : string list
val size : (Tws.Trade.t, Volume.t) Fieldslib.Field.readonly_t
val price : (Tws.Trade.t, Price.t) Fieldslib.Field.readonly_t
val stamp :
(Tws.Trade.t, Core.Std.Time.t) Fieldslib.Field.readonly_t
val fold :
init:'acc__ ->
stamp:('acc__ ->
(Tws.Trade.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
'acc__) ->
price:('acc__ ->
(Tws.Trade.t, Price.t) Fieldslib.Field.readonly_t ->
'acc__) ->
size:('acc__ ->
(Tws.Trade.t, Volume.t) Fieldslib.Field.readonly_t ->
'acc__) ->
'acc__
val iter :
stamp:((Tws.Trade.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
unit) ->
price:((Tws.Trade.t, Price.t) Fieldslib.Field.readonly_t -> unit) ->
size:((Tws.Trade.t, Volume.t) Fieldslib.Field.readonly_t -> unit) ->
unit
val for_all :
stamp:((Tws.Trade.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
bool) ->
price:((Tws.Trade.t, Price.t) Fieldslib.Field.readonly_t -> bool) ->
size:((Tws.Trade.t, Volume.t) Fieldslib.Field.readonly_t -> bool) ->
bool
val exists :
stamp:((Tws.Trade.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
bool) ->
price:((Tws.Trade.t, Price.t) Fieldslib.Field.readonly_t -> bool) ->
size:((Tws.Trade.t, Volume.t) Fieldslib.Field.readonly_t -> bool) ->
bool
val to_list :
stamp:((Tws.Trade.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
'elem__) ->
price:((Tws.Trade.t, Price.t) Fieldslib.Field.readonly_t ->
'elem__) ->
size:((Tws.Trade.t, Volume.t) Fieldslib.Field.readonly_t ->
'elem__) ->
'elem__ list
val map_poly :
([< `Read ], Tws.Trade.t, 'x0) Fieldslib.Field.user -> 'x0 list
module Direct :
sig
val iter :
Tws.Trade.t ->
stamp:((Tws.Trade.t, Core.Std.Time.t)
Fieldslib.Field.readonly_t ->
Tws.Trade.t -> Core.Std.Time.t -> unit) ->
price:((Tws.Trade.t, Price.t) Fieldslib.Field.readonly_t ->
Tws.Trade.t -> Price.t -> unit) ->
size:((Tws.Trade.t, Volume.t) Fieldslib.Field.readonly_t ->
Tws.Trade.t -> Volume.t -> unit) ->
unit
val fold :
Tws.Trade.t ->
init:'acc__ ->
stamp:('acc__ ->
(Tws.Trade.t, Core.Std.Time.t)
Fieldslib.Field.readonly_t ->
Tws.Trade.t -> Core.Std.Time.t -> 'acc__) ->
price:('acc__ ->
(Tws.Trade.t, Price.t) Fieldslib.Field.readonly_t ->
Tws.Trade.t -> Price.t -> 'acc__) ->
size:('acc__ ->
(Tws.Trade.t, Volume.t) Fieldslib.Field.readonly_t ->
Tws.Trade.t -> Volume.t -> 'acc__) ->
'acc__
end
end
val pp : Format.formatter -> Tws.Trade.t -> unit
val t_of_sexp : Sexplib.Sexp.t -> Tws.Trade.t
val sexp_of_t : Tws.Trade.t -> Sexplib.Sexp.t
end
val trades :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
(Tws.Trade.t Tws_result.t Async.Std.Pipe.Reader.t * Query_id.t)
Core.Std.Or_error.t Async.Std.Deferred.t
val trades_exn :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
(Tws.Trade.t Async.Std.Pipe.Reader.t * Query_id.t) Async.Std.Deferred.t
val cancel_trades : Tws.t -> Query_id.t -> unit
module Quote :
sig
module Change :
sig
type t =
Unknown
| Ask_price of Price.t
| Bid_price of Price.t
| Ask_size of Volume.t
| Bid_size of Volume.t
| Ask_price_and_size of Price.t * Volume.t
| Bid_price_and_size of Price.t * Volume.t
val t_of_sexp : Sexplib.Sexp.t -> Tws.Quote.Change.t
val sexp_of_t : Tws.Quote.Change.t -> Sexplib.Sexp.t
end
type t = private {
stamp : Core.Std.Time.t;
ask_price : Price.t;
bid_price : Price.t;
ask_size : Volume.t;
bid_size : Volume.t;
change : Tws.Quote.Change.t;
}
val change : Tws.Quote.t -> Tws.Quote.Change.t
val bid_size : Tws.Quote.t -> Volume.t
val ask_size : Tws.Quote.t -> Volume.t
val bid_price : Tws.Quote.t -> Price.t
val ask_price : Tws.Quote.t -> Price.t
val stamp : Tws.Quote.t -> Core.Std.Time.t
module Fields :
sig
val names : string list
val change :
(Tws.Quote.t, Tws.Quote.Change.t) Fieldslib.Field.readonly_t
val bid_size : (Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t
val ask_size : (Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t
val bid_price : (Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t
val ask_price : (Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t
val stamp :
(Tws.Quote.t, Core.Std.Time.t) Fieldslib.Field.readonly_t
val fold :
init:'acc__ ->
stamp:('acc__ ->
(Tws.Quote.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
'acc__) ->
ask_price:('acc__ ->
(Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t ->
'acc__) ->
bid_price:('acc__ ->
(Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t ->
'acc__) ->
ask_size:('acc__ ->
(Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t ->
'acc__) ->
bid_size:('acc__ ->
(Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t ->
'acc__) ->
change:('acc__ ->
(Tws.Quote.t, Tws.Quote.Change.t)
Fieldslib.Field.readonly_t -> 'acc__) ->
'acc__
val iter :
stamp:((Tws.Quote.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
unit) ->
ask_price:((Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t ->
unit) ->
bid_price:((Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t ->
unit) ->
ask_size:((Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t ->
unit) ->
bid_size:((Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t ->
unit) ->
change:((Tws.Quote.t, Tws.Quote.Change.t)
Fieldslib.Field.readonly_t -> unit) ->
unit
val for_all :
stamp:((Tws.Quote.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
bool) ->
ask_price:((Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t ->
bool) ->
bid_price:((Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t ->
bool) ->
ask_size:((Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t ->
bool) ->
bid_size:((Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t ->
bool) ->
change:((Tws.Quote.t, Tws.Quote.Change.t)
Fieldslib.Field.readonly_t -> bool) ->
bool
val exists :
stamp:((Tws.Quote.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
bool) ->
ask_price:((Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t ->
bool) ->
bid_price:((Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t ->
bool) ->
ask_size:((Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t ->
bool) ->
bid_size:((Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t ->
bool) ->
change:((Tws.Quote.t, Tws.Quote.Change.t)
Fieldslib.Field.readonly_t -> bool) ->
bool
val to_list :
stamp:((Tws.Quote.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
'elem__) ->
ask_price:((Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t ->
'elem__) ->
bid_price:((Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t ->
'elem__) ->
ask_size:((Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t ->
'elem__) ->
bid_size:((Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t ->
'elem__) ->
change:((Tws.Quote.t, Tws.Quote.Change.t)
Fieldslib.Field.readonly_t -> 'elem__) ->
'elem__ list
val map_poly :
([< `Read ], Tws.Quote.t, 'x0) Fieldslib.Field.user -> 'x0 list
module Direct :
sig
val iter :
Tws.Quote.t ->
stamp:((Tws.Quote.t, Core.Std.Time.t)
Fieldslib.Field.readonly_t ->
Tws.Quote.t -> Core.Std.Time.t -> unit) ->
ask_price:((Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t ->
Tws.Quote.t -> Price.t -> unit) ->
bid_price:((Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t ->
Tws.Quote.t -> Price.t -> unit) ->
ask_size:((Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t ->
Tws.Quote.t -> Volume.t -> unit) ->
bid_size:((Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t ->
Tws.Quote.t -> Volume.t -> unit) ->
change:((Tws.Quote.t, Tws.Quote.Change.t)
Fieldslib.Field.readonly_t ->
Tws.Quote.t -> Tws.Quote.Change.t -> unit) ->
unit
val fold :
Tws.Quote.t ->
init:'acc__ ->
stamp:('acc__ ->
(Tws.Quote.t, Core.Std.Time.t)
Fieldslib.Field.readonly_t ->
Tws.Quote.t -> Core.Std.Time.t -> 'acc__) ->
ask_price:('acc__ ->
(Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t ->
Tws.Quote.t -> Price.t -> 'acc__) ->
bid_price:('acc__ ->
(Tws.Quote.t, Price.t) Fieldslib.Field.readonly_t ->
Tws.Quote.t -> Price.t -> 'acc__) ->
ask_size:('acc__ ->
(Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t ->
Tws.Quote.t -> Volume.t -> 'acc__) ->
bid_size:('acc__ ->
(Tws.Quote.t, Volume.t) Fieldslib.Field.readonly_t ->
Tws.Quote.t -> Volume.t -> 'acc__) ->
change:('acc__ ->
(Tws.Quote.t, Tws.Quote.Change.t)
Fieldslib.Field.readonly_t ->
Tws.Quote.t -> Tws.Quote.Change.t -> 'acc__) ->
'acc__
end
end
val pp : Format.formatter -> Tws.Quote.t -> unit
val t_of_sexp : Sexplib.Sexp.t -> Tws.Quote.t
val sexp_of_t : Tws.Quote.t -> Sexplib.Sexp.t
end
val quotes :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
(Tws.Quote.t Tws_result.t Async.Std.Pipe.Reader.t * Query_id.t)
Core.Std.Or_error.t Async.Std.Deferred.t
val quotes_exn :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
(Tws.Quote.t Async.Std.Pipe.Reader.t * Query_id.t) Async.Std.Deferred.t
val cancel_quotes : Tws.t -> Query_id.t -> unit
module TAQ :
sig
type t = Trade of Tws.Trade.t | Quote of Tws.Quote.t
val pp : Format.formatter -> Tws.TAQ.t -> unit
val t_of_sexp : Sexplib.Sexp.t -> Tws.TAQ.t
val sexp_of_t : Tws.TAQ.t -> Sexplib.Sexp.t
end
val taq_data :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
(Tws.TAQ.t Tws_result.t Async.Std.Pipe.Reader.t * Query_id.t)
Core.Std.Or_error.t Async.Std.Deferred.t
val taq_data_exn :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
(Tws.TAQ.t Async.Std.Pipe.Reader.t * Query_id.t) Async.Std.Deferred.t
val cancel_taq_data : Tws.t -> Query_id.t -> unit
val latest_quote :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
Tws.Quote.t Core.Std.Or_error.t Async.Std.Deferred.t
val latest_quote_exn :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
Tws.Quote.t Async.Std.Deferred.t
val latest_trade :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
Tws.Trade.t Core.Std.Or_error.t Async.Std.Deferred.t
val latest_trade_exn :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
Tws.Trade.t Async.Std.Deferred.t
module Close :
sig
type t = private { stamp : Core.Std.Time.t; price : Price.t; }
val price : Tws.Close.t -> Price.t
val stamp : Tws.Close.t -> Core.Std.Time.t
module Fields :
sig
val names : string list
val price : (Tws.Close.t, Price.t) Fieldslib.Field.readonly_t
val stamp :
(Tws.Close.t, Core.Std.Time.t) Fieldslib.Field.readonly_t
val fold :
init:'acc__ ->
stamp:('acc__ ->
(Tws.Close.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
'acc__) ->
price:('acc__ ->
(Tws.Close.t, Price.t) Fieldslib.Field.readonly_t ->
'acc__) ->
'acc__
val iter :
stamp:((Tws.Close.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
unit) ->
price:((Tws.Close.t, Price.t) Fieldslib.Field.readonly_t -> unit) ->
unit
val for_all :
stamp:((Tws.Close.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
bool) ->
price:((Tws.Close.t, Price.t) Fieldslib.Field.readonly_t -> bool) ->
bool
val exists :
stamp:((Tws.Close.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
bool) ->
price:((Tws.Close.t, Price.t) Fieldslib.Field.readonly_t -> bool) ->
bool
val to_list :
stamp:((Tws.Close.t, Core.Std.Time.t) Fieldslib.Field.readonly_t ->
'elem__) ->
price:((Tws.Close.t, Price.t) Fieldslib.Field.readonly_t ->
'elem__) ->
'elem__ list
val map_poly :
([< `Read ], Tws.Close.t, 'x0) Fieldslib.Field.user -> 'x0 list
module Direct :
sig
val iter :
Tws.Close.t ->
stamp:((Tws.Close.t, Core.Std.Time.t)
Fieldslib.Field.readonly_t ->
Tws.Close.t -> Core.Std.Time.t -> unit) ->
price:((Tws.Close.t, Price.t) Fieldslib.Field.readonly_t ->
Tws.Close.t -> Price.t -> unit) ->
unit
val fold :
Tws.Close.t ->
init:'acc__ ->
stamp:('acc__ ->
(Tws.Close.t, Core.Std.Time.t)
Fieldslib.Field.readonly_t ->
Tws.Close.t -> Core.Std.Time.t -> 'acc__) ->
price:('acc__ ->
(Tws.Close.t, Price.t) Fieldslib.Field.readonly_t ->
Tws.Close.t -> Price.t -> 'acc__) ->
'acc__
end
end
val t_of_sexp : Sexplib.Sexp.t -> Tws.Close.t
val sexp_of_t : Tws.Close.t -> Sexplib.Sexp.t
end
val latest_close :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
Tws.Close.t Core.Std.Or_error.t Async.Std.Deferred.t
val latest_close_exn :
Tws.t ->
contract:[< Security_type.t ] Contract.t ->
Tws.Close.t Async.Std.Deferred.t
end