add doc for CumulatedVolumeTakeProfit

This commit is contained in:
c9s 2022-06-29 01:39:33 +08:00
parent 3d4f765678
commit cfc4fd1f81
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 9 additions and 2 deletions

View File

@ -90,8 +90,8 @@ exchangeStrategies:
# (5) cumulatedVolumeTakeProfit is used to take profit when the cumulated quote volume from the klines exceeded a threshold
- cumulatedVolumeTakeProfit:
minQuoteVolume: 50_000_000
window: 5
minQuoteVolume: 100_000_000
window: 2
backtest:
sessions:

View File

@ -8,6 +8,13 @@ import (
"github.com/c9s/bbgo/pkg/types"
)
// CumulatedVolumeTakeProfit
// This exit method cumulate the volume by N bars, if the cumulated volume exceeded a threshold, then we take profit.
//
// To query the historical quote volume, use the following query:
//
// > SELECT start_time, `interval`, quote_volume, open, close FROM binance_klines WHERE symbol = 'ETHUSDT' AND `interval` = '5m' ORDER BY quote_volume DESC LIMIT 20;
//
type CumulatedVolumeTakeProfit struct {
types.IntervalWindow
Ratio fixedpoint.Value `json:"ratio"`