Documentation ¶
Index ¶
- func GetPru(transactions []Transaction) decimal.Decimal
- type ActionType
- type Balance
- type BalanceCache
- type Client
- func (c *Client) DeleteOrder(orderid string) error
- func (c *Client) GetAllHistoricalPositions() []HistoricalPosition
- func (c *Client) GetBalance() Balance
- func (c *Client) GetOpenedHistoricalPositionForProduct(productid string) (HistoricalPosition, bool)
- func (c *Client) GetOpenedPositionForProduct(productId string) (Position, bool)
- func (c *Client) GetPendingOrders(productId int) []Order
- func (c *Client) GetProduct(productId string) (Product, bool)
- func (c *Client) GetProducts(productIds []string) []Product
- func (c *Client) GetQuote(productvwid string) streaming.ProductQuote
- func (c *Client) GetTransactions(fromDate time.Time, toDate time.Time) ([]Transaction, error)
- func (c *Client) Login(username string, password string) error
- func (c *Client) NewStreamingClient(httpclient *http.Client, updatePeriod time.Duration) *streaming.Client
- func (c *Client) PlaceOrder(input PlaceOrderInput) (string, error)
- func (c *Client) ReceiveSuccessReloginOn401(s *sling.Sling, successV interface{}) (*http.Response, error)
- func (c *Client) SearchProduct(searchtext string) (*Product, bool, error)
- func (c *Client) SearchProducts(options SearchProductsOptions) ([]Product, error)
- func (c *Client) SubscribeQuotes(idlist []string) error
- func (c *Client) UnSubscribeQuotes(idlist []string) error
- type Configuration
- type Fee
- type HistoricalPosition
- func (p *HistoricalPosition) AddTransaction(transaction Transaction)
- func (p *HistoricalPosition) GetCurrentPerformance(quote streaming.ProductQuote) decimal.Decimal
- func (p *HistoricalPosition) GetCurrentPerformanceInPercent(quote streaming.ProductQuote) decimal.Decimal
- func (p *HistoricalPosition) GetFirstTransactionDate() time.Time
- func (p *HistoricalPosition) GetLastTransactionDate() time.Time
- func (p *HistoricalPosition) GetPastPerformance() decimal.Decimal
- func (p *HistoricalPosition) GetPastPerformanceInPercent() decimal.Decimal
- func (p *HistoricalPosition) GetPastPerformanceSince(since time.Time) decimal.Decimal
- func (p *HistoricalPosition) GetPru() decimal.Decimal
- func (p *HistoricalPosition) GetSize() int
- func (p *HistoricalPosition) GetTotalBuyAmount() decimal.Decimal
- func (p *HistoricalPosition) GetTransactionCount() int
- type LoginParams
- type LoginResponse
- type Order
- type OrderCache
- type OrderType
- type PlaceOrderInput
- type Position
- type PositionCache
- type Product
- type ProductCache
- type ProductCacheItem
- type ProductType
- type SearchProductsOptions
- type TimeType
- type Transaction
- type TransactionCache
- func (c *TransactionCache) GetAllHistoricalPositions() []HistoricalPosition
- func (c *TransactionCache) GetHistoricalPositionsForProduct(productid string) []HistoricalPosition
- func (c *TransactionCache) GetOpenedHistoricalPositionForProduct(productid string) (HistoricalPosition, bool)
- func (c *TransactionCache) Merge(transactions []Transaction)
- type UserConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPru ¶
func GetPru(transactions []Transaction) decimal.Decimal
Types ¶
type BalanceCache ¶
type BalanceCache struct {
// contains filtered or unexported fields
}
func (*BalanceCache) Get ¶
func (c *BalanceCache) Get() Balance
func (*BalanceCache) Set ¶
func (c *BalanceCache) Set(balance Balance)
type Client ¶
type Client struct { UpdatePeriod time.Duration StreamingUpdatePeriod time.Duration TryReloginOn401 bool HistoricalPositionUpdatePeriod time.Duration // contains filtered or unexported fields }
func (*Client) DeleteOrder ¶
func (*Client) GetAllHistoricalPositions ¶
func (c *Client) GetAllHistoricalPositions() []HistoricalPosition
func (*Client) GetBalance ¶
func (*Client) GetOpenedHistoricalPositionForProduct ¶
func (c *Client) GetOpenedHistoricalPositionForProduct(productid string) (HistoricalPosition, bool)
func (*Client) GetOpenedPositionForProduct ¶
func (*Client) GetPendingOrders ¶
func (*Client) GetProducts ¶
func (*Client) GetTransactions ¶
func (*Client) NewStreamingClient ¶
func (*Client) PlaceOrder ¶
func (c *Client) PlaceOrder(input PlaceOrderInput) (string, error)
func (*Client) ReceiveSuccessReloginOn401 ¶
func (*Client) SearchProduct ¶
func (*Client) SearchProducts ¶
func (c *Client) SearchProducts(options SearchProductsOptions) ([]Product, error)
func (*Client) SubscribeQuotes ¶
func (*Client) UnSubscribeQuotes ¶
type Configuration ¶
type Configuration struct { ClientId int `json:"clientId"` SessionId string `json:"sessionId"` TradingUrl string `json:"tradingUrl"` I18NUrl string `json:"i18nUrl"` PaymentServiceUrl string `json:"paymentServiceUrl"` ReportingUrl string `json:"reportingUrl"` PaUrl string `json:"paUrl"` VwdQuotecastServiceUrl string `json:"vwdQuotecastServiceUrl"` ProductSearchUrl string `json:"productSearchUrl"` DictionaryUrl string `json:"dictionaryUrl"` TaskManagerUrl string `json:"taskManagerUrl"` FirstLoginWizardUrl string `json:"firstLoginWizardUrl"` VwdGossipsUrl string `json:"vwdGossipsUrl"` CompaniesServiceUrl string `json:"companiesServiceUrl"` ProductTypesUrl string `json:"productTypesUrl"` VwdNewsUrl string `json:"vwdNewsUrl"` LoginUrl string `json:"loginUrl"` }
type HistoricalPosition ¶
type HistoricalPosition struct { ProductId int // contains filtered or unexported fields }
func (*HistoricalPosition) AddTransaction ¶
func (p *HistoricalPosition) AddTransaction(transaction Transaction)
func (*HistoricalPosition) GetCurrentPerformance ¶
func (p *HistoricalPosition) GetCurrentPerformance(quote streaming.ProductQuote) decimal.Decimal
func (*HistoricalPosition) GetCurrentPerformanceInPercent ¶
func (p *HistoricalPosition) GetCurrentPerformanceInPercent(quote streaming.ProductQuote) decimal.Decimal
func (*HistoricalPosition) GetFirstTransactionDate ¶
func (p *HistoricalPosition) GetFirstTransactionDate() time.Time
func (*HistoricalPosition) GetLastTransactionDate ¶
func (p *HistoricalPosition) GetLastTransactionDate() time.Time
func (*HistoricalPosition) GetPastPerformance ¶
func (p *HistoricalPosition) GetPastPerformance() decimal.Decimal
func (*HistoricalPosition) GetPastPerformanceInPercent ¶
func (p *HistoricalPosition) GetPastPerformanceInPercent() decimal.Decimal
func (*HistoricalPosition) GetPastPerformanceSince ¶
func (p *HistoricalPosition) GetPastPerformanceSince(since time.Time) decimal.Decimal
func (*HistoricalPosition) GetPru ¶
func (p *HistoricalPosition) GetPru() decimal.Decimal
func (*HistoricalPosition) GetSize ¶
func (p *HistoricalPosition) GetSize() int
func (*HistoricalPosition) GetTotalBuyAmount ¶
func (p *HistoricalPosition) GetTotalBuyAmount() decimal.Decimal
func (*HistoricalPosition) GetTransactionCount ¶
func (p *HistoricalPosition) GetTransactionCount() int
type LoginParams ¶
type LoginResponse ¶
type Order ¶
type Order struct { Id string Date time.Time ProductId int ProductName string ContractType int ContractSize decimal.Decimal Currency string BuySell ActionType Size int Quantity int Price decimal.Decimal StopPrice decimal.Decimal TotalOrderValue decimal.Decimal OrderType OrderType TimeType TimeType IsModifiable bool IsDeletable bool }
type OrderCache ¶
type OrderCache struct {
// contains filtered or unexported fields
}
func (*OrderCache) Add ¶
func (c *OrderCache) Add(orders []Order)
func (*OrderCache) Clear ¶
func (c *OrderCache) Clear()
func (*OrderCache) Get ¶
func (c *OrderCache) Get(productId int) []Order
func (*OrderCache) Remove ¶
func (c *OrderCache) Remove(orderIds []string)
func (*OrderCache) Update ¶
func (c *OrderCache) Update(orders []Order)
type PlaceOrderInput ¶
type PositionCache ¶
type PositionCache struct {
// contains filtered or unexported fields
}
func (*PositionCache) Add ¶
func (c *PositionCache) Add(positions []Position)
func (*PositionCache) Clear ¶
func (c *PositionCache) Clear()
func (*PositionCache) Get ¶
func (c *PositionCache) Get(productId string) []Position
func (*PositionCache) Remove ¶
func (c *PositionCache) Remove(positionsIds []string)
func (*PositionCache) Update ¶
func (c *PositionCache) Update(positions []Position)
type Product ¶
type Product struct { Id string `json:"id"` Name string `json:"name"` Isin string `json:"isin"` Symbol string `json:"symbol"` ContractSize decimal.Decimal `json:"contractSize"` ProductTypeName string `json:"productType"` ProductTypeId int `json:"productTypeId"` Tradable bool `json:"tradable"` Category string `json:"category"` Currency string `json:"currency"` StrikePrice decimal.Decimal `json:"strikePrice"` ExchangeId string `json:"exchangeId"` TimeTypes []string `json:"orderTimeTypes"` GtcAllowed bool `json:"gtcAllowed"` BuyOrderTypes []string `json:"buyOrderTypes"` SellOrderTypes []string `json:"sellOrderTypes"` MarketAllowed bool `json:"marketAllowed"` LimitHitOrderAllowed bool `json:"limitHitOrderAllowed"` StopLossAllowed bool `json:"stoplossAllowed"` StopLimitOrderAllowed bool `json:"stopLimitOrderAllowed"` JoinOrderAllowed bool `json:"joinOrderAllowed"` TrailingStopOrderAllowed bool `json:"trailingStopOrderAllowed"` CombinedOrderAllowed bool `json:"combinedOrderAllowed"` SellAmountAllowed bool `json:"sellAmountAllowed"` IsFund bool `json:"isFund"` ClosePrice decimal.Decimal `json:"closePrice"` ClosePriceDate productTime `json:"closePriceDate"` FeedQuality string `json:"feedQuality"` OrderBookDepth int `json:"orderBookDepth"` VwdIdentifierType string `json:"vwdIdentifierType"` VwdId string `json:"vwdId"` QualitySwitchable bool `json:"qualitySwitchable"` QualitySwitchFree bool `json:"qualitySwitchFree"` VwdModuleId int `json:"vwdModuleId"` ExpirationDate productTime `json:"expirationDate"` FinancingLevel decimal.Decimal `json:"financingLevel"` Leverage decimal.Decimal `json:"leverage"` Ratio decimal.Decimal `json:"ratio"` ShortLong string `json:"shortlong"` StopLoss decimal.Decimal `json:"stoploss"` }
type ProductCache ¶
type ProductCache struct { sync.RWMutex CacheInvalidationDuration time.Duration // contains filtered or unexported fields }
func (*ProductCache) GetProduct ¶
func (c *ProductCache) GetProduct(productId string) (Product, bool)
func (*ProductCache) GetProducts ¶
func (c *ProductCache) GetProducts(productids []string) []Product
type ProductCacheItem ¶
type ProductType ¶
type ProductType int
const ( Fund ProductType = 13 Leveraged ProductType = 14 Index ProductType = 180 Etf ProductType = 131 Stock ProductType = 1 Bond ProductType = 2 Cash ProductType = 311 Currency ProductType = 3 Future ProductType = 7 Cfd ProductType = 535 Warrant ProductType = 536 Option ProductType = 8 )
type SearchProductsOptions ¶
type SearchProductsOptions struct { SearchText string Limit int ProductType ProductType }
type Transaction ¶
type Transaction struct { BuySell string `json:"buysell"` Quantity int `json:"quantity"` OrderType OrderType `json:"orderTypeId"` CounterParty string `json:"counterParty"` TotalInBaseCurrency decimal.Decimal `json:"totalInBaseCurrency"` FeeInBaseCurrency decimal.Decimal `json:"feeInBaseCurrency"` TotalPlusFeeInBaseCurrency decimal.Decimal `json:"totalPlusFeeInBaseCurrency"` Transfered bool `json:"transfered"` ProductId int `json:"productId"` Price decimal.Decimal `json:"price"` Date time.Time `json:"date"` Total decimal.Decimal `json:"total"` Id int `json:"id"` }
type TransactionCache ¶
func (*TransactionCache) GetAllHistoricalPositions ¶
func (c *TransactionCache) GetAllHistoricalPositions() []HistoricalPosition
func (*TransactionCache) GetHistoricalPositionsForProduct ¶
func (c *TransactionCache) GetHistoricalPositionsForProduct(productid string) []HistoricalPosition
func (*TransactionCache) GetOpenedHistoricalPositionForProduct ¶
func (c *TransactionCache) GetOpenedHistoricalPositionForProduct(productid string) (HistoricalPosition, bool)
func (*TransactionCache) Merge ¶
func (c *TransactionCache) Merge(transactions []Transaction)
type UserConfiguration ¶
type UserConfiguration struct { ClientId int `json:"id"` AccountId int64 `json:"intAccount"` ClientRole string `json:"clientRole"` EffectiveClientRole string `json:"effectiveClientRole"` ContractType string `json:"contractType"` Username string `json:"username"` DisplayName string `json:"displayName"` Email string `json:"email"` CellphoneNumber string `json:"cellphoneNumber"` Locale string `json:"locale"` Language string `json:"language"` Culture string `json:"culture"` MemberCode string `json:"memberCode"` CanUpgrade bool `json:"canUpgrade"` IsAllocationAvailable bool `json:"isAllocationAvailable"` IsCollectivePortfolio bool `json:"isCollectivePortfolio"` IsAmClientActive bool `json:"isAmClientActive"` IsIskClient bool `json:"isIskClient"` IsWithdrawalAvailable bool `json:"isWithdrawalAvailable"` FirstContact struct { FirstName string `json:"firstName"` LastName string `json:"lastName"` DisplayName string `json:"displayName"` Nationality string `json:"nationality"` Gender string `json:"gender"` DateOfBirth string `json:"dateOfBirth"` PlaceOfBirth string `json:"placeOfBirth"` CountryOfBirth string `json:"countryOfBirth"` Birthday string `json:"birthday"` } `json:"firstContact"` Address struct { StreetAddress string `json:"streetAddress"` StreetAddressNumber string `json:"streetAddressNumber"` Zip string `json:"zip"` City string `json:"city"` Country string `json:"country"` } `json:"address"` BankAccount struct { Iban string `json:"iban"` Bic string `json:"bic"` Name string `json:"name"` BankAccountId int `json:"bankAccountId"` } `json:"bankAccount"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.