decisionmaker

package
v0.0.0-...-bc78c8b Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuyStrategy

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

func NewBuyStrategy

func NewBuyStrategy(
	priceStats *indicators.PriceIndicator,
	volumeStats *indicators.VolumeIndicator,
	accountService domain.AccountService,
	options domain.DecisionMakerOptions,
) *BuyStrategy

func (*BuyStrategy) Execute

func (s *BuyStrategy) Execute() (bool, float32, error)

type DecisionMaker

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

DecisionMaker decides to buy or sell

func NewDecisionMaker

func NewDecisionMaker(
	buyStrategy domain.Strategy,
	sellStrategy domain.Strategy,
) *DecisionMaker

NewDecisionMaker returns a new instance of DecisionMaker

func (*DecisionMaker) ShouldBuy

func (dm *DecisionMaker) ShouldBuy() (bool, float32, error)

ShouldBuy returns true or false if it is a good time to buy

func (*DecisionMaker) ShouldSell

func (dm *DecisionMaker) ShouldSell() (bool, float32, error)

ShouldSell returns true or false if it is a good time to sell

type SellStrategy

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

func NewSellStrategy

func NewSellStrategy(
	priceStats *indicators.PriceIndicator,
	volumeStats *indicators.VolumeIndicator,
	accountService domain.AccountService,
	options domain.DecisionMakerOptions,
) *SellStrategy

func (*SellStrategy) Execute

func (s *SellStrategy) Execute() (bool, float32, error)

Jump to

Keyboard shortcuts

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