simulator

package
v0.0.0-...-d47a9d6 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package simulator implements various trading / investment strategies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuySellIntraday

type BuySellIntraday struct {
	// contains filtered or unexported fields
}

BuySellIntraday is a configurable day trading strategy.

func (BuySellIntraday) ExecuteTicker

func (s BuySellIntraday) ExecuteTicker(ctx context.Context, lp experiments.LogProfits, xactions bool) strategyResult

type Simulator

type Simulator struct {
	// contains filtered or unexported fields
}

func (*Simulator) AddValue

func (e *Simulator) AddValue(ctx context.Context, k, v string) error

func (*Simulator) Prefix

func (e *Simulator) Prefix(s string) string

func (*Simulator) Run

type Strategy

type Strategy interface {
	// Concurrency-safe strategy execution for a single ticker. A zero result
	// means the strategy didn't apply, no transactions were executed. When
	// "xactions" is true, the list of transactions is generated in the result.
	ExecuteTicker(ctx context.Context, lp experiments.LogProfits, xactions bool) strategyResult
}

Strategy API.

Jump to

Keyboard shortcuts

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