hstradeking-0.1.0: Tradeking API bindings for Haskell

Safe HaskellNone

Finance.TradeKing.Types

Contents

Synopsis

TradeKing specific

data TradeKing Source

Data type that represents the URLs we need to connect to TradeKing This could be useful if you wanted to host your own TradeKing-compatible testing server. . Most of the time, you'll use defaultTk to get the default values.

data TradeKingApp Source

This data type holds the application information provided by TradeKing and is used to make requests.

Constructors

TradeKingApp 

data Format Source

Expected return format for API calls.

Constructors

JSON 
XML 

data Command Source

TradeKing API commmands that we support.

Constructors

Accounts 
Clock 
Quote [Asset] [String] 

Common Financial Asset and Transaction Types

Assets

data Asset Source

The different types of Assets available on TradeKing. Currently on Stocks and Options are supported.

newtype Stock Source

Constructors

Stock 

Fields

unStock :: Text
 

newtype CUSIP Source

Type to represent SEC CUSIP identifiers

Constructors

CUSIP Text 

Prices

type Eps4 = EpsDiv10 (EpsDiv10 (EpsDiv10 (EpsDiv10 Eps1)))Source

Exact way of representing prices, etc.

data Price Source

A price has both a currency component and a decimal. Currently we only denote prices in USD, but this is here for future compatibility.

Constructors

Price Currency Fixed4 

Options

data Option Source

Describes an option. Option support is TBD.

Other Assets

data Note Source

Unimplemented

Constructors

Note 

Instances

data Future Source

Unimplemented

Constructors

Future 

Utility types

data HighLow a Source

Constructors

HighLow 

Fields

high :: a
 
low :: a
 

Instances

Eq a => Eq (HighLow a) 
Show a => Show (HighLow a) 

TradeKing API-specific data structures

data StockQuote Source

A stock quote

Constructors

StockQuote 

Fields

sqStock :: Stock

Stock which we're quoting

sqTime :: UTCTime

Time at which the quote was sampled

sqAsk :: Price
 
sqAskTime :: UTCTime

Time at which the ask quote was last updated

sqAskSz :: Word

Current size of ask queue

sqBid :: Price
 
sqBidTime :: UTCTime

Time at which the bid quote was last updated

sqBidSz :: Word

Current size of bid queue

sqLastPrice :: Price
 
sqLastTradeVol :: Word

Volue of last trade

sqCumVol :: Word

Number of trades since market open

data StockInfo Source

Stock information that may change day-to-day

data StreamOutput Source

This is the type of data that may be output by the streaming calls. We can't use other data types here, because the streaming data is limited in scope.

Constructors

StreamStatus String

Stream status. This should be the first thing that comes out of the conduit in streamQuotes and should have the argument `connected` on success.

StreamQuote

Represents updates to the quote of a symbol

StreamTrade

Represents a trade that just took place

StreamJunk String 

defaultTk :: TradeKingSource

Default TradeKing URIs. Equivalent to

 TradeKing {
   apiBase = "https://api.tradeking.com/v1/",
   streamBase = "https://stream.tradeking.com/v1/",
   authorizeURL = "https://developers.tradeking.com/oauth/authorize?oauth_token=",
   requestTokenResource = "https://developers.tradeking.com/oauth/request_token",
   accessTokenResource = "https://developers.tradeking.com/oauth/access_token" }