Documentation ¶
Index ¶
- Constants
- Variables
- func Call2File(call *Call, name string) error
- func Fiat(asset string) bool
- func FormatOrderSide(value OrderSide) string
- func GetBaseCurr(markets []Market, market string) (string, error)
- func GetMarket(exchange Exchange) (string, error)
- func GetQuoteCurr(markets []Market, market string) (string, error)
- func GetSizeMax(hold, earn bool, def float64, mult multiplier.Mult, prec func() int) float64
- func GetSizeMin(hold bool, asset string) float64
- func HasMarket(markets []Market, market string) bool
- func IndexByMarket(markets []Market, market string) int
- func ParseMarket(markets []Market, market string) (base, quote string, err error)
- func TweetMarket(markets []Market, market string) string
- type Assets
- type Book
- type BookSide
- type Buy
- type Call
- func (c *Call) Corrupt(orderType OrderType) (bool, string)
- func (c *Call) Deviate(exchange Exchange, client interface{}, kind OrderType, mult float64) (OrderType, float64)
- func (c *Call) HasStop() bool
- func (c *Call) HasTarget() bool
- func (c *Call) Ignore(reason string, a ...interface{})
- func (c *Call) ParseStop() float64
- func (c *Call) ParseTarget() float64
- type Calls
- type Channel
- type Endpoint
- type Exchange
- type ExchangeInfo
- type Frequency
- type Market
- type Markets
- type Notify
- type OnSuccess
- type Order
- type OrderSide
- type OrderType
- type Orders
- type Permission
- type Stats
- type Strategy
Constants ¶
View Source
const ( EUR = "EUR" USD = "USD" BTC = "BTC" ETH = "ETH" LTC = "LTC" XRP = "XRP" )
Variables ¶
View Source
var OrderSideString = map[OrderSide]string{ ORDER_SIDE_NONE: "", BUY: "buy", SELL: "sell", }
View Source
var OrderTypeString = map[OrderType]string{ ORDER_TYPE_NONE: "", LIMIT: "limit", MARKET: "market", }
Functions ¶
func FormatOrderSide ¶
func GetSizeMax ¶
GetSizeMax returns the maximum size we can SELL
func GetSizeMin ¶
GetSizeMin returns the minimum size we must BUY, source: https://pro.coinbase.com/markets
func IndexByMarket ¶
func ParseMarket ¶
func TweetMarket ¶
Types ¶
type Call ¶
type Call struct { *Buy Skip bool `json:"-"` Reason string `json:"-"` Stop string `json:"stop,omitempty"` Target string `json:"target,omitempty"` }
func (*Call) Deviate ¶
func (c *Call) Deviate(exchange Exchange, client interface{}, kind OrderType, mult float64) (OrderType, float64)
Multiply the buy target. Returns (new order type, deviated buy target). Does not modify the buy signal itself.
func (*Call) ParseTarget ¶
type Calls ¶
type Calls []Call
func (Calls) HasAnythingToDo ¶ added in v0.0.194
func (Calls) IndexByMarket ¶
func (Calls) IndexByMarketPrice ¶
func (Calls) IndexByPrice ¶
type Channel ¶
type Channel interface { Init() error GetName() string GetOrderType() OrderType GetRateLimit() time.Duration GetValidity() (time.Duration, error) GetMarkets(exchange Exchange, quote Assets, btcVolumeMin float64, valid time.Duration, sandbox, debug bool, ignore []string) (Markets, error) GetCalls(exchange Exchange, market string, sandbox, debug bool) (Calls, error) }
type Exchange ¶
type Exchange interface { GetInfo() *ExchangeInfo GetClient(permission Permission, sandbox bool) (interface{}, error) GetMarkets(cached, sandbox bool, ignore []string) ([]Market, error) FormatMarket(base, quote string) string Sell(stategy Strategy, hold, earn Markets, sandbox, tweet, debug bool, success OnSuccess) error Order(client interface{}, side OrderSide, market string, size float64, price float64, kind OrderType, metadata string) (oid []byte, raw []byte, err error) StopLoss(client interface{}, market string, size float64, price float64, kind OrderType, metadata string) ([]byte, error) OCO(client interface{}, market string, size float64, price, stop float64, metadata string) ([]byte, error) GetClosed(client interface{}, market string) (Orders, error) GetOpened(client interface{}, market string) (Orders, error) GetBook(client interface{}, market string, side BookSide) (interface{}, error) Aggregate(client, book interface{}, market string, agg float64) (Book, error) GetTicker(client interface{}, market string) (float64, error) Get24h(client interface{}, market string) (*Stats, error) GetPricePrec(client interface{}, market string) (int, error) GetSizePrec(client interface{}, market string) (int, error) GetMaxSize(client interface{}, base, quote string, hold, earn bool, def float64, mult multiplier.Mult) float64 Cancel(client interface{}, market string, side OrderSide) error Coalesce(client interface{}, market string, side OrderSide) error Buy(client interface{}, cancel bool, market string, calls Calls, deviation float64, kind OrderType) error IsLeveragedToken(name string) bool HasAlgoOrder(client interface{}, market string) (bool, error) }
type ExchangeInfo ¶
type ExchangeInfo struct { Code string `json:"code"` Name string `json:"name"` URL string `json:"url"` REST Endpoint `json:"rest"` WebSocket Endpoint `json:"websocket,omitempty"` Country string `json:"country,omitempty"` }
func (*ExchangeInfo) Equals ¶
func (info *ExchangeInfo) Equals(name string) bool
type Order ¶
type Order struct { Side OrderSide `json:"-"` Market string `json:"market"` Size float64 `json:"size"` Price float64 `json:"price"` CreatedAt time.Time `json:"createdAt"` }
func (*Order) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.