@@ -83,9 +83,9 @@ type Strategy struct {
83
83
MinProfitSpread fixedpoint.Value `json:"minProfitSpread"`
84
84
85
85
// MinProfitActivationRate activates MinProfitSpread when position RoI higher than the specified percentage
86
- MinProfitActivationRate fixedpoint.Value `json:"minProfitActivationRate"`
86
+ MinProfitActivationRate * fixedpoint.Value `json:"minProfitActivationRate"`
87
87
88
- // UseTickerPrice use the ticker api to get the mid price instead of the closed kline price.
88
+ // UseTickerPrice use the ticker api to get the mid- price instead of the closed kline price.
89
89
// The back-test engine is kline-based, so the ticker price api is not supported.
90
90
// Turn this on if you want to do real trading.
91
91
UseTickerPrice bool `json:"useTickerPrice"`
@@ -336,7 +336,7 @@ func (s *Strategy) placeOrders(ctx context.Context, midPrice fixedpoint.Value, k
336
336
337
337
// Apply quantity skew
338
338
// CASE #1:
339
- // WHEN: price is in the neutral bollginer band (window 1) == neutral
339
+ // WHEN: price is in the neutral bollinger band (window 1) == neutral
340
340
// THEN: we don't apply skew
341
341
// CASE #2:
342
342
// WHEN: price is in the upper band (window 2 > price > window 1) == upTrend
@@ -385,7 +385,7 @@ func (s *Strategy) placeOrders(ctx context.Context, midPrice fixedpoint.Value, k
385
385
isLongPosition := s .Position .IsLong ()
386
386
isShortPosition := s .Position .IsShort ()
387
387
388
- if s .Position .ROI (midPrice ).Compare (s .MinProfitActivationRate ) >= 0 {
388
+ if s .MinProfitActivationRate == nil || ( s . MinProfitActivationRate != nil && s . Position .ROI (midPrice ).Compare (* s .MinProfitActivationRate ) >= 0 ) {
389
389
minProfitPrice := s .Position .AverageCost .Mul (fixedpoint .One .Add (s .MinProfitSpread ))
390
390
if isShortPosition {
391
391
minProfitPrice = s .Position .AverageCost .Mul (fixedpoint .One .Sub (s .MinProfitSpread ))
0 commit comments