diff --git a/docs/strategy-callbacks.md b/docs/strategy-callbacks.md index aebd10857..5853d23e1 100644 --- a/docs/strategy-callbacks.md +++ b/docs/strategy-callbacks.md @@ -1253,9 +1253,13 @@ The plot annotations callback is called whenever freqUI requests data to display This callback has no meaning in the trade cycle context and is only used for charting purposes. The strategy can then return a list of `AnnotationType` objects to be displayed on the chart. -Depending on the content returned - the chart can display horizontal areas, vertical areas, or boxes. +Depending on the content returned - the chart can display horizontal areas, vertical areas, boxes or lines. -The full object looks like this: +### Annotation types + +Currently two types of annotations are supported, `area` and `line`. + +#### Area ``` json { @@ -1270,6 +1274,24 @@ The full object looks like this: } ``` +#### Line + +``` json +{ + "type": "line", // Type of the annotation, currently only "line" is supported + "start": "2024-01-01 15:00:00", // Start date of the line + "end": "2024-01-01 16:00:00", // End date of the line + "y_start": 94000.2, // Price / y axis value + "y_end": 98000, // Price / y axis value + "color": "", + "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. + "label": "some label", + "width": 2, // Optional, line width in pixels. Defaults to 1 + "line_style": "dashed", // Optional, can be "solid", "dashed" or "dotted". Defaults to "solid" + +} +``` + 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. This is obviously a very basic example.