Documentation
¶
Index ¶
- Constants
- Variables
- type Account
- type AccountCreateEvent
- func (t *AccountCreateEvent) AccountId() Id
- func (t *AccountCreateEvent) HomeCurrency() string
- func (t *AccountCreateEvent) Reason() string
- func (t AccountCreateEvent) String() string
- func (t *AccountCreateEvent) Time() Time
- func (t *AccountCreateEvent) TranId() Id
- func (t *AccountCreateEvent) Type() string
- func (t *AccountCreateEvent) UnmarshalJSON(data []byte) (err error)
- type AlignmentTimezone
- type ApiError
- type AutochartistArg
- type AutochartistPattern
- type AutochartistSignal
- type AutochartistSignalData
- type AutochartistSignalMeta
- type BidAskCandle
- type BidAskCandles
- type CalendarEvent
- type CancelOrderResponse
- type CandlesArg
- type Client
- func (c *Client) Account(accountId Id) (*Account, error)
- func (c *Client) AccountId() Id
- func (c *Client) Accounts() ([]Account, error)
- func (c *Client) AutochartistPattern(arg ...AutochartistArg) (*AutochartistPattern, error)
- func (c *Client) Calendar(instrument string, period Period) ([]CalendarEvent, error)
- func (c *Client) CancelOrder(orderId Id) (*CancelOrderResponse, error)
- func (c *Client) CancelRequest(req *http.Request)
- func (c *Client) CloseIdleConnections()
- func (c *Client) ClosePosition(instrument string) (*PositionCloseResponse, error)
- func (c *Client) CloseTrade(tradeId Id) (*CloseTradeResponse, error)
- func (c *Client) CommitmentsOfTraders(instrument string) ([]CommitmentsOfTraders, error)
- func (c *Client) FullEventHistory() (*url.URL, error)
- func (c *Client) Instruments(instruments []string, fields []InstrumentField) (map[string]InstrumentInfo, error)
- func (c *Client) ModifyOrder(orderId Id, arg ModifyOrderArg, args ...ModifyOrderArg) (*Order, error)
- func (c *Client) ModifyTrade(tradeId Id, arg ModifyTradeArg, args ...ModifyTradeArg) (*Trade, error)
- func (c *Client) NewEventServer(accountId ...Id) (*EventServer, error)
- func (c *Client) NewOrder(orderType OrderType, side TradeSide, units int, instrument string, ...) (*Order, error)
- func (c *Client) NewPricePoller(since time.Time, instrs ...string) (*PricePoller, error)
- func (c *Client) NewPriceServer(instrs ...string) (*PriceServer, error)
- func (c *Client) NewRequest(method, urlStr string, body io.Reader) (*http.Request, error)
- func (c *Client) NewTrade(side TradeSide, units int, instrument string, args ...NewTradeArg) (*Trade, error)
- func (c *Client) Order(orderId Id) (*Order, error)
- func (c *Client) OrderBooks(instrument string, period Period) (OrderBooks, error)
- func (c *Client) Orders(args ...OrdersArg) ([]Order, error)
- func (c *Client) PollBidAskCandles(instrument string, granularity Granularity, args ...CandlesArg) (*BidAskCandles, error)
- func (c *Client) PollEvent(tranId Id) (Event, error)
- func (c *Client) PollEvents(args ...EventsArg) ([]Event, error)
- func (c *Client) PollMidpointCandles(instrument string, granularity Granularity, args ...CandlesArg) (*MidpointCandles, error)
- func (c *Client) PollPrices(instruments ...string) (Prices, error)
- func (c *Client) PollPricesSince(since time.Time, instrs ...string) (Prices, error)
- func (c *Client) Position(instrument string) (*Position, error)
- func (c *Client) PositionRatios(instrument string, period Period) (*PositionRatios, error)
- func (c *Client) Positions() (Positions, error)
- func (c *Client) SelectAccount(accountId Id)
- func (c *Client) Spreads(instrument string, period Period, unique bool) (*Spreads, error)
- func (c *Client) Trade(tradeId Id) (*Trade, error)
- func (c *Client) Trades(args ...TradesArg) (Trades, error)
- type CloseTradeResponse
- type CommitmentsOfTraders
- type ContentType
- type Count
- type DailyAlignment
- type DailyInterestEvent
- func (t *DailyInterestEvent) AccountId() Id
- func (t *DailyInterestEvent) Interest() float64
- func (t DailyInterestEvent) String() string
- func (t *DailyInterestEvent) Time() Time
- func (t *DailyInterestEvent) TranId() Id
- func (t *DailyInterestEvent) Type() string
- func (t *DailyInterestEvent) UnmarshalJSON(data []byte) (err error)
- type DateFormat
- type Direction
- type EndTime
- type Environment
- type Event
- type EventHandlerFunc
- type EventServer
- type EventsArg
- type Expiry
- type FeeEvent
- func (t *FeeEvent) AccountBalance() float64
- func (t *FeeEvent) AccountId() Id
- func (t *FeeEvent) Amount() float64
- func (t *FeeEvent) Reason() string
- func (t FeeEvent) String() string
- func (t *FeeEvent) Time() Time
- func (t *FeeEvent) TranId() Id
- func (t *FeeEvent) Type() string
- func (t *FeeEvent) UnmarshalJSON(data []byte) (err error)
- type Granularity
- type HeartbeatHandlerFunc
- type HistoricalStats
- type Id
- type Ids
- type IncludeFirst
- type Instrument
- type InstrumentField
- type InstrumentInfo
- type InterestRate
- type LowerBound
- type MaxId
- type MidpointCandle
- type MidpointCandles
- type MigrateTradeOpenEvent
- func (t *MigrateTradeOpenEvent) AccountId() Id
- func (t *MigrateTradeOpenEvent) Instrument() string
- func (t *MigrateTradeOpenEvent) Price() float64
- func (t *MigrateTradeOpenEvent) Side() string
- func (t *MigrateTradeOpenEvent) StopLossPrice() float64
- func (t MigrateTradeOpenEvent) String() string
- func (t *MigrateTradeOpenEvent) TakeProfitPrice() float64
- func (t *MigrateTradeOpenEvent) Time() Time
- func (t *MigrateTradeOpenEvent) TradeOpened() *evtTradeDetail
- func (t *MigrateTradeOpenEvent) TrailingStopLossDistance() float64
- func (t *MigrateTradeOpenEvent) TranId() Id
- func (t *MigrateTradeOpenEvent) Type() string
- func (t *MigrateTradeOpenEvent) Units() int
- func (t *MigrateTradeOpenEvent) UnmarshalJSON(data []byte) (err error)
- type MinId
- type ModifyOrderArg
- type ModifyTradeArg
- type NewOrderArg
- type NewTradeArg
- type Order
- type OrderBook
- type OrderBooks
- type OrderCancelEvent
- func (t *OrderCancelEvent) AccountId() Id
- func (t *OrderCancelEvent) OrderId() Id
- func (t *OrderCancelEvent) Reason() string
- func (t OrderCancelEvent) String() string
- func (t *OrderCancelEvent) Time() Time
- func (t *OrderCancelEvent) TranId() Id
- func (t *OrderCancelEvent) Type() string
- func (t *OrderCancelEvent) UnmarshalJSON(data []byte) (err error)
- type OrderCreateEvent
- func (t *OrderCreateEvent) AccountId() Id
- func (t *OrderCreateEvent) Expiry() Time
- func (t *OrderCreateEvent) Instrument() string
- func (t *OrderCreateEvent) LowerBound() float64
- func (t *OrderCreateEvent) Price() float64
- func (t *OrderCreateEvent) Reason() string
- func (t *OrderCreateEvent) Side() string
- func (t *OrderCreateEvent) StopLossPrice() float64
- func (t OrderCreateEvent) String() string
- func (t *OrderCreateEvent) TakeProfitPrice() float64
- func (t *OrderCreateEvent) Time() Time
- func (t *OrderCreateEvent) TrailingStopLossDistance() float64
- func (t *OrderCreateEvent) TranId() Id
- func (t *OrderCreateEvent) Type() string
- func (t *OrderCreateEvent) Units() int
- func (t *OrderCreateEvent) UnmarshalJSON(data []byte) (err error)
- func (t *OrderCreateEvent) UpperBound() float64
- type OrderFilledEvent
- func (t *OrderFilledEvent) AccountId() Id
- func (t *OrderFilledEvent) OrderId() Id
- func (t OrderFilledEvent) String() string
- func (t *OrderFilledEvent) Time() Time
- func (t *OrderFilledEvent) TranId() Id
- func (t *OrderFilledEvent) Type() string
- func (t *OrderFilledEvent) UnmarshalJSON(data []byte) (err error)
- type OrderType
- type OrderUpdateEvent
- func (t *OrderUpdateEvent) AccountId() Id
- func (t *OrderUpdateEvent) Instrument() string
- func (t *OrderUpdateEvent) LowerBound() float64
- func (t *OrderUpdateEvent) Reason() string
- func (t *OrderUpdateEvent) Side() string
- func (t *OrderUpdateEvent) StopLossPrice() float64
- func (t OrderUpdateEvent) String() string
- func (t *OrderUpdateEvent) TakeProfitPrice() float64
- func (t *OrderUpdateEvent) Time() Time
- func (t *OrderUpdateEvent) TrailingStopLossDistance() float64
- func (t *OrderUpdateEvent) TranId() Id
- func (t *OrderUpdateEvent) Type() string
- func (t *OrderUpdateEvent) Units() int
- func (t *OrderUpdateEvent) UnmarshalJSON(data []byte) (err error)
- func (t *OrderUpdateEvent) UpperBound() float64
- type OrdersArg
- type Period
- type Point
- type PollRequest
- type Position
- type PositionCloseResponse
- type PositionRatio
- type PositionRatios
- type Positions
- type Prediction
- type Price
- type PricePoint
- type PricePoller
- type PriceServer
- type PriceTick
- type Prices
- type Quality
- type SetMarginRateEvent
- func (t *SetMarginRateEvent) AccountId() Id
- func (t *SetMarginRateEvent) MarginRate() float64
- func (t SetMarginRateEvent) String() string
- func (t *SetMarginRateEvent) Time() Time
- func (t *SetMarginRateEvent) TranId() Id
- func (t *SetMarginRateEvent) Type() string
- func (t *SetMarginRateEvent) UnmarshalJSON(data []byte) (err error)
- type Spread
- type Spreads
- type StartTime
- type Stats
- type StopLoss
- type StreamHandler
- type StreamMessage
- type StreamServer
- type TakeProfit
- type TickHandlerFunc
- type Time
- type TimedReader
- type TokenAuthenticator
- type Trade
- type TradeCloseEvent
- func (t *TradeCloseEvent) AccountBalance() float64
- func (t *TradeCloseEvent) AccountId() Id
- func (t *TradeCloseEvent) Instrument() string
- func (t *TradeCloseEvent) Interest() float64
- func (t *TradeCloseEvent) Pl() float64
- func (t *TradeCloseEvent) Price() float64
- func (t *TradeCloseEvent) Side() string
- func (t TradeCloseEvent) String() string
- func (t *TradeCloseEvent) Time() Time
- func (t *TradeCloseEvent) TradeId() Id
- func (t *TradeCloseEvent) TranId() Id
- func (t *TradeCloseEvent) Type() string
- func (t *TradeCloseEvent) Units() int
- func (t *TradeCloseEvent) UnmarshalJSON(data []byte) (err error)
- type TradeCreateEvent
- func (t *TradeCreateEvent) AccountBalance() float64
- func (t *TradeCreateEvent) AccountId() Id
- func (t *TradeCreateEvent) Instrument() string
- func (t *TradeCreateEvent) Interest() float64
- func (t *TradeCreateEvent) LowerBound() float64
- func (t *TradeCreateEvent) Pl() float64
- func (t *TradeCreateEvent) Price() float64
- func (t *TradeCreateEvent) Side() string
- func (t *TradeCreateEvent) StopLossPrice() float64
- func (t TradeCreateEvent) String() string
- func (t *TradeCreateEvent) TakeProfitPrice() float64
- func (t *TradeCreateEvent) Time() Time
- func (t *TradeCreateEvent) TradeOpened() *evtTradeDetail
- func (t *TradeCreateEvent) TradeReduced() *evtTradeDetail
- func (t *TradeCreateEvent) TrailingStopLossDistance() float64
- func (t *TradeCreateEvent) TranId() Id
- func (t *TradeCreateEvent) Type() string
- func (t *TradeCreateEvent) Units() int
- func (t *TradeCreateEvent) UnmarshalJSON(data []byte) (err error)
- func (t *TradeCreateEvent) UpperBound() float64
- type TradeSide
- type TradeUpdateEvent
- func (t *TradeUpdateEvent) AccountId() Id
- func (t *TradeUpdateEvent) Instrument() string
- func (t *TradeUpdateEvent) Side() string
- func (t *TradeUpdateEvent) StopLossPrice() float64
- func (t TradeUpdateEvent) String() string
- func (t *TradeUpdateEvent) TailingStopLossDistance() float64
- func (t *TradeUpdateEvent) TakeProfitPrice() float64
- func (t *TradeUpdateEvent) Time() Time
- func (t *TradeUpdateEvent) TradeId() Id
- func (t *TradeUpdateEvent) TranId() Id
- func (t *TradeUpdateEvent) Type() string
- func (t *TradeUpdateEvent) Units() int
- func (t *TradeUpdateEvent) UnmarshalJSON(data []byte) (err error)
- type Trades
- type TradesArg
- type TrailingStop
- type TransferFundsEvent
- func (t *TransferFundsEvent) AccountId() Id
- func (t *TransferFundsEvent) Amount() float64
- func (t TransferFundsEvent) String() string
- func (t *TransferFundsEvent) Time() Time
- func (t *TransferFundsEvent) TranId() Id
- func (t *TransferFundsEvent) Type() string
- func (t *TransferFundsEvent) UnmarshalJSON(data []byte) (err error)
- type Units
- type UpperBound
- type WeeklyAlignment
Constants ¶
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
AccountId Id `json:"accountId"`
Name string `json:"accountName"`
Balance float64 `json:"balance"`
UnrealizedPl float64 `json:"unrealizedPl"`
RealizedPl float64 `json:"realizedPl"`
MarginUsed float64 `json:"marginUsed"`
MarginAvailable float64 `json:"marginAvail"`
OpenTrades int `json:"openTrades"`
OpenOrders int `json:"openOrders"`
Currency string `json:"accountCurrency"`
MarginRate float64 `json:"marginRate"`
PropertyName []string `json:"accountPropertyName"`
}
Account represents an Oanda account.
type AccountCreateEvent ¶
type AccountCreateEvent struct {
// contains filtered or unexported fields
}
AccountCreateEvent represents an event of type CREATE.
func (*AccountCreateEvent) HomeCurrency ¶
func (t *AccountCreateEvent) HomeCurrency() string
func (*AccountCreateEvent) Reason ¶
func (t *AccountCreateEvent) Reason() string
func (AccountCreateEvent) String ¶
func (t AccountCreateEvent) String() string
String implementes the fmt.Stringer interface.
func (*AccountCreateEvent) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type AlignmentTimezone ¶
Optional argument for PollMidpriceCandles and PollBidAskCandles that indicates the timezone to use when aligning candles with DailyAlignment.
See http://developer.oanda.com/docs/v1/rates/#retrieve-instrument-history for further information.
type ApiError ¶
type ApiError struct {
Code int `json:"code"`
Message string `json:"message"`
MoreInfo string `json:"moreInfo"`
}
ApiError holds error details as returned by the Oanda servers.
type AutochartistArg ¶
type AutochartistArg interface {
// contains filtered or unexported methods
}
type AutochartistPattern ¶
type AutochartistPattern struct {
Signals []AutochartistSignal `json:"signals"`
Provider string `json:"provider"`
}
func (AutochartistPattern) String ¶
func (p AutochartistPattern) String() string
type AutochartistSignal ¶
type AutochartistSignal struct {
Meta AutochartistSignalMeta `json:"meta"`
Id Id `json:"id"`
Instrument string `json:"instrument"`
Type string `json:"type"`
Data AutochartistSignalData `json:"data"`
}
func (AutochartistSignal) String ¶
func (s AutochartistSignal) String() string
type AutochartistSignalData ¶
type AutochartistSignalData struct {
PatternEndTime int64
Points struct {
Resistance Point `json:"resistance"`
Support Point `json:"support"`
} `json:"points"`
Prediction Prediction `json:"prediction"`
}
func (AutochartistSignalData) String ¶
func (d AutochartistSignalData) String() string
type AutochartistSignalMeta ¶
type AutochartistSignalMeta struct {
Completed int `json:"completed"`
Scores struct {
Uniformity int `json:"uniformity"`
Quality int `json:"quality"`
Breakout int `json:"breakout"`
InitialTrend int `json:"initialtrend"`
Clarity int `json:"clarity"`
}
Probability float64 `json:"probability"`
Interval int `json:"interval"`
Direction int `json:"direction"`
Pattern string `json:"pattern"`
Length int `json:"length"`
HistoricalStats HistoricalStats `json:"historicalstats"`
TrendType string `json:"trendtype"`
}
func (AutochartistSignalMeta) String ¶
func (m AutochartistSignalMeta) String() string
type BidAskCandle ¶
type BidAskCandle struct {
Time Time `json:"time"`
OpenBid float64 `json:"openBid"`
OpenAsk float64 `json:"openAsk"`
HighBid float64 `json:"highBid"`
HighAsk float64 `json:"highAsk"`
LowBid float64 `json:"lowBid"`
LowAsk float64 `json:"lowAsk"`
CloseBid float64 `json:"closeBid"`
CloseAsk float64 `json:"closeAsk"`
Volume int `json:"volume"`
Complete bool `json:"complete"`
}
func (BidAskCandle) String ¶
func (c BidAskCandle) String() string
type BidAskCandles ¶
type BidAskCandles struct {
Instrument string `json:"instrument"`
Granularity Granularity `json:"granularity"`
Candles []BidAskCandle `json:"candles"`
}
BidAskCandles represents Bid and Ask instrument history with a specific granularity.
func (BidAskCandles) String ¶
func (c BidAskCandles) String() string
type CalendarEvent ¶
type CalendarEvent struct {
Title string `json:"title"`
Timestamp int64 `json:"timestamp"`
Unit string `json:"unit"`
Currency string `json:"currency"`
Forecast float64 `json:"forecast,string"`
Previous float64 `json:"previous,string"`
Actual float64 `json:"actual,string"`
Market float64 `json:"market,string"`
}
func (CalendarEvent) String ¶
func (ce CalendarEvent) String() string
type CancelOrderResponse ¶
type CandlesArg ¶
type CandlesArg interface {
// contains filtered or unexported methods
}
CandlesArg implements optional arguments for MidpointCandles and BidAskCandles.
type Client ¶
func NewFxPracticeClient ¶
NewFxPracticeClient returns a client instance that connects to Oanda's fxpractice environment. String token should be set to the generated personal access token.
See http://developer.oanda.com/docs/v1/auth/ for further information.
func NewFxTradeClient ¶
NewFxTradeClient returns a client instance that connects to Oanda's fxtrade environment. String token should be set to the generated personal access token.
See http://developer.oanda.com/docs/v1/auth/ for further information.
func (*Client) Account ¶
Account queries the Oanda servers for account information for the specified accountId and returns a new Account instance.
func (*Client) AutochartistPattern ¶
func (c *Client) AutochartistPattern(arg ...AutochartistArg) (*AutochartistPattern, error)
AutochartistPattern
func (*Client) Calendar ¶
func (c *Client) Calendar(instrument string, period Period) ([]CalendarEvent, error)
Calendar returns and array of economic calendar events associated with an instrument. Events can include economic indicator data or they can solely be be news about important meetings.
See http://developer.oanda.com/docs/v1/forex-labs/#calendar for further information.
func (*Client) CancelOrder ¶
func (c *Client) CancelOrder(orderId Id) (*CancelOrderResponse, error)
CancelOrder closes an open order.
func (*Client) CancelRequest ¶
CancelRequest aborts an in-progress HTTP request.
func (*Client) CloseIdleConnections ¶
func (c *Client) CloseIdleConnections()
Closes all idle connections to the Oanda server.
func (*Client) ClosePosition ¶
func (c *Client) ClosePosition(instrument string) (*PositionCloseResponse, error)
ClosePosition closes an existing position.
func (*Client) CloseTrade ¶
func (c *Client) CloseTrade(tradeId Id) (*CloseTradeResponse, error)
CloseTrade closes an open trade.
func (*Client) CommitmentsOfTraders ¶
func (c *Client) CommitmentsOfTraders(instrument string) ([]CommitmentsOfTraders, error)
CommitmentsOfTraders returns up to 4 years of commitments of traders.
The commitments of traders report is released by the CFTC and provides a breakdown of each Tuesday's open interest.
func (*Client) FullEventHistory ¶
FullEventHistory returns a url from which a file containing the full transaction history for the account can be downloaded.
func (*Client) Instruments ¶
func (c *Client) Instruments(instruments []string, fields []InstrumentField) (map[string]InstrumentInfo, error)
Instruments returns instrument information. Only the specified instruments are returned if instruments is not nil. If fields is not nil additional information fields is included.
See http://developer.oanda.com/docs/v1/rates/#get-an-instrument-list for further information.
func (*Client) ModifyOrder ¶
func (c *Client) ModifyOrder(orderId Id, arg ModifyOrderArg, args ...ModifyOrderArg) (*Order, error)
ModifyOrder updates an open order. Supported arguments are Units(), Price(), Expiry(), UpperBound(), StopLoss(), TakeProfit() and TrailingStop().
func (*Client) ModifyTrade ¶
func (c *Client) ModifyTrade(tradeId Id, arg ModifyTradeArg, args ...ModifyTradeArg) (*Trade, error)
ModifyTrade modifies an open trade. Supported optional arguments are StopLoss(), TakeProfit(), TrailingStop()
func (*Client) NewEventServer ¶
func (c *Client) NewEventServer(accountId ...Id) (*EventServer, error)
NewEventServer returns an server instance for receiving events for the specified accountId(s). If no accountId is specified events for all accountIds are received.
See http://developer.oanda.com/docs/v1/stream/#events-streaming for further information.
func (*Client) NewOrder ¶
func (c *Client) NewOrder(orderType OrderType, side TradeSide, units int, instrument string, price float64, expiry time.Time, args ...NewOrderArg) (*Order, error)
NewOrder creates and submits a new order.
func (*Client) NewPricePoller ¶
NewPricePoller returns a poller to repeatedly poll Oanda for updates of the same set of instruments.
func (*Client) NewPriceServer ¶
func (c *Client) NewPriceServer(instrs ...string) (*PriceServer, error)
NewPriceServer returns a PriceServer instance for receiving and handling Ticks.
func (*Client) NewRequest ¶
NewRequest creates a new http request.
func (*Client) NewTrade ¶
func (c *Client) NewTrade(side TradeSide, units int, instrument string, args ...NewTradeArg) (*Trade, error)
NewTrade submits a MarketOrder request to the Oanda servers. Supported OptionalArgs are UpperBound(), LowerBound(), StopLoss(), TakeProfit() and TrailingStop().
func (*Client) OrderBooks ¶
func (c *Client) OrderBooks(instrument string, period Period) (OrderBooks, error)
Orderbook returns historic order book data.
See http://developer.oanda.com/docs/v1/forex-labs/#orderbook for further information.
func (*Client) Orders ¶
Orders returns an array with all orders that match the optional arguments (if any). Supported OrdersArg are MaxId, Count and Instrument.
func (*Client) PollBidAskCandles ¶
func (c *Client) PollBidAskCandles(instrument string, granularity Granularity, args ...CandlesArg) (*BidAskCandles, error)
PollBidAskCandles returns historical bid- and ask prices for an instrument.
func (*Client) PollEvents ¶
PollEvents returns an array of events. Optional arguments are MaxId, MinId, Count, Instrument and Ids.
See http://developer.oanda.com/docs/v1/transactions/#get-transaction-history for further information.
func (*Client) PollMidpointCandles ¶
func (c *Client) PollMidpointCandles(instrument string, granularity Granularity, args ...CandlesArg) (*MidpointCandles, error)
PollMidpointCandles returns historical midpoint prices for an instrument.
func (*Client) PollPrices ¶
PollPrices returns the latest PriceTick for the specified instruments.
func (*Client) PollPricesSince ¶
PollPricesSince returns the PriceTicks for instruments. If since is not the zero time instruments whose prices were not updated since the requested time.Time are excluded from the result.
func (*Client) PositionRatios ¶
func (c *Client) PositionRatios(instrument string, period Period) (*PositionRatios, error)
PositionRatios returns daily position ratios for an instrument. A position ratio is the percentage of Oanda clients that have a Long/Short position.
See http://developer.oanda.com/docs/v1/forex-labs/#historical-position-ratios for further information.
func (*Client) SelectAccount ¶
SelectAccount configures an Oanda account. All trades and orders will be booked under the selected account. Use AccountId 0 to disable account selection.
func (*Client) Spreads ¶
Spreads returns historical spread data for a specific period in 15 min intervals. If unique is true then adjacent duplicate spreads are omitted.
See http://developer.oanda.com/docs/v1/forex-labs/#spreads for further information.
type CloseTradeResponse ¶
type CommitmentsOfTraders ¶
type CommitmentsOfTraders struct {
Date int64 `json:"date"`
Price float64 `json:"price,string"`
OverallInterest int `json:"oi,string"`
NonCommercialLong int `json:"ncl,string"`
NonCommercialShort int `json:"ncs,string"`
Unit string `json:"unit"`
}
func (CommitmentsOfTraders) String ¶
func (c CommitmentsOfTraders) String() string
type ContentType ¶
type ContentType string
A ContentType adds a Content-Type entry to the request header.
type Count ¶
type Count int
Count is an optional argument for Client methods Events(), Orders(), /MidpriceCandles(), BidAskCandles() and Trades().
type DailyAlignment ¶
type DailyAlignment int
Optional argument for PollMidpriceCandles and PollBidAskCandles to indicate the hour at which candles hould be aligned. Only relevant for hourly or greater granularities.
See http://developer.oanda.com/docs/v1/rates/#retrieve-instrument-history for further information.
type DailyInterestEvent ¶
type DailyInterestEvent struct {
// contains filtered or unexported fields
}
DailyInterestEvent represents an event of type DAILY_INTEREST.
func (*DailyInterestEvent) Interest ¶
func (t *DailyInterestEvent) Interest() float64
func (DailyInterestEvent) String ¶
func (t DailyInterestEvent) String() string
String implementes the fmt.Stringer interface.
func (*DailyInterestEvent) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type DateFormat ¶
type DateFormat string
A DateFormat add the desired DateTime format to a request header.
type EndTime ¶
Optional argument for PollMidpriceCandles and PollBidAskCandles to specify the end time of until which instrument history should be included.
See http://developer.oanda.com/docs/v1/rates/#retrieve-instrument-history for further information.
type Environment ¶
type Environment string
type Event ¶
func EventFromJSON ¶
EventFromJSON returns an OANDA Event object given JSON input.
type EventHandlerFunc ¶
type EventServer ¶
type EventServer struct {
// If HeartbeatFunc is not nil it is invoked once for every heartbeat message that the
// EventServer receives.
HeartbeatFunc HeartbeatHandlerFunc
// contains filtered or unexported fields
}
An EventServer receives events (aka transactions) for one or more accountId(s).
func (*EventServer) ConnectAndHandle ¶
func (es *EventServer) ConnectAndHandle(handleFn EventHandlerFunc) (err error)
ConnectAndDispatch starts the event server and blocks until Stop() is called. Function handleFn is called for each event that is received.
See http://developer.oanda.com/docs/v1/stream/ and http://developer.oanda.com/docs/v1/transactions/ for further information.
func (*EventServer) Stop ¶
func (es *EventServer) Stop()
Stop terminates the events server and causes ConnectAndHandle() to return.
type EventsArg ¶
type EventsArg interface {
// contains filtered or unexported methods
}
EventsArg is an optional argument for method PollEvents.
type FeeEvent ¶
type FeeEvent struct {
// contains filtered or unexported fields
}
FeeEvent represents an event of type FEE
func (*FeeEvent) AccountBalance ¶
func (FeeEvent) String ¶
func (t FeeEvent) String() string
String implementes the fmt.Stringer interface.
func (*FeeEvent) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type Granularity ¶
type Granularity string
Granularity determines the interval at which historic instrument prices are converted into candles.
const ( S5 Granularity = "S5" S10 Granularity = "S10" S15 Granularity = "S15" S30 Granularity = "S30" M1 Granularity = "M1" M2 Granularity = "M2" M3 Granularity = "M3" M5 Granularity = "M5" M10 Granularity = "M10" M15 Granularity = "M15" M30 Granularity = "M30" H1 Granularity = "H1" H2 Granularity = "H2" H3 Granularity = "H3" H4 Granularity = "H4" H6 Granularity = "H6" H8 Granularity = "H8" H12 Granularity = "H12" D Granularity = "D" W Granularity = "W" M Granularity = "M" )
type HeartbeatHandlerFunc ¶
type HeartbeatHandlerFunc func(Time)
type HistoricalStats ¶
type HistoricalStats struct {
HourOfDay Stats `json:"hourofday"`
Pattern Stats `json:"pattern"`
Symbol Stats `json:"symbol"`
}
func (HistoricalStats) String ¶
func (s HistoricalStats) String() string
type IncludeFirst ¶
type IncludeFirst bool
Optional argument for PollMidpriceCandles and PollBidAskCandles to indicate whether the candle that starts at StartTime should be included.
See http://developer.oanda.com/docs/v1/rates/#retrieve-instrument-history for further information.
type Instrument ¶
type Instrument string
Instrument is an optional argument for Client methods Events(), Orders() and Trades().
type InstrumentField ¶
type InstrumentField string
const ( DisplayNameField InstrumentField = "displayName" PipField InstrumentField = "pip" MaxTradeUnitsField InstrumentField = "maxTradeUnits" PrecisionField InstrumentField = "precision" MaxTrailingStopField InstrumentField = "maxTrailingStop" MinTrailingStopField InstrumentField = "minTrailingStop" MarginRateField InstrumentField = "marginRate" HaltedField InstrumentField = "halted" InterestRateField InstrumentField = "interestRate" )
type InstrumentInfo ¶
type InstrumentInfo struct {
DisplayName string `json:"displayName"`
Pip float64 `json:"pip,string"`
MaxTradeUnits int `json:"maxTradeUnits"`
Precision float64 `json:"precision,string"`
MaxTrailingStop float64 `json:"maxTrailingStop"`
MinTrailingStop float64 `json:"minTrailingStop"`
MarginRate float64 `json:"marginRate"`
Halted bool `json:"halted"`
InterestRate map[string]InterestRate `json:"interestRate"`
}
func (InstrumentInfo) String ¶
func (ii InstrumentInfo) String() string
type InterestRate ¶
func (InterestRate) String ¶
func (ir InterestRate) String() string
type LowerBound ¶
type LowerBound float64
LowerBound is an optional argument for Client methods NewOrder(), ModifyOrder() and NewTrade().
type MaxId ¶
type MaxId Id
MaxId is an optional argument for Client methods Events(), Orders() and Trades().
type MidpointCandle ¶
type MidpointCandle struct {
Time Time `json:"time"`
OpenMid float64 `json:"openMid"`
HighMid float64 `json:"highMid"`
LowMid float64 `json:"lowMid"`
CloseMid float64 `json:"closeMid"`
Volume int `json:"volume"`
Complete bool `json:"complete"`
}
func (MidpointCandle) String ¶
func (c MidpointCandle) String() string
type MidpointCandles ¶
type MidpointCandles struct {
Instrument string `json:"instrument"`
Granularity Granularity `json:"granularity"`
Candles []MidpointCandle `json:"candles"`
}
MidpointCandles represents instrument history with a specific granularity.
func (MidpointCandles) String ¶
func (c MidpointCandles) String() string
type MigrateTradeOpenEvent ¶
type MigrateTradeOpenEvent struct {
// contains filtered or unexported fields
}
MigrateTradeOpenEvent represents an event of type MIGRATE_TRADE_OPEN
func (*MigrateTradeOpenEvent) Instrument ¶
func (t *MigrateTradeOpenEvent) Instrument() string
func (*MigrateTradeOpenEvent) Price ¶
func (t *MigrateTradeOpenEvent) Price() float64
func (*MigrateTradeOpenEvent) Side ¶
func (t *MigrateTradeOpenEvent) Side() string
func (*MigrateTradeOpenEvent) StopLossPrice ¶
func (t *MigrateTradeOpenEvent) StopLossPrice() float64
func (MigrateTradeOpenEvent) String ¶
func (t MigrateTradeOpenEvent) String() string
String implementes the fmt.Stringer interface.
func (*MigrateTradeOpenEvent) TakeProfitPrice ¶
func (t *MigrateTradeOpenEvent) TakeProfitPrice() float64
func (*MigrateTradeOpenEvent) TradeOpened ¶
func (t *MigrateTradeOpenEvent) TradeOpened() *evtTradeDetail
func (*MigrateTradeOpenEvent) TrailingStopLossDistance ¶
func (t *MigrateTradeOpenEvent) TrailingStopLossDistance() float64
func (*MigrateTradeOpenEvent) Units ¶
func (t *MigrateTradeOpenEvent) Units() int
func (*MigrateTradeOpenEvent) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type ModifyOrderArg ¶
type ModifyOrderArg interface {
// contains filtered or unexported methods
}
ModifyOrderArg represents an opional argument for method ModifyOrder. Types that implement the interface are Units, Price, Expiry, LowerBound, UpperBound, StopLoss, TakeProfit and TrailingStop.
type ModifyTradeArg ¶
type ModifyTradeArg interface {
// contains filtered or unexported methods
}
type NewOrderArg ¶
type NewOrderArg interface {
// contains filtered or unexported methods
}
NewOrderArg represents an optional argument for method NewOrder. Types that implement the interface are LowerBound, UpperBound, StopLoss, TakeProfit and TrailingStop.
type NewTradeArg ¶
type NewTradeArg interface {
// contains filtered or unexported methods
}
type Order ¶
type Order struct {
OrderId Id `json:"id"`
Units int `json:"units"`
Instrument string `json:"instrument"`
Side string `json:"side"`
Price float64 `json:"price"`
Time Time `json:"time"`
StopLoss float64 `json:"stopLoss"`
TakeProfit float64 `json:"takeProfit"`
TrailingStop float64 `json:"trailingStop"`
TrailingAmount float64 `json:"trailingAmount"`
OrderType string `json:"type"`
Expiry Time `json:"expiry"`
UpperBound float64 `json:"upperBound"`
LowerBound float64 `json:"lowerBound"`
}
type OrderBook ¶
type OrderBook struct {
Timestamp Time
MarketPrice float64
PricePoints []PricePoint
}
OrderBook represents the order book at a specific time.
func (*OrderBook) UnmarshalJSON ¶
type OrderBooks ¶
type OrderBooks []OrderBook
func (*OrderBooks) Sort ¶
func (obs *OrderBooks) Sort()
func (*OrderBooks) UnmarshalJSON ¶
func (obs *OrderBooks) UnmarshalJSON(data []byte) error
type OrderCancelEvent ¶
type OrderCancelEvent struct {
// contains filtered or unexported fields
}
OrderCancelEvent represents and event of type ORDER_CANCEL.
func (*OrderCancelEvent) OrderId ¶
func (t *OrderCancelEvent) OrderId() Id
func (*OrderCancelEvent) Reason ¶
func (t *OrderCancelEvent) Reason() string
func (OrderCancelEvent) String ¶
func (t OrderCancelEvent) String() string
String implementes the fmt.Stringer interface.
func (*OrderCancelEvent) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type OrderCreateEvent ¶
type OrderCreateEvent struct {
// contains filtered or unexported fields
}
OrderCreateEvent represents an event of type LIMIT_ORDER_CREATE, STOP_ORDER_CREATE or MARKET_IF_TOUCHED_CREATE
func (*OrderCreateEvent) Expiry ¶
func (t *OrderCreateEvent) Expiry() Time
func (*OrderCreateEvent) Instrument ¶
func (t *OrderCreateEvent) Instrument() string
func (*OrderCreateEvent) LowerBound ¶
func (t *OrderCreateEvent) LowerBound() float64
func (*OrderCreateEvent) Price ¶
func (t *OrderCreateEvent) Price() float64
func (*OrderCreateEvent) Reason ¶
func (t *OrderCreateEvent) Reason() string
func (*OrderCreateEvent) Side ¶
func (t *OrderCreateEvent) Side() string
func (*OrderCreateEvent) StopLossPrice ¶
func (t *OrderCreateEvent) StopLossPrice() float64
func (OrderCreateEvent) String ¶
func (t OrderCreateEvent) String() string
String implementes the fmt.Stringer interface.
func (*OrderCreateEvent) TakeProfitPrice ¶
func (t *OrderCreateEvent) TakeProfitPrice() float64
func (*OrderCreateEvent) TrailingStopLossDistance ¶
func (t *OrderCreateEvent) TrailingStopLossDistance() float64
func (*OrderCreateEvent) Units ¶
func (t *OrderCreateEvent) Units() int
func (*OrderCreateEvent) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*OrderCreateEvent) UpperBound ¶
func (t *OrderCreateEvent) UpperBound() float64
type OrderFilledEvent ¶
type OrderFilledEvent struct {
// contains filtered or unexported fields
}
OrderFilledEvent represents an event of type ORDER_FILLED.
func (*OrderFilledEvent) OrderId ¶
func (t *OrderFilledEvent) OrderId() Id
func (OrderFilledEvent) String ¶
func (t OrderFilledEvent) String() string
String implementes the fmt.Stringer interface.
func (*OrderFilledEvent) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type OrderUpdateEvent ¶
type OrderUpdateEvent struct {
// contains filtered or unexported fields
}
OrderUpdateEvent represents an event of type ORDER_UPDATE
func (*OrderUpdateEvent) Instrument ¶
func (t *OrderUpdateEvent) Instrument() string
func (*OrderUpdateEvent) LowerBound ¶
func (t *OrderUpdateEvent) LowerBound() float64
func (*OrderUpdateEvent) Reason ¶
func (t *OrderUpdateEvent) Reason() string
func (*OrderUpdateEvent) Side ¶
func (t *OrderUpdateEvent) Side() string
func (*OrderUpdateEvent) StopLossPrice ¶
func (t *OrderUpdateEvent) StopLossPrice() float64
func (OrderUpdateEvent) String ¶
func (t OrderUpdateEvent) String() string
String implementes the fmt.Stringer interface.
func (*OrderUpdateEvent) TakeProfitPrice ¶
func (t *OrderUpdateEvent) TakeProfitPrice() float64
func (*OrderUpdateEvent) TrailingStopLossDistance ¶
func (t *OrderUpdateEvent) TrailingStopLossDistance() float64
func (*OrderUpdateEvent) Units ¶
func (t *OrderUpdateEvent) Units() int
func (*OrderUpdateEvent) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*OrderUpdateEvent) UpperBound ¶
func (t *OrderUpdateEvent) UpperBound() float64
type OrdersArg ¶
type OrdersArg interface {
// contains filtered or unexported methods
}
OrderArgs represents an optional argument for method Orders. Types that implement the interface are MaxId, Count and Instrument.
type Point ¶
type PollRequest ¶
type PollRequest struct {
// contains filtered or unexported fields
}
PollRequest represents an http request that can be executed repeatedly.
type Position ¶
type PositionCloseResponse ¶
type PositionRatio ¶
type PositionRatios ¶
type PositionRatios struct {
Instrument string
DisplayName string
Ratios []PositionRatio
}
func (PositionRatios) String ¶
func (pr PositionRatios) String() string
func (*PositionRatios) UnmarshalJSON ¶
func (pr *PositionRatios) UnmarshalJSON(data []byte) error
type Prediction ¶
type Prediction struct {
TimeTo int64 `json:"timeto"`
TimeFrom int64 `json:"timefrom"`
PriceHigh float64 `json:"pricehigh"`
PriceLow float64 `json:"pricelow"`
}
func (Prediction) String ¶
func (p Prediction) String() string
type PricePoint ¶
type PricePoint struct {
Price float64
OrdersShort float64 `json:"os"`
OrdersLong float64 `json:"ol"`
PositionsShort float64 `json:"ps"`
PositionsLong float64 `json:"pl"`
}
Pricepoint defines the number of orders and positions at a certain price.
func (PricePoint) String ¶
func (pp PricePoint) String() string
type PricePoller ¶
type PricePoller struct {
// contains filtered or unexported fields
}
func (*PricePoller) Poll ¶
func (pp *PricePoller) Poll() (Prices, error)
Poll returns the most recent set of prices for the instruments with which the PricePoller was configured.
type PriceServer ¶
type PriceServer struct {
// If HeartbeatFunc is not nil it is invoked once for every heartbeat message that the
// PriceServer receives.
HeartbeatFunc HeartbeatHandlerFunc
// contains filtered or unexported fields
}
A PriceServer receives PriceTicks for one or more instrument(s).
func (*PriceServer) ConnectAndHandle ¶
func (ps *PriceServer) ConnectAndHandle(handleFn TickHandlerFunc) error
ConnectAndHandle connects to the Oanda server and invokes handleFn for every Tick received.
type PriceTick ¶
type PriceTick struct {
Time Time `json:"time"`
Bid float64 `json:"bid"`
Ask float64 `json:"ask"`
Status string `json:"status"`
}
PriceTick holds the Bid price, Ask price and status for an instrument at a given point in time
type SetMarginRateEvent ¶
type SetMarginRateEvent struct {
// contains filtered or unexported fields
}
SetMarginRateEvent represent and event of type SET_MARGIN_RATE.
func (*SetMarginRateEvent) MarginRate ¶
func (t *SetMarginRateEvent) MarginRate() float64
func (SetMarginRateEvent) String ¶
func (t SetMarginRateEvent) String() string
String implementes the fmt.Stringer interface.
func (*SetMarginRateEvent) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type Spread ¶
func (*Spread) UnmarshalJSON ¶
type Spreads ¶
type StartTime ¶
Optional argument for PollMidpriceCandles and PollBidAskCandles to specify the start time from which instrument history should be included.
See http://developer.oanda.com/docs/v1/rates/#retrieve-instrument-history for further information.
type Stats ¶
type StopLoss ¶
type StopLoss float64
StopLoss is an optional argument for Client methods NewOrder(), ModifyOrder(), NewTrade() and ModifyTrade().
type StreamHandler ¶
type StreamHandler interface {
HandleHeartbeats(<-chan Time)
HandleMessages(<-chan StreamMessage)
}
type StreamMessage ¶
type StreamMessage struct {
Type string
RawMessage json.RawMessage
}
func (StreamMessage) String ¶
func (msg StreamMessage) String() string
func (*StreamMessage) UnmarshalJSON ¶
func (msg *StreamMessage) UnmarshalJSON(data []byte) error
type StreamServer ¶
type StreamServer struct {
// contains filtered or unexported fields
}
func (StreamServer) HandleHeartbeats ¶
func (ss StreamServer) HandleHeartbeats(hbC <-chan Time)
func (StreamServer) HandleMessages ¶
func (ss StreamServer) HandleMessages(msgC <-chan StreamMessage)
type TakeProfit ¶
type TakeProfit float64
TakeProfit is an optional argument for Client methods NewOrder(), ModifyOrder(), NewTrade(), and ModifyTrade().
type TickHandlerFunc ¶
type TimedReader ¶
func NewTimedReader ¶
func NewTimedReader(rc io.ReadCloser, timeout time.Duration) *TimedReader
NewTimedReader returns an instance of TimedReader where Read operations time out.
func (*TimedReader) Close ¶
func (r *TimedReader) Close() error
type TokenAuthenticator ¶
type TokenAuthenticator string
A TokenAuthenticator adds a Bearer authentication to a request header.
type Trade ¶
type Trade struct {
TradeId Id `json:"id"`
Units int `json:"units"`
Instrument string `json:"instrument"`
Side string `json:"side"`
Price float64 `json:"price"`
Time Time `json:"time"`
StopLoss float64 `json:"stopLoss"`
TakeProfit float64 `json:"takeProfit"`
TrailingStop float64 `json:"trailingStop"`
TrailingAmount float64 `json:"trailingAmount"`
}
Trade represents an open Oanda trade.
type TradeCloseEvent ¶
type TradeCloseEvent struct {
// contains filtered or unexported fields
}
TradeCloseEvent represents an event of type TRADE_CLOSE, MIGRATE_TRADE_CLOSE, TAKE_PROFIT_FILLED, STOP_LOSS_FILLED, TRAILING_STOP_FILLED or MARGIN_CLOSEOUT.
func (*TradeCloseEvent) AccountBalance ¶
func (t *TradeCloseEvent) AccountBalance() float64
func (*TradeCloseEvent) Instrument ¶
func (t *TradeCloseEvent) Instrument() string
func (*TradeCloseEvent) Interest ¶
func (t *TradeCloseEvent) Interest() float64
func (*TradeCloseEvent) Pl ¶
func (t *TradeCloseEvent) Pl() float64
func (*TradeCloseEvent) Price ¶
func (t *TradeCloseEvent) Price() float64
func (*TradeCloseEvent) Side ¶
func (t *TradeCloseEvent) Side() string
func (TradeCloseEvent) String ¶
func (t TradeCloseEvent) String() string
String implementes the fmt.Stringer interface.
func (*TradeCloseEvent) TradeId ¶
func (t *TradeCloseEvent) TradeId() Id
func (*TradeCloseEvent) Units ¶
func (t *TradeCloseEvent) Units() int
func (*TradeCloseEvent) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type TradeCreateEvent ¶
type TradeCreateEvent struct {
// contains filtered or unexported fields
}
TradeCreateEvent represents an event of type MARKET_ORDER_CREATE
func (*TradeCreateEvent) AccountBalance ¶
func (t *TradeCreateEvent) AccountBalance() float64
func (*TradeCreateEvent) Instrument ¶
func (t *TradeCreateEvent) Instrument() string
func (*TradeCreateEvent) Interest ¶
func (t *TradeCreateEvent) Interest() float64
func (*TradeCreateEvent) LowerBound ¶
func (t *TradeCreateEvent) LowerBound() float64
func (*TradeCreateEvent) Pl ¶
func (t *TradeCreateEvent) Pl() float64
func (*TradeCreateEvent) Price ¶
func (t *TradeCreateEvent) Price() float64
func (*TradeCreateEvent) Side ¶
func (t *TradeCreateEvent) Side() string
func (*TradeCreateEvent) StopLossPrice ¶
func (t *TradeCreateEvent) StopLossPrice() float64
func (TradeCreateEvent) String ¶
func (t TradeCreateEvent) String() string
String implementes the fmt.Stringer interface.
func (*TradeCreateEvent) TakeProfitPrice ¶
func (t *TradeCreateEvent) TakeProfitPrice() float64
func (*TradeCreateEvent) TradeOpened ¶
func (t *TradeCreateEvent) TradeOpened() *evtTradeDetail
func (*TradeCreateEvent) TradeReduced ¶
func (t *TradeCreateEvent) TradeReduced() *evtTradeDetail
func (*TradeCreateEvent) TrailingStopLossDistance ¶
func (t *TradeCreateEvent) TrailingStopLossDistance() float64
func (*TradeCreateEvent) Units ¶
func (t *TradeCreateEvent) Units() int
func (*TradeCreateEvent) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*TradeCreateEvent) UpperBound ¶
func (t *TradeCreateEvent) UpperBound() float64
type TradeUpdateEvent ¶
type TradeUpdateEvent struct {
// contains filtered or unexported fields
}
TradeUpdateEvent represents an event of type TRADE_UPDATE
func (*TradeUpdateEvent) Instrument ¶
func (t *TradeUpdateEvent) Instrument() string
func (*TradeUpdateEvent) Side ¶
func (t *TradeUpdateEvent) Side() string
func (*TradeUpdateEvent) StopLossPrice ¶
func (t *TradeUpdateEvent) StopLossPrice() float64
func (TradeUpdateEvent) String ¶
func (t TradeUpdateEvent) String() string
String implementes the fmt.Stringer interface.
func (*TradeUpdateEvent) TailingStopLossDistance ¶
func (t *TradeUpdateEvent) TailingStopLossDistance() float64
func (*TradeUpdateEvent) TakeProfitPrice ¶
func (t *TradeUpdateEvent) TakeProfitPrice() float64
func (*TradeUpdateEvent) TradeId ¶
func (t *TradeUpdateEvent) TradeId() Id
func (*TradeUpdateEvent) Units ¶
func (t *TradeUpdateEvent) Units() int
func (*TradeUpdateEvent) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type TrailingStop ¶
type TrailingStop float64
TrailingStop is an optional argument for Client methods NewOrder(), ModifyOrder(), NewTrade() and ModifyTrade().
type TransferFundsEvent ¶
type TransferFundsEvent struct {
// contains filtered or unexported fields
}
TransferFundsEvent represents an event of type TRANSFER_FUNDS.
func (*TransferFundsEvent) Amount ¶
func (t *TransferFundsEvent) Amount() float64
func (TransferFundsEvent) String ¶
func (t TransferFundsEvent) String() string
String implementes the fmt.Stringer interface.
func (*TransferFundsEvent) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type UpperBound ¶
type UpperBound float64
UpperBound is an optional argument for Client methods NewOrder(), ModifyOrder() and NewTrade().
type WeeklyAlignment ¶
Optional argument for PollMidpriceCandles and PollBidAskCandles to indicate the weekday at which candles should be aligned. Only relevant for weekly granularity.
See http://developer.oanda.com/docs/v1/rates/#retrieve-instrument-history for further information.