Module Contract

module Contract: sig .. end
A contract belonging to a security type like stock, futures, option etc.

type [< Security_type.t ] t 
A contract belonging to a security type like stock, futures, option etc.
include Raw_contract_intf.S
val sec_type : [< Security_type.t ] t -> Security_type.t
The underlying asset belongs to the returned security type.
val con_id : [< Security_type.t ] t -> Contract_id.t option
Returns the unique contract ID or None if unknown.
val symbol : [< Security_type.t ] t -> Symbol.t
Returns the symbol of the underlying asset.
val exchange : [< Security_type.t ] t -> Exchange.t
Returns the exchange of the order destination.
val listed_on : [< Security_type.t ] t -> Exchange.t option
Returns the listing exchange of the underlying asset or None if unknown.
val currency : [< Security_type.t ] t -> Currency.t
The underlying asset is traded in the returned currency.
val local_symbol : [< Security_type.t ] t -> Symbol.t option
Returns the local exchange of the underlying asset or None if unknown.
val sec_id : [< Security_type.t ] t -> Security_id.t option
Returns the security ID of the underlying asset or None if unknown.
val underlying : [< `Fut_opt | `Option ] t ->
[< Security_type.t > `Futures `Stock ] t
Returns the underlying stock or futures contract of an option.
val strike : [< `Fut_opt | `Option ] t -> Price.t
Returns the strike price of an option contract.
val option_right : [< `Fut_opt | `Option ] t -> Option_right.t
Returns the right (Put or Call) of an option contract.
val expiry : [< `Fut_opt | `Futures | `Option ] t -> Core.Std.Date.t
Returns the expiry date of futures and option contracts.
val days_to_expiry : [< `Fut_opt | `Futures | `Option ] t ->
zone:Core.Std.Time.Zone.t -> int
Returns the number of days until a futures or option contract expires
val multiplier : [< `Fut_opt | `Futures | `Option ] t -> int
Returns the contract multiplier of a futures or option contract.
val to_string : [< Security_type.t ] t -> string
val (=) : ([< Security_type.t ] as 'a) t -> 'a t -> bool
Checks equality of two contracts.
val stock : ?con_id:Contract_id.t ->
?listed_on:Exchange.t ->
?local_symbol:Symbol.t ->
?sec_id:Security_id.t ->
?exchange:Exchange.t ->
currency:Currency.t -> Symbol.t -> [< Security_type.t > `Stock ] t
Creates a new stock contract.
val index : ?con_id:Contract_id.t ->
?local_symbol:Symbol.t ->
?sec_id:Security_id.t ->
?exchange:Exchange.t ->
currency:Currency.t -> Symbol.t -> [< Security_type.t > `Index ] t
Creates a new contract representing an index.
val futures : ?con_id:Contract_id.t ->
?multiplier:int ->
?local_symbol:Symbol.t ->
?sec_id:Security_id.t ->
?include_expired:bool ->
?exchange:Exchange.t ->
currency:Currency.t ->
expiry:Core.Std.Date.t ->
Symbol.t -> [< Security_type.t > `Futures ] t
Creates a new futures contract.
val option : ?con_id:Contract_id.t ->
?multiplier:int ->
?local_symbol:Symbol.t ->
?sec_id:Security_id.t ->
?exchange:Exchange.t ->
currency:Currency.t ->
option_right:Option_right.t ->
expiry:Core.Std.Date.t ->
strike:Price.t -> Symbol.t -> [< Security_type.t > `Option ] t
Creates a new option contract.
val futures_option : ?con_id:Contract_id.t ->
?multiplier:int ->
?local_symbol:Symbol.t ->
?sec_id:Security_id.t ->
?exchange:Exchange.t ->
currency:Currency.t ->
option_right:Option_right.t ->
expiry:Core.Std.Date.t ->
strike:Price.t -> Symbol.t -> [< Security_type.t > `Fut_opt ] t
Creates a new futures contract.
val forex : ?con_id:Contract_id.t ->
?local_symbol:Symbol.t ->
?sec_id:Security_id.t ->
?exchange:Exchange.t ->
currency:Currency.t -> Symbol.t -> [< Security_type.t > `Forex ] t
Creates a new forex contract.
val t_of_sexp : (Sexplib.Sexp.t -> ([< Security_type.t ] as 'a)) ->
Sexplib.Sexp.t -> 'a t
val sexp_of_t : (([< Security_type.t ] as 'a) -> Sexplib.Sexp.t) ->
'a t -> Sexplib.Sexp.t
A contract belonging to a security type like stock, futures, option etc.

The underlying asset belongs to the returned security type.

Returns the unique contract ID or None if unknown.

Returns the symbol of the underlying asset.

Returns the exchange of the order destination.

Returns the listing exchange of the underlying asset or None if unknown.

The underlying asset is traded in the returned currency.

Returns the local exchange of the underlying asset or None if unknown.

Returns the security ID of the underlying asset or None if unknown.

Returns the underlying stock or futures contract of an option.

Returns the strike price of an option contract.

Returns the right (Put or Call) of an option contract.

Returns the expiry date of futures and option contracts.

Returns the number of days until a futures or option contract expires

Returns the contract multiplier of a futures or option contract.

Checks equality of two contracts.

Creates a new stock contract.

Creates a new contract representing an index.

Creates a new futures contract.

Creates a new option contract.

Creates a new futures contract.

Creates a new forex contract.