import "github.com/cinar/indicator/v2/examples/compound"Package compound provides illustrative examples demonstrating how to compose multiple indicator strategies into unified signals for educational and research purposes.
This package belongs to the Indicator project. These strategy implementations are provided purely as educational and research examples illustrating how developers can consume core indicator mathematics.
Copyright (c) 2021-2026 The Indicator Authors.
The source code is provided under GNU AGPLv3 License.
https://github.com/cinar/indicator
The information and example strategies provided in this package are strictly for educational and research purposes only and must not be construed as investment, financial, tax, or trading advice.
- 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) ComputeWithContext(ctx context.Context, 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.StrategyAllStrategies 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() *MacdRsiStrategyNewMacdRsiStrategy function initializes a new MACD-RSI strategy instance with the default parameters.
func NewMacdRsiStrategyWith(buyAt, sellAt float64) *MacdRsiStrategyNewMacdRsiStrategyWith 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.ActionCompute wraps ComputeWithContext for backwards compatibility.
Deprecated: Use ComputeWithContext instead.
func (*MacdRsiStrategy) ComputeWithContext
func (m *MacdRsiStrategy) ComputeWithContext(ctx context.Context, snapshots <-chan *asset.Snapshot) <-chan strategy.ActionComputeWithContext processes the provided asset snapshots and generates a stream of actionable recommendations.
func (*MacdRsiStrategy) Name
func (m *MacdRsiStrategy) Name() stringName returns the name of the strategy.
func (*MacdRsiStrategy) Report
func (m *MacdRsiStrategy) Report(c <-chan *asset.Snapshot) *helper.ReportReport processes the provided asset snapshots and generates a report annotated with the recommended actions.
Generated by gomarkdoc