Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (21 sloc) 714 Bytes
package gobacktest
// Asset is a data building block for the tree structure, eg. Stock, Option, Cash etc.
// It implements the NodeHandler interface via the promoted Node field.
type Asset struct {
// NewAsset return a new strategy node ready to use.
func NewAsset(name string) *Asset {
var asset = &Asset{}
return asset
// Children returns an empty slice and false, an Asset is not allowed to have children.
func (a Asset) Children() ([]NodeHandler, bool) {
return []NodeHandler{}, false
// SetChildren return itself without change, as an Asset ist not allowed to have children.
func (a *Asset) SetChildren(c ...NodeHandler) NodeHandler {
return a
You can’t perform that action at this time.