detect_cross
Detect crossover and crossunder events between two indicators or price series. Returns the latest values, current relation, whether a cross occurred on the last bar, and bars since the last cross.
Instructions
Pine-style crossover analysis (ta.crossover/ta.crossunder).
series_a and series_b are each an indicator spec (ema:20,
ta.sma(50)), a price source (close, hl2, …) or a numeric
constant ("30"). Example: a golden cross is
series_a="ema:50", series_b="ema:200". Returns the latest values,
their relation, whether a cross happened on the last bar, and how many
bars since the last cross.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| symbol | Yes | ||
| exchange | No | ||
| series_a | Yes | ||
| series_b | Yes | ||
| timeframe | No | 1h |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||