signals

package
v0.0.202 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RISK_LEVEL_MINIMUM = 1 // pretty rare
	RISK_LEVEL_LOW     = 2
	RISK_LEVEL_MEDIUM  = 3 // pretty common
	RISK_LEVEL_HIGH    = 4 // for really risky trades
	RISK_LEVEL_MAXIMUM = 5
)

Possible values for risk_level are:

Variables

View Source
var CryptoBaseScannerAlgoString = map[CryptoBaseScannerAlgo]string{
	CBS_ALGO_ORIGINAL:     "original",
	CBS_ALGO_DAY_TRADE:    "day_trade",
	CBS_ALGO_CONSERVATIVE: "conservative",
	CBS_ALGO_POSITION:     "position",
}

Functions

func NewCryptoBaseScanner

func NewCryptoBaseScanner() model.Channel

func NewListings

func NewListings() model.Channel

func NewMiningHamster

func NewMiningHamster() model.Channel

func NewQualitySignals

func NewQualitySignals() model.Channel

func NewVolume

func NewVolume() model.Channel

Types

type CryptoBase

type CryptoBase struct {
	ExchangeName  string  `json:"exchangeName"`
	BaseCurrency  string  `json:"baseCurrency"`
	QuoteCurrency string  `json:"quoteCurrency"`
	BtcVolume     float64 `json:"btcVolume,string"`
	CurrentPrice  float64 `json:"currentPrice"`
	LatestBase    struct {
		CurrentDrop float64     `json:"currentDrop,string"`
		CrackedAt   interface{} `json:"crackedAt"`
	} `json:"latestBase"`
	MarketStats MarketStats `json:"marketStats"`
}

func (*CryptoBase) Buy

func (self *CryptoBase) Buy(exchange model.Exchange, algorithm CryptoBaseScannerAlgo, btcVolumeMin, dip, successRatio float64, sandbox, debug bool) (bool, error)

func (*CryptoBase) GetCrackedAt

func (self *CryptoBase) GetCrackedAt() (*time.Time, error)

func (*CryptoBase) Market

func (self *CryptoBase) Market(exchange model.Exchange) string

type CryptoBaseScanner

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

func (*CryptoBaseScanner) GetCalls

func (self *CryptoBaseScanner) GetCalls(exchange model.Exchange, market string, sandbox, debug bool) (model.Calls, error)

func (*CryptoBaseScanner) GetMarkets

func (self *CryptoBaseScanner) GetMarkets(
	exchange model.Exchange,
	quote model.Assets,
	btcVolumeMin float64,
	valid time.Duration,
	sandbox, debug bool,
	ignore []string,
) (model.Markets, error)

func (*CryptoBaseScanner) GetName

func (self *CryptoBaseScanner) GetName() string

func (*CryptoBaseScanner) GetOrderType

func (self *CryptoBaseScanner) GetOrderType() model.OrderType

func (*CryptoBaseScanner) GetRateLimit

func (self *CryptoBaseScanner) GetRateLimit() time.Duration

func (*CryptoBaseScanner) GetValidity

func (self *CryptoBaseScanner) GetValidity() (time.Duration, error)

func (*CryptoBaseScanner) Init

func (self *CryptoBaseScanner) Init() error

type CryptoBaseScannerAlgo

type CryptoBaseScannerAlgo int
const (
	CBS_ALGO_ORIGINAL CryptoBaseScannerAlgo = iota
	CBS_ALGO_DAY_TRADE
	CBS_ALGO_CONSERVATIVE
	CBS_ALGO_POSITION
)

func NewCryptoBaseScannerAlgo

func NewCryptoBaseScannerAlgo(data string) (CryptoBaseScannerAlgo, error)

func (*CryptoBaseScannerAlgo) String

func (algo *CryptoBaseScannerAlgo) String() string

type CryptoBaseScannerResponse

type CryptoBaseScannerResponse struct {
	Bases CryptoBases `json:"bases"`
}

type CryptoBases

type CryptoBases []CryptoBase

func (CryptoBases) IndexByMarket

func (bases CryptoBases) IndexByMarket(base *CryptoBase) int

type CryptoQualitySignals

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

func (*CryptoQualitySignals) GetCalls

func (self *CryptoQualitySignals) GetCalls(exchange model.Exchange, market string, sandbox, debug bool) (model.Calls, error)

func (*CryptoQualitySignals) GetMarkets

func (self *CryptoQualitySignals) GetMarkets(
	exchange model.Exchange,
	quote model.Assets,
	btcVolumeMin float64,
	valid time.Duration,
	sandbox, debug bool,
	ignore []string,
) (model.Markets, error)

func (*CryptoQualitySignals) GetName

func (self *CryptoQualitySignals) GetName() string

func (*CryptoQualitySignals) GetOrderType

func (self *CryptoQualitySignals) GetOrderType() model.OrderType

func (*CryptoQualitySignals) GetRateLimit

func (self *CryptoQualitySignals) GetRateLimit() time.Duration

func (*CryptoQualitySignals) GetValidity

func (self *CryptoQualitySignals) GetValidity() (time.Duration, error)

func (*CryptoQualitySignals) Init

func (self *CryptoQualitySignals) Init() error

type Listing

type Listing struct {
	Market  string
	Price   float64
	Created time.Time
}

type Listings

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

func (*Listings) GetCalls

func (self *Listings) GetCalls(exchange model.Exchange, market string, sandbox, debug bool) (model.Calls, error)

func (*Listings) GetMarkets

func (self *Listings) GetMarkets(
	exchange model.Exchange,
	quote model.Assets,
	btcVolumeMin float64,
	valid time.Duration,
	sandbox, debug bool,
	ignore []string,
) (model.Markets, error)

func (*Listings) GetName

func (self *Listings) GetName() string

func (*Listings) GetOrderType

func (self *Listings) GetOrderType() model.OrderType

func (*Listings) GetRateLimit

func (self *Listings) GetRateLimit() time.Duration

func (*Listings) GetValidity

func (self *Listings) GetValidity() (time.Duration, error)

func (*Listings) Init

func (self *Listings) Init() error

type MarketStat

type MarketStat struct {
	Algorithm  string  `json:"algorithm"`
	Ratio      float64 `json:"ratio,string"`
	MedianDrop float64 `json:"medianDrop,string"`
}

type MarketStats

type MarketStats []MarketStat

type MiningHamster

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

func (*MiningHamster) GetCalls

func (self *MiningHamster) GetCalls(exchange model.Exchange, market string, sandbox, debug bool) (model.Calls, error)

func (*MiningHamster) GetMarkets

func (self *MiningHamster) GetMarkets(
	exchange model.Exchange,
	quote model.Assets,
	btcVolumeMin float64,
	valid time.Duration,
	sandbox, debug bool,
	ignore []string,
) (model.Markets, error)

func (*MiningHamster) GetName

func (self *MiningHamster) GetName() string

func (*MiningHamster) GetOrderType

func (self *MiningHamster) GetOrderType() model.OrderType

func (*MiningHamster) GetRateLimit

func (self *MiningHamster) GetRateLimit() time.Duration

func (*MiningHamster) GetValidity

func (self *MiningHamster) GetValidity() (time.Duration, error)

func (*MiningHamster) Init

func (self *MiningHamster) Init() error

type QualityResponse

type QualityResponse struct {
	Error   int            `json:"error"`
	Message string         `json:"message"`
	Count   int            `json:"count"`
	Signals QualitySignals `json:"signals"`
}

type QualitySignal

type QualitySignal struct {
	TimeStamp string  `json:"timestamp"`
	Exchange  string  `json:"exchange"`
	Quote     string  `json:"currency"`
	Base      string  `json:"coin"`
	BuyStart  float64 `json:"buy_start,string"`
	BuyEnd    float64 `json:"buy_end,string"`
	Target1   string  `json:"target1"`
	StopLoss  string  `json:"stop_loss"`
	Ask       float64 `json:"ask,string"`
	RiskLevel int64   `json:"risk_level,string"`
	Skip      bool
}

func (*QualitySignal) Buy

func (self *QualitySignal) Buy(exchange model.Exchange, risk_level int64, debug bool) bool

func (*QualitySignal) GetTimeStamp

func (self *QualitySignal) GetTimeStamp() (*time.Time, error)

func (*QualitySignal) Market

func (self *QualitySignal) Market(exchange model.Exchange) string

func (*QualitySignal) Price

func (self *QualitySignal) Price() float64

type QualitySignals

type QualitySignals []QualitySignal

func (QualitySignals) IndexByMarket

func (signals QualitySignals) IndexByMarket(signal *QualitySignal) int

type Signals

type Signals []model.Channel

func New

func New() *Signals

func (*Signals) FindByName

func (signals *Signals) FindByName(name string) (model.Channel, error)

type Volume

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

func (*Volume) GetCalls

func (self *Volume) GetCalls(exchange model.Exchange, market string, sandbox, debug bool) (model.Calls, error)

func (*Volume) GetMarkets

func (self *Volume) GetMarkets(
	exchange model.Exchange,
	quote model.Assets,
	btcVolumeMin float64,
	valid time.Duration,
	sandbox, debug bool,
	ignore []string,
) (model.Markets, error)

func (*Volume) GetName

func (self *Volume) GetName() string

func (*Volume) GetOrderType

func (self *Volume) GetOrderType() model.OrderType

func (*Volume) GetRateLimit

func (self *Volume) GetRateLimit() time.Duration

func (*Volume) GetValidity

func (self *Volume) GetValidity() (time.Duration, error)

func (*Volume) Init

func (self *Volume) Init() error

Jump to

Keyboard shortcuts

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