@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: stringreadonly time: numberreadonly position: MarkerPositionreadonly price: number | nullreadonly shape: MarkerShapereadonly color: string | nullreadonly text: stringreadonly size: numberreadonly outline: string | nullreadonly link: string | nullMarkerInputinterface源码
interface MarkerInput
id?: stringThe chart numbers one, marker-1 on, when it is left out.
time: TimeInputposition: MarkerPositionAbove the bar's high, below its low, or at price.
price?: numberRequired with position price.
shape: MarkerShapecolor?: stringDefaults to the theme's buy color for upward shapes, its sell color for downward ones and its text color for circles and squares.
text?: stringsize?: numberMarker size in CSS pixels. Default 8.
outline?: stringA 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.
link?: stringThe id of another marker to join with a dashed line in that one's color and outline, such as a trade's exit to its entry. The line shows while both are in the data, across bars out of view too.
Orderinterface源码
interface Order
readonly id: stringreadonly price: numberreadonly side: 'buy' | 'sell'readonly label: OrderLabelreadonly showOnAxis: booleanreadonly tooltip: string | nullreadonly draggable: booleanreadonly pull: booleanreadonly visible: booleanreadonly color: string | nullreadonly lineStyle: LineStylereadonly buttons: readonly PriceLineButton[]OrderInputinterface源码
interface OrderInput
id?: stringUsually the broker's order id; the chart numbers one, order-1 on, when it is left out.
price: numberside: 'buy' | 'sell'label?: OrderLabelInputshowOnAxis?: booleanMarks its price on the price axis. Off where its label says it. Default true.
tooltip?: stringA 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?: booleanLets the user drag the order to a new price. Default true.
pull?: booleanDragging 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?: booleancolor?: stringDefaults to the theme's buy or sell color.
lineStyle?: LineStylebuttons?: PriceLineButton[]OrderLabelinterface源码
interface OrderLabel
readonly text: string | nullreadonly quantity: number | string | nullreadonly position: numberreadonly draggable: booleanOrderLabelInputinterface源码
interface OrderLabelInput
The label of an order on its line: what it writes, and where along the line it is.
text?: stringIts text, such as LIMIT or TP; BUY or SELL by default.
quantity?: number | stringWritten after its text.
position?: numberWhere along the line it is, from 0 at the left of the plot to 1 at its right. Default 1.
draggable?: booleanLets 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: PriceDragEventThe user drags an order line; the order follows immediately and keeps the final price.
orderLabelDrag: LabelDragEventThe 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
MarkerShapefromcore