client

package
v0.0.0-...-b2907cb Latest Latest
Warning

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

Go to latest
Published: May 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is managing connection with XTB server.

func NewClient

func NewClient(u *url.URL, verbose bool) (*Client, error)

NewClient is starting connection with given server.

func (*Client) Close

func (c *Client) Close() error

Close is closing connection with server.

func (*Client) GetAllSymbols

func (c *Client) GetAllSymbols() (*commands.GetAllSymbolsResult, error)

GetAllSymbols performs getAllSymbols command described here: http://developers.xstore.pro/documentation/#getAllSymbols

func (*Client) GetChartLastRange

func (c *Client) GetChartLastRange(period commands.Period, start time.Time, symbol string) (*commands.GetChartResult, error)

GetChartLastRange performs getChartLastRange command described here: http://developers.xstore.pro/documentation/#getChartLastRequest

func (*Client) GetChartRangeRequest

func (c *Client) GetChartRangeRequest(period commands.Period, start time.Time, symbol string, end time.Time, ticks int) (*commands.GetChartResult, error)

GetChartRangeRequest performs getChartRangeRequest command described here: http://developers.xstore.pro/documentation/#getChartRangeRequest

func (*Client) GetProfitCalculationRequest

func (c *Client) GetProfitCalculationRequest(closePrice float32, cmd uint8, openPrice float32, symbol string, volume float32) (*commands.GetProfitCalculationResult, error)

GetProfitCalculationRequest performs getProfitCalculation command described here: http://developers.xstore.pro/documentation/#getProfitCalculation

func (*Client) GetServerTimeRequest

func (c *Client) GetServerTimeRequest() (*commands.GetServerTimeResult, error)

GetServerTimeRequest performs getServerTime command described here: http://developers.xstore.pro/documentation/#getServerTime

func (*Client) GetTradesRequest

func (c *Client) GetTradesRequest(openedOnly bool) (*commands.GetTradesResult, error)

GetTradesRequest performs getTrades command described here: http://developers.xstore.pro/documentation/#getTrades

func (*Client) GetVersionRequest

func (c *Client) GetVersionRequest() (*commands.GetVersionResult, error)

GetVersionRequest performs getVersion command described here: http://developers.xstore.pro/documentation/#getVersion

func (*Client) Login

func (c *Client) Login(user, password string) (*commands.LoginResult, error)

Login performs login command described here: http://developers.xstore.pro/documentation/#login

func (*Client) Logout

func (c *Client) Logout() (*commands.Result, error)

Login performs loout command described here: http://developers.xstore.pro/documentation/#logout

func (*Client) TradeTransactionRequest

func (c *Client) TradeTransactionRequest(cmd uint8, customComment string, expiration int64, offset int, order uint, price float32, sl float32, symbol string, tp float32, transactionType uint8, volume float32) (*commands.TradeTransactionResult, error)

TradeTransactionRequest performs tradeTransaction command described here: http://developers.xstore.pro/documentation/#tradeTransaction

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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