Documentation
¶
Overview ¶
Package volatility contains the volatility strategy functions.
This package belongs to the Indicator project. Indicator is a Golang module that supplies a variety of technical indicators, strategies, and a backtesting framework for analysis.
License ¶
Copyright (c) 2021-2024 Onur Cinar. The source code is provided under GNU AGPLv3 License. https://github.com/cinar/indicator
Disclaimer ¶
The information provided on this project is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllStrategies ¶
AllStrategies returns a slice containing references to all available volatility strategies.
Types ¶
type BollingerBandsStrategy ¶
type BollingerBandsStrategy struct { // BollingerBands represents the configuration parameters for calculating the Bollinger Bands. BollingerBands *volatility.BollingerBands[float64] }
BollingerBandsStrategy represents the configuration parameters for calculating the Bollinger Bands strategy. A closing value crossing above the upper band suggets a Buy signal, while crossing below the lower band indivates a Sell signal.
func NewBollingerBandsStrategy ¶
func NewBollingerBandsStrategy() *BollingerBandsStrategy
NewBollingerBandsStrategy function initializes a new Bollinger Bands strategy instance.
func (*BollingerBandsStrategy) Compute ¶
func (b *BollingerBandsStrategy) Compute(snapshots <-chan *asset.Snapshot) <-chan strategy.Action
Compute processes the provided asset snapshots and generates a stream of actionable recommendations.
func (*BollingerBandsStrategy) Name ¶
func (*BollingerBandsStrategy) Name() string
Name returns the name of the strategy.
type SuperTrendStrategy ¶
type SuperTrendStrategy struct { // SuperTrend represents the configuration parameters for calculating the Super Trend. SuperTrend *volatility.SuperTrend[float64] }
SuperTrendStrategy represents the configuration parameters for calculating the Super Trend strategy. A closing value crossing above the Super Trend suggets a Buy signal, while crossing below the Super Trend indivates a Sell signal.
func NewSuperTrendStrategy ¶
func NewSuperTrendStrategy() *SuperTrendStrategy
NewSuperTrendStrategy function initializes a new Super Trend strategy instance.
func NewSuperTrendStrategyWith ¶
func NewSuperTrendStrategyWith(superTrend *volatility.SuperTrend[float64]) *SuperTrendStrategy
NewSuperTrendStrategyWith function initializes a new Super Trend strategy with the given Super Trend instance.
func (*SuperTrendStrategy) Compute ¶
func (s *SuperTrendStrategy) Compute(snapshots <-chan *asset.Snapshot) <-chan strategy.Action
Compute processes the provided asset snapshots and generates a stream of actionable recommendations.
func (*SuperTrendStrategy) Name ¶
func (s *SuperTrendStrategy) Name() string
Name returns the name of the strategy.