Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BollingerBands ¶
type BollingerBands struct {
Period int
History []model.DataPoint
Values BollingerBandsValues
}
BollingerBands represents the state of the Bollinger Bands indicator.
func NewBollingerBands ¶
func NewBollingerBands(period int) *BollingerBands
NewBollingerBands initializes a new Bollinger Bands instance.
func (*BollingerBands) AddDataPoint ¶
AddDataPoint adds a new data point and updates the Bollinger Bands calculation.
func (*BollingerBands) GetBollingerBands ¶
func (bb *BollingerBands) GetBollingerBands() BollingerBandsValues
GetBollingerBands returns the current Bollinger Bands levels.
type BollingerBandsValues ¶
BollingerBandsValues represents the calculated values of Bollinger Bands.
type EMA ¶
type EMA struct {
Period int
Multiplier float64
Value float64
Initialized bool
// contains filtered or unexported fields
}
EMA represents the state of the EMA indicator for a single period.
type Fibonacci ¶
type Fibonacci struct {
History []model.DataPoint
High float64
Low float64
Levels map[FibonacciLevel]float64
Size int
IsInitialized bool
}
Fibonacci represents the state of the Fibonacci indicator.
func NewFibonacci ¶
NewFibonacci initializes a new Fibonacci instance with a given history size.
func (*Fibonacci) AddDataPoint ¶
AddDataPoint adds a new data point and updates the Fibonacci calculation.
func (*Fibonacci) GetFibonacciLevels ¶
func (f *Fibonacci) GetFibonacciLevels() map[FibonacciLevel]float64
GetFibonacciLevels returns the current Fibonacci retracement levels.
type FibonacciLevel ¶
type FibonacciLevel int
const ( Zero FibonacciLevel = iota TwentyThree ThirtyEight Fifty SixtyOne SeventySix Hundred )
type MACD ¶
type MACD struct {
ShortEMA float64
LongEMA float64
SignalLine float64
History []model.DataPoint
ShortPeriod int
LongPeriod int
SignalPeriod int
Initialized bool
}
MACD represents the state of the MACD indicator.
func (*MACD) AddDataPoint ¶
AddDataPoint adds a new data point and updates the MACD calculation.
func (*MACD) CalculateMACD ¶
func (m *MACD) CalculateMACD() MACDResult
CalculateMACD returns the MACD line and the MACD histogram as an object.
type MACDResult ¶
MACDResult holds the results of the MACD calculation.
type PivotLevels ¶
type PivotLevels struct {
Pivot float64
Support1 float64
Support2 float64
Support3 float64
Resistance1 float64
Resistance2 float64
Resistance3 float64
}
PivotLevels represents the pivot point and its support/resistance levels.
type PivotPoint ¶
type PivotPoint struct {
PreviousData model.DataPoint
Initialized bool
Levels PivotLevels
}
PivotPoint represents the state of the Pivot Point indicator.
func NewPivotPoint ¶
func NewPivotPoint() *PivotPoint
NewPivotPoint initializes a new Pivot Point instance.
func (*PivotPoint) AddDataPoint ¶
AddDataPoint adds a new data point and updates the Pivot Point calculation.
func (*PivotPoint) GetPivotLevels ¶
func (pp *PivotPoint) GetPivotLevels() PivotLevels
GetPivotLevels returns the current Pivot Point levels.
type RSI ¶
type RSI struct {
Period int
AvgGain float64
AvgLoss float64
History *utils.CyclicSlice[model.DataPoint]
Initialized bool
}
RSI represents the state of the RSI indicator.
func (*RSI) AddDataPoint ¶
AddDataPoint adds a new data point and updates the RSI calculation.
func (*RSI) CalculateRSI ¶
CalculateRSI returns the current RSI value.
type SuperTrend ¶
type SuperTrend struct {
Period int
Multiplier float64
ATR float64
SuperTrendLine float64
History []model.DataPoint
IsUpTrend bool
Initialized bool
}
SuperTrend represents the state of the Super Trend indicator.
func NewSuperTrend ¶
func NewSuperTrend(period int, multiplier float64) *SuperTrend
NewSuperTrend initializes a new Super Trend instance.
func (*SuperTrend) AddDataPoint ¶
AddDataPoint adds a new data point and updates the Super Trend calculation.
func (*SuperTrend) CalculateSuperTrend ¶
func (st *SuperTrend) CalculateSuperTrend() (float64, bool)
CalculateSuperTrend returns the current Super Trend value and the trend direction.