Introducing market data

Market data is the data representing the current bid/ask for a financial instrument at an exchange. The market data can either be the top of book, best bid/ask for the particular instrument, or an aggregated book with several levels of depth. Normally, we just look at the best bid/ask prices, top of book called quotes. Market data can also be sent as OHLC bars or candles. Such bars are only useful for visualizing price information in charts or for trading at a longer horizon. It is a simple way of filtering the price information. The midpoint is defined as the average between the bid and ask.

Type Quote =
{ 
   bid : float
   ask : float
} member this.midpoint() = (this.bid + this.ask) / 2.0

Let's see how to use this type:

let q ...

Get F# for Quantitative Finance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.