feat: improved doc-string for plot-annotations

This commit is contained in:
Matthias
2025-05-02 20:32:43 +02:00
parent 81f80a6b22
commit 333660e628
4 changed files with 27 additions and 6 deletions

View File

@@ -1142,9 +1142,10 @@ class AwesomeStrategy(IStrategy):
) -> list[AnnotationType]:
"""
Retrieve area annotations for a chart.
Must be returned as array, with label, start, end, y_start, y_end and color.
All settings are optional - though it usually makes sense to include either "start and end"
or "y_start and y_end" for either horizontal or vertical plots (or all 4 for boxes).
Must be returned as array, with type, label, color, start, end, y_start, y_end.
All settings except for type are optional - though it usually makes sense to include either
"start and end" or "y_start and y_end" for either horizontal or vertical plots
(or all 4 for boxes).
:param pair: Pair that's currently analyzed
:param start_date: Start date of the chart data being requested
:param end_date: End date of the chart data being requested

View File

@@ -840,9 +840,10 @@ class IStrategy(ABC, HyperStrategyMixin):
) -> list[AnnotationType]:
"""
Retrieve area annotations for a chart.
Must be returned as array, with label, start, end, y_start, y_end and color.
All settings are optional - though it usually makes sense to include either "start and end"
or "y_start and y_end" for either horizontal or vertical plots (or all 4 for boxes).
Must be returned as array, with type, label, color, start, end, y_start, y_end.
All settings except for type are optional - though it usually makes sense to include either
"start and end" or "y_start and y_end" for either horizontal or vertical plots
(or all 4 for boxes).
:param pair: Pair that's currently analyzed
:param start_date: Start date of the chart data being requested
:param end_date: End date of the chart data being requested

View File

@@ -28,6 +28,7 @@ from freqtrade.strategy import (
merge_informative_pair,
stoploss_from_absolute,
stoploss_from_open,
AnnotationType,
)
# --------------------------------

View File

@@ -399,3 +399,21 @@ def order_filled(
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
"""
pass
def plot_annotations(
self, pair: str, start_date: datetime, end_date: datetime, dataframe: DataFrame, **kwargs
) -> list[AnnotationType]:
"""
Retrieve area annotations for a chart.
Must be returned as array, with type, label, color, start, end, y_start, y_end.
All settings except for type are optional - though it usually makes sense to include either
"start and end" or "y_start and y_end" for either horizontal or vertical plots
(or all 4 for boxes).
:param pair: Pair that's currently analyzed
:param start_date: Start date of the chart data being requested
:param end_date: End date of the chart data being requested
:param dataframe: DataFrame with the analyzed data for the chart
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
:return: List of AnnotationType objects
"""
return []