From f9696d557c55dbb3f9c930e3210efd8c4b878099 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 7 Oct 2025 19:29:28 +0200 Subject: [PATCH] feat: Add line chart type --- freqtrade/ft_types/plot_annotation_type.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/freqtrade/ft_types/plot_annotation_type.py b/freqtrade/ft_types/plot_annotation_type.py index 8bee4b1c2..6dae8a11e 100644 --- a/freqtrade/ft_types/plot_annotation_type.py +++ b/freqtrade/ft_types/plot_annotation_type.py @@ -5,7 +5,7 @@ from pydantic import TypeAdapter from typing_extensions import TypedDict -class AnnotationType(TypedDict, total=False): +class _BaseAnnotationType(TypedDict, total=False): type: Required[Literal["area", "line"]] start: str | datetime end: str | datetime @@ -16,4 +16,16 @@ class AnnotationType(TypedDict, total=False): z_level: int +class AreaAnnotationType(_BaseAnnotationType, total=False): + type: Literal["area"] + + +class LinenAnnotationType(_BaseAnnotationType, total=False): + type: Literal["line"] + width: int + line_style: Literal["solid", "dashed", "dotted"] + + +AnnotationType = AreaAnnotationType | LinenAnnotationType + AnnotationTypeTA = TypeAdapter(AnnotationType)