[fix] midprice fix
This commit is contained in:
parent
7404bdf0dc
commit
4cb31648ad
|
@ -149,7 +149,7 @@ func (s *Strategy) generateOrders(ctx context.Context, kline types.KLine) ([]typ
|
||||||
log.Infof(fmt.Sprintf("place order keline info: symbol %s, high %v, low %v, open %v, close %v", symbol,
|
log.Infof(fmt.Sprintf("place order keline info: symbol %s, high %v, low %v, open %v, close %v", symbol,
|
||||||
kline.High.Float64(), kline.Low.Float64(), kline.Open.Float64(), kline.Close.Float64()))
|
kline.High.Float64(), kline.Low.Float64(), kline.Open.Float64(), kline.Close.Float64()))
|
||||||
placePrice := fixedpoint.Value(0)
|
placePrice := fixedpoint.Value(0)
|
||||||
midPrice := (kline.High.Add(kline.Low)).Div(2)
|
midPrice := (kline.High.Add(kline.Low)).Div(fixedpoint.Value(2.0))
|
||||||
if s.TradeType[symbol] == "long" {
|
if s.TradeType[symbol] == "long" {
|
||||||
placePrice = midPrice
|
placePrice = midPrice
|
||||||
} else if s.TradeType[symbol] == "short" {
|
} else if s.TradeType[symbol] == "short" {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user