broker

package module
v0.2.13-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: MIT Imports: 6 Imported by: 0

README

gobist-broker - GO library which contains some useful tools for supported stock brokers

  • Transaction file import. It's useful if you have several accounts and want to collect all transactions in one place.
  • Give stock order
Supported Brokers
  • Garanti BBVA Yatırım
  • NCM Investment

Installation

$ go get github.com/guneyin/gobist-importer

Usage and Example

Create Importer
imp, err := importer.New(broker.Garanti, "garanti.csv")
if err != nil {
    log.Fatal(err)
}
Example
func main() {
    imp, err := importer.New(broker.Garanti, "garanti.csv")
    if err != nil {
        log.Fatal(err)
    }

    ts, err := imp.Import()
    if err != nil {
        log.Fatal(err)
    }

    for _, item := range ts.Items {
        fmt.Printf("%-10s %-35s %-5d %-10.2f %-15s\n", item.Symbol, item.Date, item.Quantity, item.Price, item.Type.String())
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker interface {
	Info() entity.BrokerInfo
	Parse(content []byte) (*entity.Transactions, error)
}

func GetBroker

func GetBroker(b entity.EnumBroker) Broker

func GetBrokerByName

func GetBrokerByName(name string) (Broker, error)

type Brokers

type Brokers map[entity.EnumBroker]Broker

func GetBrokers

func GetBrokers() Brokers

func (*Brokers) ToJSON

func (b *Brokers) ToJSON() string

Directories

Path Synopsis
brokers
ncm
lib

Jump to

Keyboard shortcuts

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