Documentation
¶
Index ¶
- Constants
- Variables
- func GetToken() (name, token string)
- type Account
- type AccountProperties
- type AuthAccount
- type AuthDatetimeFormat
- type AuthParam
- type Contract
- type Instrument
- type Oanda
- func (o *Oanda) Buy(price float64, amount float64) (*Order, error)
- func (o *Oanda) CloseLongMarket(amount float64) (order *Order, err error)
- func (o *Oanda) CloseLongPrice(price, amount float64) (order *Order, err error)
- func (o *Oanda) CloseShortMarket(amount float64) (order *Order, err error)
- func (o *Oanda) CloseShortPrice(price, amount float64) (order *Order, err error)
- func (o *Oanda) FetchAccount() (err error)
- func (o *Oanda) GetAccountInfo(id string) (account *Account, err error)
- func (o *Oanda) GetInstruments() (instruments []*Instrument, err error)
- func (o *Oanda) Kline(start, end time.Time, nLimit int, binSize string) (klines []*Candle, err error)
- func (o *Oanda) KlineChan(start, end time.Time, bSize string) (datas chan []interface{}, err chan error)
- func (o *Oanda) KlineSymbol(symbol string, start, end time.Time, nLimit int, binSize string) (klines []*Candle, err error)
- func (o *Oanda) ListAccounts() (accounts []*Account, err error)
- func (o *Oanda) OpenLong(price float64, amount float64) (order *Order, err error)
- func (o *Oanda) OpenLongMarket(amount float64) (order *Order, err error)
- func (o *Oanda) OpenShort(price float64, amount float64) (order *Order, err error)
- func (o *Oanda) OpenShortMarket(amount float64) (order *Order, err error)
- func (o *Oanda) Sell(price float64, amount float64) (*Order, error)
- func (o *Oanda) SetAccountAlias(alias string)
- func (o *Oanda) SetDebug(debug bool)
- func (o *Oanda) SetProxy(proxy string) (err error)
- func (o *Oanda) SetSymbol(symbol string)
- type Position
Constants ¶
View Source
const ( BaseURL = "" TestBaseURL = "api-fxpractice.oanda.com" )
Variables ¶
View Source
var ( AcceptDateTimeFormat = "RFC3339" DtPtr = &AcceptDateTimeFormat TimeLayout = time.RFC3339Nano )
Functions ¶
Types ¶
type AccountProperties ¶
type AccountProperties = models.AccountProperties
type AuthAccount ¶
type AuthAccount interface {
SetAccountID(string)
}
type AuthDatetimeFormat ¶
type AuthDatetimeFormat interface {
SetAcceptDatetimeFormat(*string)
}
type Instrument ¶
type Instrument = models.Instrument
type Oanda ¶
type Oanda struct {
// contains filtered or unexported fields
}
func GetDebugClient ¶
func GetDebugClient() *Oanda
func NewOandaWithURL ¶
NewOandaWithURL create oanda with url and token
func NewTestOanda ¶
NewOanda create test onada with token
func (*Oanda) CloseLongMarket ¶
func (*Oanda) CloseLongPrice ¶
func (*Oanda) CloseShortMarket ¶
func (*Oanda) CloseShortPrice ¶
func (*Oanda) FetchAccount ¶
FetchAccount fetch account id from server must call first
func (*Oanda) GetAccountInfo ¶
func (*Oanda) GetInstruments ¶
func (o *Oanda) GetInstruments() (instruments []*Instrument, err error)
func (*Oanda) KlineSymbol ¶
func (*Oanda) ListAccounts ¶
func (*Oanda) OpenLongMarket ¶
func (*Oanda) OpenShortMarket ¶
func (*Oanda) SetAccountAlias ¶
SetAccountAlias set which account to use if not set, use the first account
Click to show internal directories.
Click to hide internal directories.