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

# README

compound

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.

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
)

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 {
    strategy.Strategy

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

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

# Functions

AllStrategies returns a slice containing references to all available compound strategies.
NewMacdRsiStrategy function initializes a new MACD-RSI strategy instance with the default parameters.
NewMacdRsiStrategyWith function initializes a new MACD-RSI strategy instance with the given parameters.

# Constants

DefaultMacdRsiStrategyBuyAt defines the default RSI level at which a Buy action is generated.
DefaultMacdRsiStrategySellAt defines the default RSI level at which a Sell action is generated.

# Structs

MacdRsiStrategy represents the configuration parameters for calculating the MACD-RSI strategy.