model

package
v0.0.0-...-1513131 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

performance_constraints.go

Index

Constants

View Source
const (
	PROTO_STORAGE      AlgoStorageStrategy = "PROTO_STORAGE"
	PROTO_GZIP_STORAGE                     = "PROTO_GZIP_STORAGE"
	JSON_STORAGE                           = "JSON_STORAGE"
	JSON_GZIP_STORAGE                      = "JSON_GZIP_STORAGE"
)
View Source
const (
	Wait          StockAction = "wait"
	Sell                      = "sell"
	Buy                       = "buy"
	InvalidSignal             = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgoStorageStrategy

type AlgoStorageStrategy string

type DataPoint

type DataPoint struct {
	Time   int64   `json:"t"`
	Open   float64 `json:"o"`
	High   float64 `json:"h"`
	Low    float64 `json:"l"`
	Close  float64 `json:"c"`
	Volume float64 `json:"v"`
}

type HistoricalDataRequest

type HistoricalDataRequest struct {
	Ticker    string
	Interval  int
	Timespan  Timespan
	StartDate utils.TimeUtil
	EndDate   utils.TimeUtil
}

type PerformanceConstraints

type PerformanceConstraints struct {
	UpperLimit           float64 `json:"upper_limit"`
	StopLoss             float64 `json:"stop_loss"`
	MinPercentage        float64 `json:"min_percentage"`
	LossWinRatio         float64 `json:"loss_win_ratio"`
	TopNPercentageValues float64 `json:"top_n_percentage_values"`
	TopNValues           int     `json:"top_n_values"`
	TopNMinWinRate       float64 `json:"top_n_min_percentage"`
}

type PolygonResponse

type PolygonResponse struct {
	Ticker  string      `json:"ticker"`
	Results []DataPoint `json:"results"`
}

func (*PolygonResponse) MergeResponse

func (pr *PolygonResponse) MergeResponse(newData *PolygonResponse)

type StockAction

type StockAction string

StockAction represents the possible actions in the stock market.

type Timespan

type Timespan string
const (
	Second Timespan = "second"
	Minute Timespan = "minute"
	Hour   Timespan = "hour"
	Day    Timespan = "day"
)

type TradingSignal

type TradingSignal struct {
	Time   int64
	Action StockAction
}

func NewTradingSignal

func NewTradingSignal() *TradingSignal

func (*TradingSignal) CleanUp

func (ts *TradingSignal) CleanUp()

Jump to

Keyboard shortcuts

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