Skip to content

Commit 8d4eb61

Browse files
committed
bbgo: add more open position doc comments
1 parent 68d40de commit 8d4eb61

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

config/pivotshort.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,19 @@ exchangeStrategies:
3333
quantity: 10.0
3434

3535
# marketOrder submits the market sell order when the closed price is lower than the previous pivot low.
36+
# by default we will use market order
3637
marketOrder: true
3738

39+
# limitOrder place limit order to open the short position instead of using market order
40+
# this is useful when your quantity or leverage is quiet large.
41+
limitOrder: false
42+
43+
# limitOrderTakerRatio is the price ratio to adjust your limit order as a taker order. e.g., 0.1%
44+
# for sell order, 0.1% ratio means your final price = price * (1 - 0.1%)
45+
# for buy order, 0.1% ratio means your final price = price * (1 + 0.1%)
46+
# this is only enabled when the limitOrder option set to true
47+
limitOrderTakerRatio: 0
48+
3849
# bounceRatio is used for calculating the price of the limit sell order.
3950
# it's ratio of pivot low bounce when a new pivot low is detected.
4051
# Sometimes when the price breaks the previous low, the price might be pulled back to a higher price.

pkg/bbgo/order_executor_general.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,26 @@ type OpenPositionOptions struct {
138138
Short bool `json:"-" yaml:"-"`
139139

140140
// Leverage is used for leveraged position and account
141+
// Leverage is not effected when using non-leverage spot account
141142
Leverage fixedpoint.Value `json:"leverage,omitempty"`
142143

143-
// Quantity will be used first, it will override the leverage if it's given.
144+
// Quantity will be used first, it will override the leverage if it's given
144145
Quantity fixedpoint.Value `json:"quantity,omitempty"`
145146

146147
// MarketOrder set to true to open a position with a market order
148+
// default is MarketOrder = true
147149
MarketOrder bool `json:"marketOrder,omitempty"`
148150

149151
// LimitOrder set to true to open a position with a limit order
150152
LimitOrder bool `json:"limitOrder,omitempty"`
151153

152154
// LimitOrderTakerRatio is used when LimitOrder = true, it adjusts the price of the limit order with a ratio.
153155
// 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.
156+
//
157+
// limitOrderTakerRatio is the price ratio to adjust your limit order as a taker order. e.g., 0.1%
158+
// for sell order, 0.1% ratio means your final price = price * (1 - 0.1%)
159+
// for buy order, 0.1% ratio means your final price = price * (1 + 0.1%)
160+
// this is only enabled when the limitOrder option set to true
154161
LimitOrderTakerRatio fixedpoint.Value `json:"limitOrderTakerRatio,omitempty"`
155162

156163
Price fixedpoint.Value `json:"-" yaml:"-"`

0 commit comments

Comments
 (0)