Documentation
¶
Index ¶
Constants ¶
View Source
const ID = "support"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PercentageTargetStop ¶ added in v1.18.0
type PercentageTargetStop struct {
Targets []Target `json:"targets"`
}
PercentageTargetStop is a kind of stop order by setting fixed percentage target
func (*PercentageTargetStop) GenerateOrders ¶ added in v1.18.0
func (stop *PercentageTargetStop) GenerateOrders(market types.Market, pos *types.Position) []types.SubmitOrder
GenerateOrders generates the orders from the given targets
type ResistanceStop ¶ added in v1.18.0
type ResistanceStop struct {
Interval types.Interval `json:"interval"`
MinVolume fixedpoint.Value `json:"minVolume"`
TakerBuyRatio fixedpoint.Value `json:"takerBuyRatio"`
// contains filtered or unexported fields
}
ResistanceStop is a kind of stop order by detecting resistance
type Strategy ¶
type Strategy struct {
*bbgo.Notifiability `json:"-"`
*bbgo.Persistence
*bbgo.Graceful `json:"-"`
Symbol string `json:"symbol"`
Market types.Market `json:"-"`
// Interval for checking support
Interval types.Interval `json:"interval"`
// moving average window for checking support (support should be under the moving average line)
TriggerMovingAverage types.IntervalWindow `json:"triggerMovingAverage"`
// LongTermMovingAverage is the second moving average line for checking support position
LongTermMovingAverage types.IntervalWindow `json:"longTermMovingAverage"`
Quantity fixedpoint.Value `json:"quantity"`
MinVolume fixedpoint.Value `json:"minVolume"`
Sensitivity fixedpoint.Value `json:"sensitivity"`
TakerBuyRatio fixedpoint.Value `json:"takerBuyRatio"`
MarginOrderSideEffect types.MarginOrderSideEffectType `json:"marginOrderSideEffect"`
Targets []Target `json:"targets"`
ResistanceStop *ResistanceStop `json:"resistanceStop"`
ResistanceTakerBuyRatio fixedpoint.Value `json:"resistanceTakerBuyRatio"`
// Min BaseAsset balance to keep
MinBaseAssetBalance fixedpoint.Value `json:"minBaseAssetBalance"`
// Max BaseAsset balance to buy
MaxBaseAssetBalance fixedpoint.Value `json:"maxBaseAssetBalance"`
MinQuoteAssetBalance fixedpoint.Value `json:"minQuoteAssetBalance"`
ScaleQuantity *bbgo.PriceVolumeScale `json:"scaleQuantity"`
// contains filtered or unexported fields
}
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.