degiro

package
v0.0.0-...-23091b8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderActionBuy     OrderAction = "BUY"
	OrderActionSell    OrderAction = "SELL"
	OrderTypeLimit     OrderType   = 0
	OrderTypeStopLimit OrderType   = 1
	OrderTypeMarket    OrderType   = 2
	OrderTypeStoploss  OrderType   = 3
	OrderTimeDay       OrderTime   = 1
	OrderTimeGTC       OrderTime   = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	Username string
	Password string
	URL      string
	// contains filtered or unexported fields
}

func NewAPIClient

func NewAPIClient(username, password string) *APIClient

func NewAPIClientWithURL

func NewAPIClientWithURL(username, password, url string) *APIClient

func (*APIClient) CheckOrder

func (c *APIClient) CheckOrder(intAccount int, update Order) (*CheckOrderInfo, error)

func (*APIClient) CreateOrder

func (c *APIClient) CreateOrder(order string, intAccount int, update Order) (*CreateOrderInfo, error)

func (*APIClient) DeleteOrder

func (c *APIClient) DeleteOrder(order string, intAccount int) error

func (*APIClient) GetAccountInfo

func (c *APIClient) GetAccountInfo(intAccount int) (*AccountInfo, error)

func (*APIClient) GetClientInfo

func (c *APIClient) GetClientInfo() (*ClientInfo, error)

func (*APIClient) GetConfig

func (c *APIClient) GetConfig() error

func (*APIClient) Login

func (c *APIClient) Login() error

func (*APIClient) UpdateOrder

func (c *APIClient) UpdateOrder(order string, intAccount int, update Order) error

type AccountInfo

type AccountInfo struct {
	ClientID            int                     `json:"clientId"`
	BaseCurrency        string                  `json:"baseCurrency"`
	CurrencyPairs       map[string]CurrencyPair `json:"currencyPairs"`
	Margintype          string                  `json:"marginType"`
	CashFunds           map[string][]CashFund   `json:"cashFunds"`
	CompensationCapping float64                 `json:"compensationCapping"`
}

type AccountInfoResponse

type AccountInfoResponse struct {
	Data AccountInfo `json:"data"`
}

type CashFund

type CashFund struct {
	Id         int    `json:"id"`
	Name       string `json:"name"`
	ProductIds []int  `json:"productIds"`
}

type CheckOrderInfo

type CheckOrderInfo struct {
	ConfirmationID  string           `json:"confirmationId"`
	TransactionFees []TransactionFee `json:"transactionFees"`
}

type CheckOrderResponse

type CheckOrderResponse struct {
	Data CheckOrderInfo `json:"data"`
}

type ClientInfo

type ClientInfo struct {
	IntAccount int `json:"intAccount"`
}

type ClientInfoResponse

type ClientInfoResponse struct {
	Data ClientInfo `json:"data"`
}

type Config

type Config struct {
	ClientID       int    `json:"clientId"`
	SessionID      string `json:"sessionId"`
	TradingURL     string `json:"tradingUrl"`
	PaURL          string `json:"paUrl"`
	TaskManagerURL string `json:"taskManagerUrl"`
}

type CreateOrderInfo

type CreateOrderInfo struct {
	OrderID string `json:"orderId"`
}

type CreateOrderResponse

type CreateOrderResponse struct {
	Data CreateOrderInfo `json:"data"`
}

type CurrencyPair

type CurrencyPair struct {
	Id    int    `json:"id"`
	Price string `json:"price"`
}

type Order

type Order struct {
	BuySell   OrderAction `json:"buySell"`
	OrderType OrderType   `json:"orderType"`
	ProductID string      `json:"productId"`
	TimeType  OrderTime   `json:"timeType"`
	Size      int         `json:"size"`
	Price     int         `json:"price"`
	StopPrice int         `json:"stopPrice,omitempty"`
}

type OrderAction

type OrderAction string

type OrderTime

type OrderTime int

type OrderType

type OrderType int

type TransactionFee

type TransactionFee struct {
	Id       int     `json:"id"`
	Amount   float64 `json:"amount"`
	Currency string  `json:"currency"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL