analysis

package
v0.0.0-...-2bccc3c Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyses

type Analyses []*Analysis

func (Analyses) Sort

func (analyses Analyses) Sort(sortBy Sort) Analyses

type Analysis

type Analysis struct {
	Item *item.Item

	Days                int
	AveragePrice        float64
	AverageVolume       int64
	AverageSpread       float64
	AverageHigh         float64
	AverageLow          float64
	AverageProfitMargin float64
	AverageOffset       float64
	ISKVol              float64

	// Hypothetical profit if you were to execute every order of the day
	LPDP float64
	// Orders that have been updated in the last 24h
	Flippers int
	// Aggregation of factors based on weights
	Score int
}

type Analyzer

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

func NewAnalyzer

func NewAnalyzer(days int, buyBrokerFee, sellBrokerFee, salesTax float64, filters *config.Filters, logger hclog.Logger) *Analyzer

func (*Analyzer) IsOutlier

func (a *Analyzer) IsOutlier(analysis *Analysis) bool

func (*Analyzer) PassesFilters

func (a *Analyzer) PassesFilters(analysis *Analysis) bool

func (*Analyzer) Print

func (a *Analyzer) Print(sort Sort)

func (*Analyzer) Run

func (a *Analyzer) Run(items item.Items)

func (*Analyzer) SummarizeHistory

func (a *Analyzer) SummarizeHistory(item *item.Item) *Analysis

type Sort

type Sort int
var (
	ByMargin   Sort = 0
	ByLPDP     Sort = 1
	ByVolume   Sort = 2
	ByFlippers Sort = 3
	ByScore    Sort = 4
)

func SortFromString

func SortFromString(sort string) Sort

type Weights

type Weights struct {
	LPDP     float64
	Flippers float64
	Margin   float64
	Offset   float64
}

How important each factor is in the final score, 0-10

Jump to

Keyboard shortcuts

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