Skip to content

Commit e55a196

Browse files
committed
docs: update docs for line annotations
closes freqtrade#12307
1 parent f9696d5 commit e55a196

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

docs/strategy-callbacks.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,9 +1253,13 @@ The plot annotations callback is called whenever freqUI requests data to display
12531253
This callback has no meaning in the trade cycle context and is only used for charting purposes.
12541254

12551255
The strategy can then return a list of `AnnotationType` objects to be displayed on the chart.
1256-
Depending on the content returned - the chart can display horizontal areas, vertical areas, or boxes.
1256+
Depending on the content returned - the chart can display horizontal areas, vertical areas, boxes or lines.
12571257

1258-
The full object looks like this:
1258+
### Annotation types
1259+
1260+
Currently two types of annotations are supported, `area` and `line`.
1261+
1262+
#### Area
12591263

12601264
``` json
12611265
{
@@ -1270,6 +1274,24 @@ The full object looks like this:
12701274
}
12711275
```
12721276

1277+
#### Line
1278+
1279+
``` json
1280+
{
1281+
"type": "line", // Type of the annotation, currently only "line" is supported
1282+
"start": "2024-01-01 15:00:00", // Start date of the line
1283+
"end": "2024-01-01 16:00:00", // End date of the line
1284+
"y_start": 94000.2, // Price / y axis value
1285+
"y_end": 98000, // Price / y axis value
1286+
"color": "",
1287+
"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.
1288+
"label": "some label",
1289+
"width": 2, // Optional, line width in pixels. Defaults to 1
1290+
"line_style": "dashed", // Optional, can be "solid", "dashed" or "dotted". Defaults to "solid"
1291+
1292+
}
1293+
```
1294+
12731295
The below example will mark the chart with areas for the hours 8 and 15, with a grey color, highlighting the market open and close hours.
12741296
This is obviously a very basic example.
12751297

0 commit comments

Comments
 (0)