bbgo: add more open position doc comments

This commit is contained in:
c9s 2022-09-12 23:48:40 +08:00
parent 68d40de62c
commit 8d4eb611f3
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 19 additions and 1 deletions

View File

@ -33,8 +33,19 @@ exchangeStrategies:
quantity: 10.0 quantity: 10.0
# marketOrder submits the market sell order when the closed price is lower than the previous pivot low. # marketOrder submits the market sell order when the closed price is lower than the previous pivot low.
# by default we will use market order
marketOrder: true marketOrder: true
# limitOrder place limit order to open the short position instead of using market order
# this is useful when your quantity or leverage is quiet large.
limitOrder: false
# limitOrderTakerRatio is the price ratio to adjust your limit order as a taker order. e.g., 0.1%
# for sell order, 0.1% ratio means your final price = price * (1 - 0.1%)
# for buy order, 0.1% ratio means your final price = price * (1 + 0.1%)
# this is only enabled when the limitOrder option set to true
limitOrderTakerRatio: 0
# bounceRatio is used for calculating the price of the limit sell order. # bounceRatio is used for calculating the price of the limit sell order.
# it's ratio of pivot low bounce when a new pivot low is detected. # it's ratio of pivot low bounce when a new pivot low is detected.
# Sometimes when the price breaks the previous low, the price might be pulled back to a higher price. # Sometimes when the price breaks the previous low, the price might be pulled back to a higher price.

View File

@ -138,12 +138,14 @@ type OpenPositionOptions struct {
Short bool `json:"-" yaml:"-"` Short bool `json:"-" yaml:"-"`
// Leverage is used for leveraged position and account // Leverage is used for leveraged position and account
// Leverage is not effected when using non-leverage spot account
Leverage fixedpoint.Value `json:"leverage,omitempty"` Leverage fixedpoint.Value `json:"leverage,omitempty"`
// Quantity will be used first, it will override the leverage if it's given. // Quantity will be used first, it will override the leverage if it's given
Quantity fixedpoint.Value `json:"quantity,omitempty"` Quantity fixedpoint.Value `json:"quantity,omitempty"`
// MarketOrder set to true to open a position with a market order // MarketOrder set to true to open a position with a market order
// default is MarketOrder = true
MarketOrder bool `json:"marketOrder,omitempty"` MarketOrder bool `json:"marketOrder,omitempty"`
// LimitOrder set to true to open a position with a limit order // LimitOrder set to true to open a position with a limit order
@ -151,6 +153,11 @@ type OpenPositionOptions struct {
// LimitOrderTakerRatio is used when LimitOrder = true, it adjusts the price of the limit order with a ratio. // LimitOrderTakerRatio is used when LimitOrder = true, it adjusts the price of the limit order with a ratio.
// So you can ensure that the limit order can be a taker order. Higher the ratio, higher the chance it could be a taker order. // So you can ensure that the limit order can be a taker order. Higher the ratio, higher the chance it could be a taker order.
//
// limitOrderTakerRatio is the price ratio to adjust your limit order as a taker order. e.g., 0.1%
// for sell order, 0.1% ratio means your final price = price * (1 - 0.1%)
// for buy order, 0.1% ratio means your final price = price * (1 + 0.1%)
// this is only enabled when the limitOrder option set to true
LimitOrderTakerRatio fixedpoint.Value `json:"limitOrderTakerRatio,omitempty"` LimitOrderTakerRatio fixedpoint.Value `json:"limitOrderTakerRatio,omitempty"`
Price fixedpoint.Value `json:"-" yaml:"-"` Price fixedpoint.Value `json:"-" yaml:"-"`