grid

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InvGrid

func InvGrid(pol *config.RunPolicyConfig) *strat.TradeStrat

Types

type Grid

type Grid struct {
	InitRate float64 // Opening the grid for the first time to input multiple 初次打开网格投入倍数
	MaxAdd   int     // Maximum number of warehouse additions 最大加仓次数
	SLRate   float64 // Multiple of stop loss relative to Unit 止损相对Unit的倍数
	Dirt     float64 // Are you currently long or short on the grid; 1 long, -1 short 当前是做多网格还是做空;1做多,-1做空
	HoldSize float64 // Holding position ratio; Relative unit opening size 持有仓位倍率;相对单位开仓大小
	Unit     float64 // grid price unit 网格价格单位
	OneAmt   float64 // The quantity is calculated upon initial entry 一份的数量,初次入场时计算
	EntPrice float64 // Entry price 入场价格
	Pos      float64 // grid position, integer, 网格位置,整数,-6/-5/-4/-3/-2/-1/0/1/2/3/4/5/6
	OldPos   float64 // Last grid location 上次网格位置

	Debug bool
	// contains filtered or unexported fields
}

func NewGrid

func NewGrid(initRate, maxAdd int, slRate float64, debug bool) *Grid

func (*Grid) CheckPos

func (m *Grid) CheckPos(s *strat.StratJob)

func (*Grid) OnOrderChange

func (m *Grid) OnOrderChange(s *strat.StratJob, od *ormo.InOutOrder, chgType int)

func (*Grid) Open

func (m *Grid) Open(s *strat.StratJob)

func (*Grid) UpdatePos

func (m *Grid) UpdatePos(e *ta.BarEnv, price float64)

type GridV1

type GridV1 struct {
	*Grid
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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