From cfc4fd1f8112db7e4791905d8be953c03b45b5b6 Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 29 Jun 2022 01:39:33 +0800 Subject: [PATCH] add doc for CumulatedVolumeTakeProfit --- config/pivotshort.yaml | 4 ++-- pkg/strategy/pivotshort/cumulated_volume_take_profit.go | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config/pivotshort.yaml b/config/pivotshort.yaml index 75fcc8535..473df2cbc 100644 --- a/config/pivotshort.yaml +++ b/config/pivotshort.yaml @@ -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: diff --git a/pkg/strategy/pivotshort/cumulated_volume_take_profit.go b/pkg/strategy/pivotshort/cumulated_volume_take_profit.go index 1d2f20d6f..5573687ea 100644 --- a/pkg/strategy/pivotshort/cumulated_volume_take_profit.go +++ b/pkg/strategy/pivotshort/cumulated_volume_take_profit.go @@ -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"`