compound

package
v2.1.9 Latest Latest
Warning

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

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

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

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

View Source
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

func AllStrategies() []strategy.Strategy

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.

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.

Jump to

Keyboard shortcuts

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