From 91b921cc8888b3e5bb14d5657af9a93d375e7359 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 9 Jan 2026 18:59:05 +0100 Subject: [PATCH] feat: update types to support annotation point part of #12698 --- freqtrade/ft_types/plot_annotation_type.py | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/freqtrade/ft_types/plot_annotation_type.py b/freqtrade/ft_types/plot_annotation_type.py index 27717b4cd..13247b266 100644 --- a/freqtrade/ft_types/plot_annotation_type.py +++ b/freqtrade/ft_types/plot_annotation_type.py @@ -6,25 +6,36 @@ from typing_extensions import TypedDict class _BaseAnnotationType(TypedDict, total=False): - start: str | datetime - end: str | datetime - y_start: float - y_end: float color: str label: str z_level: int -class AreaAnnotationType(_BaseAnnotationType, total=False): +class _Base2DAnnotationType(_BaseAnnotationType, total=False): + start: str | datetime + end: str | datetime + y_start: float + y_end: float + + +class AreaAnnotationType(_Base2DAnnotationType, total=False): type: Required[Literal["area"]] -class LineAnnotationType(_BaseAnnotationType, total=False): +class LineAnnotationType(_Base2DAnnotationType, total=False): type: Required[Literal["line"]] width: int line_style: Literal["solid", "dashed", "dotted"] -AnnotationType = AreaAnnotationType | LineAnnotationType +class PointAnnotationType(_BaseAnnotationType, total=False): + type: Required[Literal["point"]] + x: str | datetime + y: float + size: int + shape: Literal["circle", "rect", "roundRect", "triangle", "pin", "arrow", "none"] + + +AnnotationType = AreaAnnotationType | LineAnnotationType | PointAnnotationType AnnotationTypeTA: TypeAdapter[AnnotationType] = TypeAdapter(AnnotationType)