oanda-rest-api-0.3.0.0: Client to the OANDA REST API

Safe HaskellNone
LanguageHaskell2010

OANDA.Rates

Description

Defines the endpoints listed in the Rates section of the API.

Synopsis

Documentation

data Instrument Source #

Instances

Show Instrument Source # 
Generic Instrument Source # 

Associated Types

type Rep Instrument :: * -> * #

FromJSON Instrument Source # 
type Rep Instrument Source # 

instruments :: OandaEnv -> AccountID -> InstrumentsArgs -> IO (Vector Instrument) Source #

Retrieve a list of instruments from OANDA

prices :: OandaEnv -> [InstrumentText] -> Maybe ZonedTime -> IO (Vector Price) Source #

Retrieve the current prices for a list of instruments.

data MidpointCandlestick Source #

Instances

Show MidpointCandlestick Source # 
Generic MidpointCandlestick Source # 
FromJSON MidpointCandlestick Source # 
type Rep MidpointCandlestick Source # 
type Rep MidpointCandlestick = D1 (MetaData "MidpointCandlestick" "OANDA.Rates" "oanda-rest-api-0.3.0.0-2QW5QOWynH85EIyagYeyg1" False) (C1 (MetaCons "MidpointCandlestick" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "midpointCandlestickTime") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ZonedTime)) ((:*:) (S1 (MetaSel (Just Symbol "midpointCandlestickOpenMid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Decimal)) (S1 (MetaSel (Just Symbol "midpointCandlestickHighMid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Decimal)))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "midpointCandlestickLowMid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Decimal)) (S1 (MetaSel (Just Symbol "midpointCandlestickCloseMid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Decimal))) ((:*:) (S1 (MetaSel (Just Symbol "midpointCandlestickVolume") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) (S1 (MetaSel (Just Symbol "midpointCandlestickComplete") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))))))

midpointCandles :: OandaEnv -> InstrumentText -> CandlesArgs -> IO (Vector MidpointCandlestick) Source #

Retrieve the price history of a single instrument in midpoint candles

data BidAskCandlestick Source #

Instances

Show BidAskCandlestick Source # 
Generic BidAskCandlestick Source # 
FromJSON BidAskCandlestick Source # 
type Rep BidAskCandlestick Source # 
type Rep BidAskCandlestick = D1 (MetaData "BidAskCandlestick" "OANDA.Rates" "oanda-rest-api-0.3.0.0-2QW5QOWynH85EIyagYeyg1" False) (C1 (MetaCons "BidAskCandlestick" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "bidaskCandlestickTime") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ZonedTime)) (S1 (MetaSel (Just Symbol "bidaskCandlestickOpenBid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Decimal))) ((:*:) (S1 (MetaSel (Just Symbol "bidaskCandlestickOpenAsk") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Decimal)) ((:*:) (S1 (MetaSel (Just Symbol "bidaskCandlestickHighBid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Decimal)) (S1 (MetaSel (Just Symbol "bidaskCandlestickHighAsk") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Decimal))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "bidaskCandlestickLowBid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Decimal)) ((:*:) (S1 (MetaSel (Just Symbol "bidaskCandlestickLowAsk") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Decimal)) (S1 (MetaSel (Just Symbol "bidaskCandlestickCloseBid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Decimal)))) ((:*:) (S1 (MetaSel (Just Symbol "bidaskCandlestickCloseAsk") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Decimal)) ((:*:) (S1 (MetaSel (Just Symbol "bidaskCandlestickVolume") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int)) (S1 (MetaSel (Just Symbol "bidaskCandlestickComplete") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))))))

bidaskCandles :: OandaEnv -> InstrumentText -> CandlesArgs -> IO (Vector BidAskCandlestick) Source #

Retrieve the price history of a single instrument in bid/ask candles

data Granularity Source #

Constructors

S5 
S10 
S15 
S30 
M1 
M2 
M3 
M4 
M5 
M10 
M15 
M30 
H1 
H2 
H3 
H4 
H6 
H8 
H12 
D 
W 
M 

granularityToDiffTime :: Granularity -> NominalDiffTime Source #

Utility function to convert Granularity to NominalDiffTime. NOTE: The conversion from month to NominalDiffTime is not correct in general; we just assume 31 days in a month, which is obviously false for 5 months of the year.