Documentation
¶
Overview ¶
Package compound contains the compound 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 ¶
const ( // DefaultMacdRsiStrategyBuyAt defines the default RSI level at which a Buy action is generated. DefaultMacdRsiStrategyBuyAt = 30 // DefaultMacdRsiStrategySellAt defines the default RSI level at which a Sell action is generated. DefaultMacdRsiStrategySellAt = 70 )
Variables ¶
This section is empty.
Functions ¶
func AllStrategies ¶
AllStrategies returns a slice containing references to all available compound strategies.
Types ¶
type MacdRsiStrategy ¶
type MacdRsiStrategy struct { // MacdStrategy is the MACD strategy instance. MacdStrategy *trend.MacdStrategy // RsiStrategy is the RSI strategy instance. RsiStrategy *momentum.RsiStrategy }
MacdRsiStrategy represents the configuration parameters for calculating the MACD-RSI strategy.
func NewMacdRsiStrategy ¶
func NewMacdRsiStrategy() *MacdRsiStrategy
NewMacdRsiStrategy function initializes a new MACD-RSI strategy instance with the default parameters.
func NewMacdRsiStrategyWith ¶
func NewMacdRsiStrategyWith(buyAt, sellAt float64) *MacdRsiStrategy
NewMacdRsiStrategyWith function initializes a new MACD-RSI strategy instance with the given parameters.
func (*MacdRsiStrategy) Compute ¶
func (m *MacdRsiStrategy) Compute(snapshots <-chan *asset.Snapshot) <-chan strategy.Action
Compute processes the provided asset snapshots and generates a stream of actionable recommendations.
func (*MacdRsiStrategy) Name ¶
func (m *MacdRsiStrategy) Name() string
Name returns the name of the strategy.