internal

package
v0.0.0-...-a5c581d Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBollingerStochStrategy

func CreateBollingerStochStrategy(series *techan.TimeSeries) (long, short techan.RuleStrategy)

func CreateEMAStochATRStrategy

func CreateEMAStochATRStrategy(series *techan.TimeSeries) (long, short techan.RuleStrategy, atr techan.Indicator)

func CreateEMAStrategy

func CreateEMAStrategy(series *techan.TimeSeries) (long, short techan.RuleStrategy)

func CreateIchimokuStrategy

func CreateIchimokuStrategy(series *techan.TimeSeries) (long, short techan.RuleStrategy)

func CreateMACDStrategy

func CreateMACDStrategy(series *techan.TimeSeries) (long, short techan.RuleStrategy)

func NewBaseLineIndicator

func NewBaseLineIndicator(series *techan.TimeSeries, window int) techan.Indicator

func NewConversionLineIndicator

func NewConversionLineIndicator(series *techan.TimeSeries, window int) techan.Indicator

func NewDispositionIndicator

func NewDispositionIndicator(indicator techan.Indicator, disposition int) techan.Indicator

func NewFastStochasticIndicator

func NewFastStochasticIndicator(closePrice techan.Indicator, series *techan.TimeSeries, timeframe int) techan.Indicator

func NewLaggingSpanIndicator

func NewLaggingSpanIndicator(series *techan.TimeSeries) techan.Indicator

func NewLeadingSpanAIndicator

func NewLeadingSpanAIndicator(c conversionLineIndicator, b baseLineIndicator) techan.Indicator

func NewLeadingSpanBIndicator

func NewLeadingSpanBIndicator(series *techan.TimeSeries, window int) techan.Indicator

func NewMinimumIndicator

func NewMinimumIndicator(ind1, ind2 techan.Indicator) techan.Indicator

Types

type AverageLossAnalysis

type AverageLossAnalysis struct{}

func (AverageLossAnalysis) Analyze

func (a AverageLossAnalysis) Analyze(record *techan.TradingRecord) float64

type AverageWinAnalysis

type AverageWinAnalysis struct{}

func (AverageWinAnalysis) Analyze

func (a AverageWinAnalysis) Analyze(record *techan.TradingRecord) float64

type CommissionAnalysis

type CommissionAnalysis struct {
	Commission float64
}

func (CommissionAnalysis) Analyze

func (ca CommissionAnalysis) Analyze(record *techan.TradingRecord) float64

Analyze analyzes the trading record for the total commission cost.

type DynamicStrategyFunc

type DynamicStrategyFunc func(*techan.TimeSeries) (long, short techan.RuleStrategy)

type FalseRule

type FalseRule struct{}

func (FalseRule) IsSatisfied

func (r FalseRule) IsSatisfied(_ int, _ *techan.TradingRecord) bool

type LogTradesAnalysis

type LogTradesAnalysis struct {
	io.Writer
}

LogTradesAnalysis is a wrapper around an io.Writer, which logs every trade executed to that writer

func (LogTradesAnalysis) Analyze

func (lta LogTradesAnalysis) Analyze(record *techan.TradingRecord) float64

Analyze logs trades to provided io.Writer

type LoseStreakAnalysis

type LoseStreakAnalysis struct{}

func (LoseStreakAnalysis) Analyze

func (l LoseStreakAnalysis) Analyze(record *techan.TradingRecord) float64

type MaxLossAnalysis

type MaxLossAnalysis struct{}

func (MaxLossAnalysis) Analyze

func (m MaxLossAnalysis) Analyze(record *techan.TradingRecord) float64

type MaxWinAnalysis

type MaxWinAnalysis struct{}

func (MaxWinAnalysis) Analyze

func (m MaxWinAnalysis) Analyze(record *techan.TradingRecord) float64

type OpenPLAnalysis

type OpenPLAnalysis struct {
	LastCandle *techan.Candle
	Commission float64
}

func (OpenPLAnalysis) Analyze

func (o OpenPLAnalysis) Analyze(record *techan.TradingRecord) float64

type ProfitableTradesAnalysis

type ProfitableTradesAnalysis struct {
	Commission float64
}

ProfitableTradesAnalysis analyzes the trading record for the number of profitable trades

func (ProfitableTradesAnalysis) Analyze

Analyze returns the number of profitable trades in a trading record

type Report

type Report struct {
	TotalProfit          float64 `json:"totalProfit"`
	CommissionValue      float64 `json:"commissionValue"`
	OpenProfit           float64 `json:"openProfit"`
	TradeCount           float64 `json:"tradeCount"`
	ProfitableTradeCount float64 `json:"profitableTradeCount"`
}

type StochasticRSI

type StochasticRSI struct {
	StochK techan.Indicator
	StochD techan.Indicator
}

func NewStochasticRSI

func NewStochasticRSI(series *techan.TimeSeries, window int) StochasticRSI

type TotalProfitAnalysis

type TotalProfitAnalysis struct {
	Commission float64
}

TotalProfitAnalysis analyzes the trading record for total profit.

func (TotalProfitAnalysis) Analyze

func (tps TotalProfitAnalysis) Analyze(record *techan.TradingRecord) float64

Analyze analyzes the trading record for total profit.

type Watchdog

type Watchdog struct {
	Symbol     string
	Interval   string
	Risk       float64
	Commission float64
	Leverage   int
	Demo       bool
	SymbolInfo binance.Symbol

	StopC       chan struct{}
	InterruptCh chan os.Signal
	// contains filtered or unexported fields
}

func (Watchdog) MarshalJSON

func (w Watchdog) MarshalJSON() ([]byte, error)

func (*Watchdog) Report

func (w *Watchdog) Report() Report

func (*Watchdog) Watch

func (w *Watchdog) Watch(client *binance.Client) (binance.WsKlineHandler, binance.ErrHandler, error)

type WinStreakAnalysis

type WinStreakAnalysis struct{}

func (WinStreakAnalysis) Analyze

func (w WinStreakAnalysis) Analyze(record *techan.TradingRecord) float64

Jump to

Keyboard shortcuts

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