+2013-04-18: Port number for TWS clients is longer optional.
2013-04-16: Added a new interface Twsable.
A type is 'Twsable' if it provides functions to convert between
values of that type and raw messages of the TWS protocol.
- (** [with_client ~host ~on_handler_error handler] connects by default
- to the IB Gateway (running on [host] under port 4001) and runs the
- [handler] until an exception is thrown or until the returned Deferred
+ (** [with_client ~host ~port ~on_handler_error handler] connects to the
+ IB connectivity software on ([host], [port]) and runs the [handler]
+ until an exception is thrown or the returned Deferred is determined.
[on_handler_error] determines what happens if the [handler] throws an
In order to connect to TWS, you need to supply 7496 as port number.
val is_connected : t -> bool
- (* [state t] returns the state of the connection. *)
+ (* [state t] returns the state of the connection. *)
val state : t -> [ `Disconnected | `Connecting | `Connected ]
(** [set_server_log_level level] sets the log entry detail [level] of TWS
?(enable_logging = false)
?(client_id = Client_id.of_int_exn 0)
let module C = Client_msg in
Monitor.try_with (fun () ->
- create ?enable_logging ?client_id
?port ~host ()
+ create ?enable_logging ?client_id port ~host ()
if t.enable_logging then begin
Stream.iter (messages t) ~f:(fun clt_msg ->