Documentation ¶
Index ¶
- Constants
- type BreakLow
- type FakeBreakStop
- type ResistanceShort
- type StopEMA
- type Strategy
- func (s *Strategy) ClosePosition(ctx context.Context, percentage fixedpoint.Value) error
- func (s *Strategy) CurrentPosition() *types.Position
- 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)
- type SupportTakeProfit
- type TrendEMA
Constants ¶
View Source
const ID = "pivotshort"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BreakLow ¶ added in v1.33.3
type BreakLow struct { Symbol string Market types.Market types.IntervalWindow // Ratio is a number less than 1.0, price * ratio will be the price triggers the short order. Ratio fixedpoint.Value `json:"ratio"` // MarketOrder is the option to enable market order short. MarketOrder bool `json:"marketOrder"` // BounceRatio is a ratio used for placing the limit order sell price // limit sell price = breakLowPrice * (1 + BounceRatio) BounceRatio fixedpoint.Value `json:"bounceRatio"` Leverage fixedpoint.Value `json:"leverage"` Quantity fixedpoint.Value `json:"quantity"` StopEMA *StopEMA `json:"stopEMA"` TrendEMA *TrendEMA `json:"trendEMA"` FakeBreakStop *FakeBreakStop `json:"fakeBreakStop"` // contains filtered or unexported fields }
BreakLow -- when price breaks the previous pivot low, we set a trade entry
func (*BreakLow) Bind ¶ added in v1.36.0
func (s *BreakLow) Bind(session *bbgo.ExchangeSession, orderExecutor *bbgo.GeneralOrderExecutor)
func (*BreakLow) Subscribe ¶ added in v1.36.0
func (s *BreakLow) Subscribe(session *bbgo.ExchangeSession)
type FakeBreakStop ¶ added in v1.38.0
type FakeBreakStop struct {
types.IntervalWindow
}
type ResistanceShort ¶ added in v1.36.0
type ResistanceShort struct { Enabled bool `json:"enabled"` Symbol string `json:"-"` Market types.Market `json:"-"` types.IntervalWindow MinDistance fixedpoint.Value `json:"minDistance"` GroupDistance fixedpoint.Value `json:"groupDistance"` NumLayers int `json:"numLayers"` LayerSpread fixedpoint.Value `json:"layerSpread"` Quantity fixedpoint.Value `json:"quantity"` Leverage fixedpoint.Value `json:"leverage"` Ratio fixedpoint.Value `json:"ratio"` TrendEMA *TrendEMA `json:"trendEMA"` // contains filtered or unexported fields }
func (*ResistanceShort) Bind ¶ added in v1.36.0
func (s *ResistanceShort) Bind(session *bbgo.ExchangeSession, orderExecutor *bbgo.GeneralOrderExecutor)
func (*ResistanceShort) Subscribe ¶ added in v1.38.0
func (s *ResistanceShort) Subscribe(session *bbgo.ExchangeSession)
type StopEMA ¶ added in v1.38.0
type StopEMA struct { types.IntervalWindow Range fixedpoint.Value `json:"range"` }
type Strategy ¶
type Strategy struct { Environment *bbgo.Environment Symbol string `json:"symbol"` Market types.Market // pivot interval and window types.IntervalWindow Leverage fixedpoint.Value `json:"leverage"` Quantity fixedpoint.Value `json:"quantity"` Position *types.Position `persistence:"position"` ProfitStats *types.ProfitStats `persistence:"profit_stats"` TradeStats *types.TradeStats `persistence:"trade_stats"` // BreakLow is one of the entry method BreakLow *BreakLow `json:"breakLow"` // ResistanceShort is one of the entry method ResistanceShort *ResistanceShort `json:"resistanceShort"` SupportTakeProfit []*SupportTakeProfit `json:"supportTakeProfit"` ExitMethods bbgo.ExitMethodSet `json:"exits"` // StrategyController bbgo.StrategyController // contains filtered or unexported fields }
func (*Strategy) ClosePosition ¶
func (*Strategy) CurrentPosition ¶ added in v1.36.0
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)
type SupportTakeProfit ¶ added in v1.36.0
type SupportTakeProfit struct { Symbol string types.IntervalWindow Ratio fixedpoint.Value `json:"ratio"` // contains filtered or unexported fields }
func (*SupportTakeProfit) Bind ¶ added in v1.36.0
func (s *SupportTakeProfit) Bind(session *bbgo.ExchangeSession, orderExecutor *bbgo.GeneralOrderExecutor)
func (*SupportTakeProfit) Subscribe ¶ added in v1.36.0
func (s *SupportTakeProfit) Subscribe(session *bbgo.ExchangeSession)
type TrendEMA ¶ added in v1.38.0
type TrendEMA struct { types.IntervalWindow // MaxGradient is the maximum gradient allowed for the entry. MaxGradient float64 `json:"maxGradient"` MinGradient float64 `json:"minGradient"` // contains filtered or unexported fields }
func (*TrendEMA) Bind ¶ added in v1.38.0
func (s *TrendEMA) Bind(session *bbgo.ExchangeSession, orderExecutor *bbgo.GeneralOrderExecutor)
func (*TrendEMA) GradientAllowed ¶ added in v1.38.0
Click to show internal directories.
Click to hide internal directories.