volatility

package
v2.1.12 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: AGPL-3.0 Imports: 6 Imported by: 2

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 {
    // 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

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

func AllStrategies() []strategy.Strategy

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

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

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.

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.

Jump to

Keyboard shortcuts

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