@kumo-charts/core/alerts
API 레퍼런스는 소스 코드의 주석에서 생성되며 영어로만 제공됩니다.
import { … } from '@kumo-charts/core/alerts';
Functions
alertsfunction소스
function alerts(): AlertsModule
The alerts module: chart.alerts, alerts on the price, on series, and on indicators and
drawings when the chart has their modules.
Interfaces
Alertinterface소스
interface Alert
readonly id: stringreadonly source: ValueSourcereadonly trigger: AlertTriggerreadonly value: number | ValueSource | ChannelBoundsreadonly frequency: AlertFrequencyreadonly enabled: booleanreadonly label: string | nullreadonly color: string | nullreadonly lineStyle: LineStylereadonly draggable: booleanreadonly visible: booleanreadonly buttons: readonly PriceLineButton[]readonly status: AlertStatusreadonly triggeredAt: number | nullTime of the bar on which the alert last fired.
AlertDragEventinterface소스
interface AlertDragEvent extends PriceDragEvent
The user drags the line of an alert: its level, or a bound of its channel that is a number.
readonly bound: number | nullThe index in the alert's value of the channel bound dragged; null for one level.
AlertInputinterface소스
interface AlertInput
id?: stringThe chart numbers one, alert-1 on, when it is left out.
source?: ValueSourceWatched value; defaults to the main close.
trigger: AlertTriggervalue: number | ValueSource | ChannelBoundsA fixed level (drawn as a draggable line) or another value to compare with; for the channel triggers, the channel's two bounds, such as two lines of a drawing.
frequency?: AlertFrequencyenabled?: booleanlabel?: stringText of the line label.
color?: stringDefaults to the theme's alert color.
lineStyle?: LineStyledraggable?: booleanLets the user drag a fixed level. Default true.
visible?: booleanShows the line of a fixed level. Default true.
buttons?: PriceLineButton[]AlertsApiinterface소스
interface AlertsApi extends CollectionApi<AlertInput, Alert>
Alerts evaluated on every data update; fixed levels are drawn as draggable lines.
rearm(id: string): voidArms an alert that fired with frequency once again.
AlertsEventMapinterface소스
interface AlertsEventMap
alertDrag: AlertDragEventThe user drags an alert's level, or a bound of its channel; the alert follows immediately and keeps the final value.
alertTrigger: AlertTriggerEventAlertTriggerEventinterface소스
interface AlertTriggerEvent
readonly id: stringreadonly time: numberTime of the bar that met the condition.
readonly value: numberreadonly threshold: numberThe threshold at that bar; for the channel triggers, the bound the value went through to enter or exit, or the bound nearest to it inside or outside.
readonly trigger: AlertTriggerreadonly replay: booleanThe alert fired while the chart replays history.
Types
AlertFrequencytype소스
type AlertFrequency = 'once' | 'once-per-bar' | 'once-per-bar-close' | 'every-time'
once: fires one time, then the alert's status becomestriggereduntilrearm().once-per-bar: at most once per bar, on the tick that meets the condition.once-per-bar-close: evaluates closed bars only, when the next bar starts.every-time: whenever an evaluation meets the condition.
AlertsModuletype소스
type AlertsModule = ChartModule<{
readonly api: { readonly alerts: AlertsApi };
readonly events: AlertsEventMap;
}>
AlertStatustype소스
type AlertStatus = 'active' | 'triggered' | 'disabled'
AlertTriggertype소스
type AlertTrigger =
| 'cross'
| 'cross-up'
| 'cross-down'
| 'above'
| 'below'
| 'enter-channel'
| 'exit-channel'
| 'inside-channel'
| 'outside-channel'
cross-up/cross-down/cross: the source moves through the threshold between two evaluations (ticks or bars).above/below: the source is beyond the threshold.enter-channel/exit-channel: the source moves into, or out of, the channel between two evaluations: inside after being outside or on a bound to enter, outside after being inside or on a bound to exit. Leaping over the whole channel, from below it to above it, does neither.inside-channel/outside-channel: the source is between the bounds, or beyond one.
ChannelBoundstype소스
type ChannelBounds = readonly [number | ValueSource, number | ValueSource]
The two bounds of a channel, in either order: at each bar the channel lies between them, e.g. the top and the bottom of a rectangle.