package
2.1.1
Repository: https://github.com/cinar/indicator.git
Documentation: pkg.go.dev

# README

volatility

import "github.com/cinar/indicator/v2/strategy/volatility"

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

func AllStrategies

func AllStrategies() []strategy.Strategy

AllStrategies returns a slice containing references to all available volatility strategies.

type BollingerBandsStrategy

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.

type BollingerBandsStrategy struct {
    strategy.Strategy

    // BollingerBands represents the configuration parameters for calculating the Bollinger Bands.
    BollingerBands *volatility.BollingerBands[float64]
}

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.

func (*BollingerBandsStrategy) Report

func (b *BollingerBandsStrategy) Report(c <-chan *asset.Snapshot) *helper.Report

Report processes the provided asset snapshots and generates a report annotated with the recommended actions.

type SuperTrendStrategy

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.

type SuperTrendStrategy struct {
    // SuperTrend represents the configuration parameters for calculating the Super Trend.
    SuperTrend *volatility.SuperTrend[float64]
}

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.

func (*SuperTrendStrategy) Report

func (s *SuperTrendStrategy) Report(c <-chan *asset.Snapshot) *helper.Report

Report processes the provided asset snapshots and generates a report annotated with the recommended actions.

Generated by gomarkdoc

# Functions

AllStrategies returns a slice containing references to all available volatility strategies.
NewBollingerBandsStrategy function initializes a new Bollinger Bands strategy instance.
NewSuperTrendStrategy function initializes a new Super Trend strategy instance.
NewSuperTrendStrategyWith function initializes a new Super Trend strategy with the given Super Trend instance.

# Structs

BollingerBandsStrategy represents the configuration parameters for calculating the Bollinger Bands strategy.
SuperTrendStrategy represents the configuration parameters for calculating the Super Trend strategy.