import "github.com/cinar/indicator/v2/strategy/compound"
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.
Copyright (c) 2021-2024 Onur Cinar.
The source code is provided under GNU AGPLv3 License.
https://github.com/cinar/indicator
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.
- Constants
- func AllStrategies() []strategy.Strategy
- type MacdRsiStrategy
- func NewMacdRsiStrategy() *MacdRsiStrategy
- func NewMacdRsiStrategyWith(buyAt, sellAt float64) *MacdRsiStrategy
- func (m *MacdRsiStrategy) Compute(snapshots <-chan *asset.Snapshot) <-chan strategy.Action
- func (m *MacdRsiStrategy) Name() string
- func (m *MacdRsiStrategy) Report(c <-chan *asset.Snapshot) *helper.Report
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
)
func AllStrategies
func AllStrategies() []strategy.Strategy
AllStrategies returns a slice containing references to all available compound strategies.
type MacdRsiStrategy
MacdRsiStrategy represents the configuration parameters for calculating the MACD-RSI strategy.
type MacdRsiStrategy struct {
// MacdStrategy is the MACD strategy instance.
MacdStrategy *trend.MacdStrategy
// RsiStrategy is the RSI strategy instance.
RsiStrategy *momentum.RsiStrategy
}
func NewMacdRsiStrategy
func NewMacdRsiStrategy() *MacdRsiStrategy
NewMacdRsiStrategy function initializes a new MACD-RSI strategy instance with the default parameters.
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.
func (*MacdRsiStrategy) Report
func (m *MacdRsiStrategy) 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