add orderType parameter

This commit is contained in:
narumi 2023-03-02 15:56:25 +08:00
parent 729d32af70
commit 904491e750
2 changed files with 5 additions and 5 deletions

View File

@ -36,6 +36,6 @@ exchangeStrategies:
MAX: 15%
USDT: 10%
threshold: 1%
# max amount to buy or sell per order
maxAmount: 1_000
maxAmount: 1_000 # max amount to buy or sell per order
orderType: LIMIT_MAKER # LIMIT, LIMIT_MAKER or MARKET
dryRun: false

View File

@ -24,9 +24,9 @@ type Strategy struct {
QuoteCurrency string `json:"quoteCurrency"`
TargetWeights types.ValueMap `json:"targetWeights"`
Threshold fixedpoint.Value `json:"threshold"`
MaxAmount fixedpoint.Value `json:"maxAmount"` // max amount to buy or sell per order
OrderType types.OrderType `json:"orderType"`
DryRun bool `json:"dryRun"`
// max amount to buy or sell per order
MaxAmount fixedpoint.Value `json:"maxAmount"`
activeOrderBook *bbgo.ActiveOrderBook
}
@ -199,7 +199,7 @@ func (s *Strategy) generateSubmitOrders(ctx context.Context, session *bbgo.Excha
order := types.SubmitOrder{
Symbol: symbol,
Side: side,
Type: types.OrderTypeLimit,
Type: s.OrderType,
Quantity: quantity,
Price: currentPrice,
}