Documentation ¶
Index ¶
- Constants
- type Entry
- type Exit
- type IntervalWindowSetting
- type Strategy
- func (s *Strategy) ClosePosition(ctx context.Context, percentage fixedpoint.Value) error
- func (s *Strategy) ID() string
- func (s *Strategy) InstanceID() string
- func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, ...) error
- func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)
Constants ¶
View Source
const ID = "pivotshort"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct { Immediate bool `json:"immediate"` CatBounceRatio fixedpoint.Value `json:"catBounceRatio"` Quantity fixedpoint.Value `json:"quantity"` NumLayers int `json:"numLayers"` MarginSideEffect types.MarginOrderSideEffectType `json:"marginOrderSideEffect"` }
type Exit ¶
type Exit struct { TakeProfitPercentage fixedpoint.Value `json:"takeProfitPercentage"` StopLossPercentage fixedpoint.Value `json:"stopLossPercentage"` ShadowTPRatio fixedpoint.Value `json:"shadowTakeProfitRatio"` MarginSideEffect types.MarginOrderSideEffectType `json:"marginOrderSideEffect"` }
type IntervalWindowSetting ¶
type IntervalWindowSetting struct {
types.IntervalWindow
}
type Strategy ¶
type Strategy struct { *bbgo.Graceful *bbgo.Notifiability *bbgo.Persistence Environment *bbgo.Environment Symbol string `json:"symbol"` Market types.Market Interval types.Interval `json:"interval"` TotalQuantity fixedpoint.Value `json:"totalQuantity"` // persistence fields Position *types.Position `json:"position,omitempty" persistence:"position"` ProfitStats *types.ProfitStats `json:"profitStats,omitempty" persistence:"profit_stats"` PivotLength int `json:"pivotLength"` LastLow fixedpoint.Value Entry Entry Exit Exit // StrategyController bbgo.StrategyController // contains filtered or unexported fields }
func (*Strategy) ClosePosition ¶
func (*Strategy) InstanceID ¶
func (*Strategy) Run ¶
func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error
func (*Strategy) Subscribe ¶
func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)
Click to show internal directories.
Click to hide internal directories.