pvts

package
v0.0.0-...-9f17ba5 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocation

type Allocation struct {
	Date    string
	Members map[string]float64
}

type PVPosition

type PVPosition struct {
	CompositeFIGI string
	Ticker        string
	Shares        float64
}

type PVRebalance

type PVRebalance struct {
	Allocation    *Allocation
	NextTradeDate string
	Transactions  []*Transaction
}

type PVSecurity

type PVSecurity struct {
	CompositeFIGI string `json:"compositeFigi"`
	Ticker        string `json:"ticker"`
}
type TradeLink struct {
	PortfolioID   string
	AccountID     string
	LastTradeDate time.Time
	NextTradeDate time.Time
}

func (*TradeLink) GetStrategy

func (tl *TradeLink) GetStrategy(positions []*PVPosition, balance *tradestation.Balance) (*PVRebalance, error)

GetStrategy communicates with pv-api and gets the list of transactions that TradeStation should execute

func (*TradeLink) Sync

func (tl *TradeLink) Sync(autoConfirm bool) error

Sync gets a list of transactions from penny-vault and executes them in Trade Station

type Transaction

type Transaction struct {
	ID             string
	Cleared        bool
	Commission     float64
	CompositeFIGI  string
	Date           string
	GainLoss       float64
	Kind           string
	Memo           string
	Predicted      bool
	PricePerShare  float64
	Shares         float64
	SourceID       string
	TaxDisposition string
	Ticker         string
	TotalValue     float64
}

Jump to

Keyboard shortcuts

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