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)