The strategies are where the results from one or more indicators gets combined to produce a recommended action.
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.
The stragies operates on an Asset with the following members.
type Asset struct {
Date []time.Time
Opening []float64
Closing []float64
High []float64
Low []float64
Volume []int64
}
The StrategyFunction takes an Asset, and provides an array of Action for each row.
// Strategy function.
type StrategyFunction func(Asset) []Action
The following Action values are currently provided.
type Action int
const (
SELL Action = -1
HOLD Action = 0
BUY Action = 1
)
The BuyAndHoldStrategy provides a simple strategy to buy the given asset and hold it. It provides a good indicator for the change of asset's value without any other strategy is used.
actions := indicator.BuyAndHoldStrategy(asset)
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.
Copyright (c) 2021 Onur Cinar. All Rights Reserved.
The source code is provided under MIT License.