Documentation ¶
Index ¶
Constants ¶
View Source
const ID = "autoborrow"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MarginAction ¶
type MarginAction struct { Exchange types.ExchangeName `json:"exchange"` Action string `json:"action"` Asset string `json:"asset"` Amount fixedpoint.Value `json:"amount"` MarginLevel fixedpoint.Value `json:"marginLevel"` MinMarginLevel fixedpoint.Value `json:"minMarginLevel"` }
func (*MarginAction) SlackAttachment ¶
func (a *MarginAction) SlackAttachment() slack.Attachment
type MarginAlert ¶ added in v1.51.0
type MarginAlert struct { CurrentMarginLevel fixedpoint.Value MinimalMarginLevel fixedpoint.Value SlackMentions []string SessionName string }
on: binance autoborrow: interval: 30m repayWhenDeposit: true
# minMarginLevel for triggering auto borrow minMarginLevel: 1.5 assets:
- asset: ETH low: 3.0 maxQuantityPerBorrow: 1.0 maxTotalBorrow: 10.0
- asset: USDT low: 1000.0 maxQuantityPerBorrow: 100.0 maxTotalBorrow: 10.0
func (*MarginAlert) SlackAttachment ¶ added in v1.51.0
func (m *MarginAlert) SlackAttachment() slack.Attachment
type MarginAsset ¶
type MarginAsset struct { Asset string `json:"asset"` Low fixedpoint.Value `json:"low"` MaxTotalBorrow fixedpoint.Value `json:"maxTotalBorrow"` MaxQuantityPerBorrow fixedpoint.Value `json:"maxQuantityPerBorrow"` MinQuantityPerBorrow fixedpoint.Value `json:"minQuantityPerBorrow"` DebtRatio fixedpoint.Value `json:"debtRatio"` }
type Strategy ¶
type Strategy struct { Interval types.Interval `json:"interval"` MinMarginLevel fixedpoint.Value `json:"minMarginLevel"` MaxMarginLevel fixedpoint.Value `json:"maxMarginLevel"` AutoRepayWhenDeposit bool `json:"autoRepayWhenDeposit"` MarginLevelAlertInterval types.Duration `json:"marginLevelAlertInterval"` MarginLevelAlertMinMargin fixedpoint.Value `json:"marginLevelAlertMinMargin"` MarginLevelAlertSlackMentions []string `json:"marginLevelAlertSlackMentions"` Assets []MarginAsset `json:"assets"` ExchangeSession *bbgo.ExchangeSession // contains filtered or unexported fields }
func (*Strategy) Run ¶
func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error
This strategy simply spent all available quote currency to buy the symbol whenever kline gets closed
func (*Strategy) Subscribe ¶
func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)
Click to show internal directories.
Click to hide internal directories.