Kumo Charts

@kumo-charts/core/trading

API 参考由源码注释生成,只有英文。

import { … } from '@kumo-charts/core/trading';

Functions

markersfunction源码

function markers(): MarkersModule

The markers module: chart.markers, executions and signals pinned to bars.

ordersfunction源码

function orders(): OrdersModule

The orders module: chart.orders, orders as draggable price lines on the main pane.

Interfaces

Markerinterface源码

interface Marker
readonly id: string
readonly time: number
readonly position: MarkerPosition
readonly price: number | null
readonly shape: MarkerShape
readonly color: string | null
readonly text: string
readonly size: number
readonly outline: string | null

MarkerInputinterface源码

interface MarkerInput
id?: string

The chart numbers one, marker-1 on, when it is left out.

position: MarkerPosition

Above the bar's high, below its low, or at price.

price?: number

Required with position price.

color?: string

Defaults to the theme's buy color for upward shapes, its sell color for downward ones and its text color for circles and squares.

text?: string
size?: number

Marker size in CSS pixels. Default 8.

outline?: string

A CSS color for a line of 1px around the shape, and along each side of the line of a marker linked to it, so that they stand out of the bars they lie on. None by default.

Orderinterface源码

interface Order
readonly id: string
readonly price: number
readonly side: 'buy' | 'sell'
readonly label: OrderLabel
readonly showOnAxis: boolean
readonly tooltip: string | null
readonly draggable: boolean
readonly pull: boolean
readonly visible: boolean
readonly color: string | null
readonly lineStyle: LineStyle
readonly buttons: readonly PriceLineButton[]

OrderInputinterface源码

interface OrderInput
id?: string

Usually the broker's order id; the chart numbers one, order-1 on, when it is left out.

price: number
side: 'buy' | 'sell'
showOnAxis?: boolean

Marks its price on the price axis. Off where its label says it. Default true.

tooltip?: string

A short text the browser shows after a moment while the pointer rests on its line or its label (not on its buttons), such as what it says that its label does not. None by default.

draggable?: boolean

Lets the user drag the order to a new price. Default true.

pull?: boolean

Dragging it pulls a price out of it instead of moving it, as a stop loss out of a position: it stays where it is, and orderDrag tells where the pointer is, for the application to draw what is pulled and to act on where it is let go. Default false.

visible?: boolean
color?: string

Defaults to the theme's buy or sell color.

lineStyle?: LineStyle
buttons?: PriceLineButton[]

OrderLabelinterface源码

interface OrderLabel
readonly text: string | null
readonly quantity: number | string | null
readonly position: number
readonly draggable: boolean

OrderLabelInputinterface源码

interface OrderLabelInput

The label of an order on its line: what it writes, and where along the line it is.

text?: string

Its text, such as LIMIT or TP; BUY or SELL by default.

quantity?: number | string

Written after its text.

position?: number

Where along the line it is, from 0 at the left of the plot to 1 at its right. Default 1.

draggable?: boolean

Lets the user drag it along the line, to the left or the right; orderLabelDrag tells where it is. Where the order is draggable too, a drag of the label that starts across the plot moves the label, one that starts up or down moves the line. Default false.

OrdersEventMapinterface源码

interface OrdersEventMap
orderDrag: PriceDragEvent

The user drags an order line; the order follows immediately and keeps the final price.

orderLabelDrag: LabelDragEvent

The user drags the label of an order with label.draggable along its line; the label follows immediately and stays where it is let go.

Types

MarkerPositiontype源码

type MarkerPosition = 'above' | 'below' | 'price'

MarkersApitype源码

type MarkersApi = CollectionApi<MarkerInput, Marker>

Executions and signals pinned to bars.

MarkersModuletype源码

type MarkersModule = ChartModule<{
  readonly api: { readonly markers: MarkersApi };
}>

OrdersApitype源码

type OrdersApi = CollectionApi<OrderInput, Order>

Orders drawn as price lines on the main pane. The application owns them; the chart only shows them.

OrdersModuletype源码

type OrdersModule = ChartModule<{
  readonly api: { readonly orders: OrdersApi };
  readonly events: OrdersEventMap;
}>

Re-exports

↑↓ 选择 · Enter 打开 · Esc 关闭