Commits

Oliver Gu committed 681c0b6

Minor cleanup of Tws interface

Comments (0)

Files changed (1)

   | `Turn_off_market_data
   ] list
   -> t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> (Market_data.t Tws_result.t Pipe.Reader.t * Query_id.t) Or_error.t Deferred.t
 
 val market_data_exn
   | `Turn_off_market_data
   ] list
   -> t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> (Market_data.t Pipe.Reader.t * Query_id.t) Deferred.t
 
 val cancel_market_data : t -> Query_id.t -> unit
 
 val submit_order
   :  t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
-  -> order:([< `Buy | `Sell | `Sell_short ],
-            [< Order.Type.t ]) Order.t
+  -> contract:[< Contract.Type.t ] Contract.t
+  -> order:([< Order.Action.t ], [< Order.Type.t ]) Order.t
   -> (Order_status.t Tws_result.t Pipe.Reader.t * Order_id.t) Or_error.t Deferred.t
 
 val submit_order_exn
   :  t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
-  -> order:([< `Buy | `Sell | `Sell_short ],
-            [< Order.Type.t ]) Order.t
+  -> contract:[< Contract.Type.t ] Contract.t
+  -> order:([< Order.Action.t ], [< Order.Type.t ]) Order.t
   -> (Order_status.t Pipe.Reader.t * Order_id.t) Deferred.t
 
 val cancel_order_status : t -> Order_id.t -> unit
 val filter_executions
   :  ?time:Time.t
   -> t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
-  -> order_action:[ `Buy | `Sell | `Sell_short ]
-  -> (Execution.t Tws_result.t Pipe.Reader.t) Or_error.t Deferred.t
+  -> contract:[< Contract.Type.t ] Contract.t
+  -> order_action:Order.Action.t
+  -> Execution.t Tws_result.t Pipe.Reader.t Or_error.t Deferred.t
 
 val filter_executions_exn
   :  ?time:Time.t
   -> t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
-  -> order_action:[ `Buy | `Sell | `Sell_short ]
-  -> (Execution.t Pipe.Reader.t) Deferred.t
+  -> contract:[< Contract.Type.t ] Contract.t
+  -> order_action:Order.Action.t
+  -> Execution.t Pipe.Reader.t Deferred.t
 
 
 (** {1 Contract details} *)
 
 val contract_details
   :  t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> Contract_details.t Tws_result.t Or_error.t Deferred.t
 
 val contract_details_exn
   :  t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> Contract_details.t Deferred.t
 
 
 val market_depth
   :  ?num_rows:int
   -> t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> (Book_update.t Tws_result.t Pipe.Reader.t * Query_id.t) Or_error.t Deferred.t
 
 val market_depth_exn
   :  ?num_rows:int
   -> t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> (Book_update.t Pipe.Reader.t * Query_id.t) Deferred.t
 
 val cancel_market_depth : t -> Query_id.t -> unit
   ]
   -> ?until:Time.t
   -> t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> (Historical_data.t Tws_result.t Pipe.Reader.t * Query_id.t) Or_error.t Deferred.t
 
 val cancel_historical_data : t -> Query_id.t -> unit
   -> ?show:[ `Trades | `Midpoint | `Bid | `Ask ]
   -> ?use_rth:bool
   -> t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> (Realtime_bar.t Tws_result.t Pipe.Reader.t * Query_id.t) Or_error.t Deferred.t
 
 val realtime_bars_exn
   -> ?show:[ `Trades | `Midpoint | `Bid | `Ask ]
   -> ?use_rth:bool
   -> t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> (Realtime_bar.t Pipe.Reader.t * Query_id.t) Deferred.t
 
 val cancel_realtime_bars : t -> Query_id.t -> unit
 
 val trades
   : t
-  -> contract:[< `Stock | `Futures | `Option ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> (Trade.t Tws_result.t Pipe.Reader.t * Query_id.t) Or_error.t Deferred.t
 
 val trades_exn
   : t
-  -> contract:[< `Stock | `Futures | `Option ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> (Trade.t Pipe.Reader.t * Query_id.t) Deferred.t
 
 val cancel_trades : t -> Query_id.t -> unit
 
 val quotes
   :  t
-  -> contract:[< `Stock | `Futures | `Option ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> (Quote.t Tws_result.t Pipe.Reader.t * Query_id.t) Or_error.t Deferred.t
 
 val quotes_exn
   :  t
-  -> contract:[< `Stock | `Futures | `Option ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> (Quote.t Pipe.Reader.t * Query_id.t) Deferred.t
 
 val cancel_quotes : t -> Query_id.t -> unit
 
 val taq_data
   :  t
-  -> contract:[< `Stock | `Futures | `Option ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> (TAQ.t Tws_result.t Pipe.Reader.t * Query_id.t) Or_error.t Deferred.t
 
 val taq_data_exn
   :  t
-  -> contract:[< `Stock | `Futures | `Option ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> (TAQ.t Pipe.Reader.t * Query_id.t) Deferred.t
 
 val cancel_taq_data : t -> Query_id.t -> unit
 
 val quote_snapshot
   :  t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> Quote_snapshot.t Or_error.t Deferred.t
 
 val quote_snapshot_exn
   :  t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> Quote_snapshot.t Deferred.t
 
 module Trade_snapshot : sig
 
 val trade_snapshot
   :  t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> Trade_snapshot.t Or_error.t Deferred.t
 
 val trade_snapshot_exn
   :  t
-  -> contract:[< `Stock | `Futures | `Option | `Forex ] Contract.t
+  -> contract:[< Contract.Type.t ] Contract.t
   -> Trade_snapshot.t Deferred.t