Documentation ¶
Index ¶
- Constants
- type Balance
- type CandleStick
- type CandleTime
- type ExchangeProvider
- type ExchangeProviderBittrex
- func (p ExchangeProviderBittrex) AllCandleSticks(market string, interval string) ([]CandleStick, error)
- func (p ExchangeProviderBittrex) Balance(ticker string) (Balance, error)
- func (p ExchangeProviderBittrex) Balances() ([]Balance, error)
- func (p ExchangeProviderBittrex) Buy(market string, amount decimal.Decimal, rate decimal.Decimal) (string, error)
- func (p ExchangeProviderBittrex) LastCandleStick(market string, interval string) (CandleStick, error)
- func (p ExchangeProviderBittrex) MarketSummary(market string) (MarketSummary, error)
- func (p ExchangeProviderBittrex) Name() string
- func (p ExchangeProviderBittrex) Sell(market string, amount decimal.Decimal, rate decimal.Decimal) (string, error)
- type ExchangeProviderFake
- func (p *ExchangeProviderFake) AllCandleSticks(market string, interval string) ([]CandleStick, error)
- func (p *ExchangeProviderFake) Balance(ticker string) (Balance, error)
- func (p *ExchangeProviderFake) Balances() ([]Balance, error)
- func (p *ExchangeProviderFake) Buy(market string, amount decimal.Decimal, rate decimal.Decimal) (string, error)
- func (p *ExchangeProviderFake) LastCandleStick(market string, interval string) (CandleStick, error)
- func (p *ExchangeProviderFake) MarketSummary(market string) (MarketSummary, error)
- func (p *ExchangeProviderFake) Name() string
- func (p *ExchangeProviderFake) OnEnd(cb func())
- func (p *ExchangeProviderFake) Sell(market string, amount decimal.Decimal, rate decimal.Decimal) (string, error)
- type MarketSummary
- type TestMarketAction
Constants ¶
View Source
const EXCHANGE_COMISSION = 0.0025
View Source
const EXCHANGE_PROVIDER_BITTREX = "bittrex"
View Source
const EXCHANGE_PROVIDER_FAKE = "fake"
View Source
const HISTORY_SIZE = 1000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CandleStick ¶
type CandleStick struct { High decimal.Decimal `json:"H,required"` Open decimal.Decimal `json:"O,required"` Close decimal.Decimal `json:"C,required"` Low decimal.Decimal `json:"L,required"` Volume decimal.Decimal `json:"V,required"` BaseVolume decimal.Decimal `json:"BV,required"` Timestamp CandleTime `json:"T,required"` }
CandleStick represents a single candlestick in a chart.
func CopyCandles ¶
func CopyCandles(candles []CandleStick) []CandleStick
type CandleTime ¶
func (*CandleTime) MarshalJSON ¶
func (t *CandleTime) MarshalJSON() ([]byte, error)
func (*CandleTime) UnmarshalJSON ¶
func (t *CandleTime) UnmarshalJSON(b []byte) error
type ExchangeProvider ¶
type ExchangeProvider interface { Balances() ([]Balance, error) Balance(ticker string) (Balance, error) Buy(market string, amount decimal.Decimal, rate decimal.Decimal) (string, error) Sell(market string, amount decimal.Decimal, rate decimal.Decimal) (string, error) Name() string AllCandleSticks(market string, interval string) ([]CandleStick, error) LastCandleStick(market string, interval string) (CandleStick, error) MarketSummary(market string) (MarketSummary, error) }
func ExchangeClient ¶
func ExchangeClient(name string, config map[string]string) ExchangeProvider
func NewExchangeProviderBittrex ¶
func NewExchangeProviderBittrex(pbk string, pvk string, config map[string]string) ExchangeProvider
type ExchangeProviderBittrex ¶
type ExchangeProviderBittrex struct {
// contains filtered or unexported fields
}
func (ExchangeProviderBittrex) AllCandleSticks ¶
func (p ExchangeProviderBittrex) AllCandleSticks(market string, interval string) ([]CandleStick, error)
func (ExchangeProviderBittrex) Balance ¶
func (p ExchangeProviderBittrex) Balance(ticker string) (Balance, error)
func (ExchangeProviderBittrex) Balances ¶
func (p ExchangeProviderBittrex) Balances() ([]Balance, error)
func (ExchangeProviderBittrex) LastCandleStick ¶
func (p ExchangeProviderBittrex) LastCandleStick(market string, interval string) (CandleStick, error)
func (ExchangeProviderBittrex) MarketSummary ¶
func (p ExchangeProviderBittrex) MarketSummary(market string) (MarketSummary, error)
func (ExchangeProviderBittrex) Name ¶
func (p ExchangeProviderBittrex) Name() string
type ExchangeProviderFake ¶
type ExchangeProviderFake struct { Actions []TestMarketAction // contains filtered or unexported fields }
func NewExchangeProviderFake ¶
func NewExchangeProviderFake(testbed []CandleStick, config map[string]string, balances map[string]decimal.Decimal) ExchangeProviderFake
func (*ExchangeProviderFake) AllCandleSticks ¶
func (p *ExchangeProviderFake) AllCandleSticks(market string, interval string) ([]CandleStick, error)
func (*ExchangeProviderFake) Balance ¶
func (p *ExchangeProviderFake) Balance(ticker string) (Balance, error)
func (*ExchangeProviderFake) Balances ¶
func (p *ExchangeProviderFake) Balances() ([]Balance, error)
func (*ExchangeProviderFake) LastCandleStick ¶
func (p *ExchangeProviderFake) LastCandleStick(market string, interval string) (CandleStick, error)
func (*ExchangeProviderFake) MarketSummary ¶
func (p *ExchangeProviderFake) MarketSummary(market string) (MarketSummary, error)
func (*ExchangeProviderFake) Name ¶
func (p *ExchangeProviderFake) Name() string
func (*ExchangeProviderFake) OnEnd ¶
func (p *ExchangeProviderFake) OnEnd(cb func())
type MarketSummary ¶
type MarketSummary struct { MarketName string `json:"MarketName,required"` //The name of the market (e.g. BTC-ETH). High decimal.Decimal `json:"High,required"` // The 24h high for the market. Low decimal.Decimal `json:"Low,required"` // The 24h low for the market. Last decimal.Decimal `json:"Last,required"` // The value of the last trade for the market (in base currency). Bid decimal.Decimal `json:"Bid,required"` // The current highest bid value for the market. Ask decimal.Decimal `json:"Ask,required"` // The current lowest ask value for the market. Volume decimal.Decimal `json:"Volume,required"` // The 24h volume of the market, in market currency. BaseVolume decimal.Decimal `json:"BaseVolume,required"` // The 24h volume for the market, in base currency. }
Click to show internal directories.
Click to hide internal directories.