Skip to content

Commit 9aeb2ea

Browse files
committed
feat: add z-level to annotations
1 parent c4aa221 commit 9aeb2ea

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/strategy-callbacks.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,6 @@ class AwesomeStrategy(IStrategy):
12471247
You can learn more about storing data on the [Storing custom trade data](strategy-advanced.md#storing-information-persistent) section.
12481248
Please keep in mind that this is considered advanced usage, and should be used with care.
12491249

1250-
12511250
## Plot annotations callback
12521251

12531252
The plot annotations callback is called whenever freqUI requests data to display a chart.
@@ -1266,6 +1265,7 @@ The full object looks like this:
12661265
"y_start": 94000.2, // Price / y axis value
12671266
"y_end": 98000, // Price / y axis value
12681267
"color": "",
1268+
"z_level": 5, // z-level, higher values are drawn on top of lower values. Positions relative to the Chart elements need to be set in freqUI.
12691269
"label": "some label"
12701270
}
12711271
```
@@ -1357,6 +1357,7 @@ Entries will be validated, and won't be passed to the UI if they don't correspon
13571357
"y_end": price * 1.01,
13581358
"y_start": price * 0.99,
13591359
"color": "rgba(0, 255, 0, 0.4)",
1360+
"z_level": 5,
13601361
}
13611362
)
13621363

freqtrade/ft_types/plot_annotation_type.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class AnnotationType(TypedDict, total=False):
1313
y_end: float
1414
color: str
1515
label: str
16+
z_level: int
1617

1718

1819
AnnotationTypeTA = TypeAdapter(AnnotationType)

0 commit comments

Comments
 (0)