@kumo-charts/core/drawings
API リファレンスはソースコードのコメントから生成しており、英語のみです。
import { … } from '@kumo-charts/core/drawings';
Functions
checkDrawingStylefunctionソース
function checkStyle(style: Partial<DrawingStyle>): Partial<DrawingStyle>
Validates the fields of a style that are given, leaving the others out: fails with what is wrong, as a chart would take it.
computeDrawingLevelsfunctionソース
function computeDrawingLevels(
definition: DrawingTypeDefinition,
drawing: DrawingLevelsInput,
bars: readonly BarInput[],
options: DrawingLevelsOptions = {}
): Record<string, number[]>
Computes the lines of a drawing over bars, oldest first: one array per line key, with its
value at every bar, as a chart with these bars draws it and its alerts read it.
dashPatternfunctionソース
function dashPattern(style: LineStyle, lineWidth: number): number[]
The dashes of a line of lineWidth CSS pixels in a style: none for a solid one.
drawingLevelsfunctionソース
function drawingLevels(
definition: DrawingTypeDefinition,
drawing: DrawingLevelsInput,
bars: BarsView = emptyBars(),
options: DrawingLevelsOptions = {}
): DrawingLevel[]
The lines of a drawing of a type, such as fibRetracement, that alerts can watch, computed
without a chart: those a chart with bars has for the drawing, the first being the one an alert
watches by default. The style is as the drawing's style gives it, over its type's. Lines computed from the bars, such as a regression trend's or an anchored VWAP's,
follow bars as they change; without bars a drawing still has its lines, which reach no bar.
Runs anywhere, Node included.
drawingLevelValuefunctionソース
function drawingLevelValue(
level: DrawingLevel,
time: number,
bars: BarsView,
options: DrawingLevelsOptions = {}
): number
The value of a line of drawingLevels at the time of a bar, as an alert reads it on a
chart with these bars: interpolated between its points by bar position, NaN where it does
not reach.
drawingsfunctionソース
function drawings(definitions: readonly DrawingTypeDefinition[] = []): DrawingsModule
The drawings module: chart.drawings, the drawing tools and editing, with the drawing types
given, such as drawings(allDrawings) or drawings([trendLine, horizontalLine]). Other types
can be registered with chart.drawings.register().
Interfaces
Drawinginterfaceソース
interface Drawing
readonly id: stringreadonly type: stringreadonly pane: stringreadonly points: readonly DrawingPoint[]readonly style: Readonly<Partial<DrawingStyle>>The style overrides given for this drawing.
readonly text: stringreadonly locked: booleanreadonly visible: booleanreadonly timeframes: DrawingTimeframes | nullThe timeframes it shows on, or null for every one.
DrawingAxisMarksinterfaceソース
interface DrawingAxisMarks
Values and times a drawing highlights on the axes.
readonly prices: readonly number[]readonly times: readonly number[]readonly always?: booleanShown whenever the drawing is visible, not only while it is selected.
DrawingBoundsinterfaceソース
interface DrawingBounds
A rectangle in plot coordinates.
readonly x: numberreadonly y: numberreadonly width: numberreadonly height: numberDrawingGeometryinterfaceソース
interface DrawingGeometry<A extends readonly DrawingPoint[] = readonly DrawingPoint[]>
Pixel geometry of a drawing with anchors A passed to its type definition. Coordinates are
plot-relative.
readonly points: Positions<A>Anchors in plot coordinates, in the order they were placed.
readonly anchors: AAnchors in data coordinates.
readonly width: numberreadonly height: numberreadonly style: DrawingStylereadonly text: stringreadonly theme: Themereadonly fontFamily: stringreadonly textFont: stringThe CSS font of the text: the style's size, weight and slant in the chart's family.
readonly valueToY: (value: number) => numberreadonly yToValue: (y: number) => numberThe value at a height of the plot, the inverse of valueToY.
readonly timeToX: (time: number) => numberX of a time, between bars and beyond them too, e.g. of each bar of a curve.
readonly barIndex: (time: number) => numberContinuous bar index of a time, for counting bars between anchors.
readonly bars: BarsViewThe displayed bars, e.g. to find where price went after an anchor.
readonly source: BarsViewThe source bars a running replay has revealed (all of them otherwise).
readonly formatValue: (value: number) => stringFormats a value with the pane's precision, e.g. for fib level labels.
readonly measureText: (text: string) => numberWidth of text in CSS pixels in the drawing's textFont.
readonly texts: DrawingTextsWords to paint, following the chart's locale and the drawings.texts option.
DrawingHandleinterfaceソース
interface DrawingHandle
A point the user drags to reshape a drawing, in plot coordinates.
readonly id: stringPassed back to moveHandle(); anchors use their index ('0', '1', …).
readonly x: numberreadonly y: numberreadonly cursor?: stringCSS cursor over the handle. Default move.
A line the handle can be grabbed anywhere along, such as a whole edge, in plot coordinates. Markers are grabbed before lines.
readonly marker?: booleanDraws the handle's marker at x, y. Default true; false for a line alone.
DrawingHitinterfaceソース
interface DrawingHit
Where a point hits a drawing: line on one of its lines, body on its content, as its text, the
box of a label or a mark painted solid. A fill is the background of a drawing, never hit: a click
there reaches what is under it, and a drawing is taken by its lines. Handles are hit-tested by the
chart.
readonly part: 'line' | 'body'readonly distance: numberDrawingInputinterfaceソース
interface DrawingInput
id?: stringGenerated when omitted.
type: stringA type the chart has, such as trend-line or fib-retracement, given or registered.
pane?: stringPane id; defaults to main.
points: readonly DrawingPointInput[]style?: Partial<DrawingStyle>text?: stringlocked?: booleanLocked drawings can be selected but not moved.
visible?: booleantimeframes?: DrawingTimeframes | nullThe timeframes it shows on; null or left out, every one.
DrawingLevelinterfaceソース
interface DrawingLevel
A line of a drawing that alerts can watch, straight on screen through two points. Values between the points follow the pane's scale, so a line on a logarithmic scale is watched as drawn. A line that is not straight, such as an anchored VWAP, gives its value at each bar instead.
readonly key: stringNames the line in an alert: { kind: 'drawing', id, level }.
readonly from: DrawingPointreadonly to: DrawingPointreadonly extend?: 'none' | 'end' | 'both'How far the line reaches: between its points (none, default), on past to (end), or
both ways (both). Points at the same time make a horizontal level.
readonly valueAt?: (time: number) => numberThe value at the time of a bar of a line that is not straight, NaN where it does not
reach; from and to then only mark where it starts and ends.
DrawingLevelsOptionsinterfaceソース
interface DrawingLevelsOptions
Options of drawingLevels, drawingLevelValue and computeDrawingLevels.
scale?: 'linear' | 'log'The scale of the drawing's pane, which lines offset from one another and the values between
anchors follow as drawn. Default linear.
DrawingLevelStyleinterfaceソース
interface DrawingLevelStyle
A level of a drawing: a ratio of a Fibonacci or Gann tool, such as 0.618, a number of standard
deviations of a regression channel or of the bands of an anchored VWAP, a count of a time zone.
readonly value: numberreadonly color?: stringDefault: of Fibonacci ratios and Gann boxes, the drawing's color for 0 and 1 and the theme's palette in turn for the others; of the other tools, the drawing's color.
readonly visible?: booleanDefault true.
DrawingOptionsinterfaceソース
interface DrawingOptions
The drawings section of the chart's options, which the drawings module adds.
magnet: MagnetModeSnapping of anchors to the open, high, low or close of the bar under the pointer: weak
snaps near those values, strong always. Ctrl/⌘ inverts it while held.
handleRadius: numberRadius of drawing handles in CSS pixels.
visible: booleanShows the drawings. false hides every one, as a "hide all" switch does, without changing
them: each keeps its own visible, and no step is recorded to undo. Default true.
history: booleanKeeps the steps to undo and redo changes of the drawings by. false keeps none: undo and
redo, by the API or the keys, do nothing. Default true.
texts: TextOverrides<DrawingTexts>Overrides of the words the drawings paint, null for one that follows locale.
DrawingPaintContextinterfaceソース
interface DrawingPaintContext<A extends readonly DrawingPoint[] = readonly DrawingPoint[]>
readonly ctx: CanvasRenderingContext2Dreadonly pixelRatio: numberreadonly geometry: DrawingGeometry<A>readonly hovered: booleanreadonly selected: booleanreadonly editing: booleanThe text is being edited in place: paint everything but the text.
DrawingPointinterfaceソース
interface DrawingPoint
An anchor of a drawing: a time (epoch milliseconds) and a value of its pane.
readonly time: numberreadonly price: numberDrawingPointInputinterfaceソース
interface DrawingPointInput
time: TimeInputprice: numberDrawingsApiinterfaceソース
interface DrawingsApi
set(drawings: readonly DrawingInput[]): voidReplaces every drawing (e.g. when loading a saved layout) and clears the undo history. An invalid input throws and changes nothing.
add(drawing: DrawingInput): stringAdds a drawing as an undoable step and returns its id: the one it has, or one the chart numbers for it.
update(
id: string,
patch: Omit<Partial<DrawingInput>, 'id' | 'type'>,
options?: DrawingUpdateOptions
): voidChanges a drawing as an undoable step, or as part of the step before with merge. Points are
set exactly as given, without the magnet; style fields merge into the drawing's own.
remove(id: string): voidRemoves a drawing as an undoable step. Throws for an unknown id.
clear(): voidRemoves every drawing as an undoable step.
get(id: string): Drawing | nullThe drawing of an id, or null.
list(): Drawing[]validate(drawing: DrawingInput): voidThrows the ChartError that set() would throw for a drawing, without adding it: its type,
pane, points, style, text and timeframes. Checks drawings kept elsewhere before showing them.
duplicate(id: string): stringAdds a copy of a drawing a few bars to the right, as pasting does, as an undoable step and returns its id.
bounds(id: string): DrawingBounds | nullThe area a drawing covers in chart coordinates (CSS pixels from the chart's top-left corner),
clipped to its pane, or null while it is hidden or off screen. Use it to place a toolbar
next to the selected drawing; it moves whenever the view, the data or the drawing changes.
levels(id: string): string[]Keys of the lines of a drawing that alerts can watch with { kind: 'drawing', id, level },
e.g. ['top', 'bottom'] for a rectangle; empty for types without lines.
editText(id: string): booleanOpens the in-place text editor of a drawing whose type has editable text (text); returns
whether it opened. Double-clicking such a drawing does the same.
startTool(type: string, options?: ToolOptions): voidLets the user place a drawing of type, in place of the active tool. The tool ends when the
drawing is placed (drawingsChange with reason create, then toolEnd), on Escape or a
right click (toolEnd, not completed), or with cancelTool(), which reports nothing; with
continuous it stays active for the next drawing.
cancelTool(): voidactiveTool(): string | nullType of the active tool, or null.
toolStyle(type: string): Partial<DrawingStyle>The style the tool of a type gives the drawings the user places, as setToolStyle() set it.
setToolStyle(type: string, style: Partial<DrawingStyle> | null): voidSets the style the tool of a type gives the drawings the user places from now on, under the
style startTool() is given, e.g. the style the user last chose; null forgets it. The
drawings keep it as their own style, so changing it later leaves them as they are.
undo(): booleanredo(): booleancanUndo(): booleancanRedo(): booleanregister(definition: DrawingTypeDefinition): voidAdds a drawing type to this chart, named by its type.
replace(definition: DrawingTypeDefinition): voidPuts a definition in place of the registered one of its type, such as a newer version of a type a page brings: the drawings of it stay and repaint as it defines them, and its tool, if active, is cancelled. One of another number of anchors replaces it only while no drawing of it is on the chart; copies of them in the undo history are then forgotten.
refresh(): voidPaints the drawings again: for a type whose definition paints what it reads besides the drawing, such as values a page computes for it, as that changes, which the chart cannot tell.
unregister(type: string): voidRemoves a drawing type. Fails while drawings of it are on the chart or its tool is active; copies of them in the undo history are forgotten, and the text of one being placed dropped.
types(): string[]Every drawing type the chart has.
definition(type: string): Readonly<DrawingTypeDefinition> | nullThe definition of a type, or null for an unknown type.
fields(type: string): DrawingField[]What a form of a type's settings offers: style fields, and text when it paints its text.
defaultStyle(type: string): DrawingStyleThe style a drawing of a type takes where its own leaves a field out: the chart's defaults and the type's, in the current theme. A form shows it for the fields a drawing does not set.
DrawingsChangeEventinterfaceソース
interface DrawingsChangeEvent
The user created, edited or removed drawings, or undid/redid such a change.
readonly reason: DrawingsChangeReasonreadonly ids: readonly string[]Drawings created, edited or removed; empty for undo and redo, which may affect several.
DrawingsEventMapinterfaceソース
interface DrawingsEventMap
drawingsChange: DrawingsChangeEventtoolEnd: ToolEndEventDrawingSpaceinterfaceソース
interface DrawingSpace extends LevelScale
How anchors lie on screen: their values on the pane's scale, and their times by position among the bars. Straight lines on screen are straight in this space.
barIndex(time: number): numberContinuous bar index of a time, between bars and beyond them.
timeAt(index: number): numberTime at a continuous bar index, the inverse of barIndex.
readonly unitHeight: numberHow tall a unit of the scale is on screen, in widths of a bar: what keeps angles and lengths as the screen shows them, as a rotated rectangle keeps its width as it turns.
DrawingStyleinterfaceソース
interface DrawingStyle
color: stringlineWidth: numberlineStyle: LineStylefill: booleanWhether closed shapes, channels and the bands between levels are filled.
fillColor: stringFill of closed shapes such as rectangles and channels, with its opacity.
textColor: stringfontSize: numberbold: booleanitalic: booleantextAlign: TextAlignWhere the text runs along its line or box: from the left, centered or to the right.
textPosition: TextPositionThe text above its line, on it or below it; at the top, middle or bottom of its box.
extendLeft: booleanLines and levels go on past the anchors to the left or the right edge of the plot.
extendRight: booleanstartArrow: booleanArrowheads at the first and at the last anchor.
endArrow: booleanlevels: readonly DrawingLevelStyle[]The levels of Fibonacci and Gann tools, the price levels of those with time levels too, the deviations of a regression channel and the bands of an anchored VWAP; arrays replace the default whole.
timeLevels: readonly DrawingLevelStyle[]The time levels of tools that divide time too, such as a Gann box: ratios of its width.
levelRange: LevelRangeWhat levels measure from, of the tools that measure: the level at each end.
timeLevelRange: LevelRangeWhat timeLevels measure from.
levelLabel: LevelLabelStyleHow the tools that measure write their levels.
source: PriceSourceThe price of each bar a tool computes from, such as a regression channel or a VWAP.
degree: WaveDegreeThe degree of Elliott waves, which sets how their waves are labelled.
DrawingTextsinterfaceソース
interface DrawingTexts
Words the drawings paint on the canvas, such as the labels of positions. Defaults follow the
chart's locale: Chinese, Japanese or Korean for zh, ja or ko, English otherwise.
text: stringShown by an empty text drawing.
bars: (count: number) => stringA number of bars, e.g. in the price range label.
duration: (ms: number) => stringA span of time in milliseconds, e.g. in the date range label.
target: stringstop: stringriskReward: stringRisk/reward ratio.
open: stringA position still open.
targetHit: stringstopped: stringleftShoulder: stringThe parts of a head and shoulders pattern.
head: stringrightShoulder: stringDrawingTypeDefinitioninterfaceソース
interface DrawingTypeDefinition<
A extends readonly DrawingPoint[] = readonly DrawingPoint[],
Placed extends readonly DrawingPoint[] = A
>
Describes a drawing tool. Register custom tools with chart.drawings.register(). Typed by its
anchors A, as DrawingTypeDefinition<Anchors<2>> for points: 2, it gets them all, and
Placed, those the user places for complete().
readonly type: stringThe type drawings of it name, such as trend-line.
readonly points: numberAnchors of a drawing; 0 means any number, finished with a double click or Enter.
readonly freehand?: booleanDrawn by hand, as with a brush: the anchors follow the pointer while the button is held,
off the bar grid and without the magnet, and letting go finishes the drawing. Needs
points: 0.
readonly place?: numberAnchors the user places when fewer than points; complete() then adds the others, e.g. a
stop level mirrored from the target. Default: points.
complete?(placed: Placed): readonly DrawingPoint[]The drawing's anchors, points of them, from the place anchors the user placed; also used
for the preview.
readonly mainPane?: booleanComputed from the bars of the main pane, such as an anchored VWAP, whose values another pane
does not have: drawings of it go on the main pane only. Default false.
defaultStyle?(theme: Theme): Partial<DrawingStyle>Style defaults on top of the chart's drawing defaults.
readonly fields?: readonly DrawingField[]What a form of its settings offers: the style fields it paints with, and text when it
paints its text. Default: color, lineWidth and lineStyle.
paint(context: DrawingPaintContext<A>): voidpaintBelow?(context: DrawingPaintContext<A>): voidPaints under the series, before paint() paints over them: areas such as the zones of a
position, which leave the bars as they are. Hover and selection do not repaint it, so it is
painted as neither.
hitTest(geometry: DrawingGeometry<A>, point: Point, tolerance: number): DrawingHit | nullhandles?(geometry: DrawingGeometry<A>): readonly DrawingHandle[]Handles shown on hover and selection. Default: one per anchor, which Shift constrains to
horizontal, vertical or diagonal from the neighbouring anchor.
moveHandle?(
anchors: A,
handle: string,
to: DrawingPoint,
space: DrawingSpace,
style: DrawingStyle
): readonly DrawingPoint[]The anchors after dragging handle to to. Required with custom handles() unless their
ids are anchor indices: one that is not fails as soon as the handles show. space places
them as the drawing is drawn, so that a handle between anchors ends under the pointer on a
logarithmic scale or across gaps between bars too; style is the drawing's.
pivotOf?(
anchors: A,
handle: string,
space: DrawingSpace,
style: DrawingStyle
): DrawingPoint | nullWhere Shift constrains a dragged handle that is no anchor from: the point it keeps its
direction to, such as the other end of the line it is the end of. null leaves the handle
free, the default. Handles named after anchors are constrained against their neighbour anchor
and are not asked.
axisMarks?(anchors: A, style: DrawingStyle): DrawingAxisMarksHighlighted on the axes, as the drawing's style draws it. Default: every anchor's value and
time while selected.
bounds?(geometry: DrawingGeometry<A>): DrawingBounds | nullThe area the drawing covers, as far as it reaches past the plot, its labels included: where
chart.drawings.bounds() places a floating toolbar. null where it draws nothing, where the
tool then places nothing either. Default: around the handles.
readonly editableText?: booleanPlacing it or double-clicking it opens the in-place text editor.
readonly textAnchor?: numberIndex of the anchor the text starts at, where the editor opens. Default 0.
levels?(
anchors: A,
scale: LevelScale,
style: DrawingStyle,
context: LevelContext
): readonly DrawingLevel[]Lines alerts can watch, the first one by default, as the drawing's style draws them (e.g.
extended). Without it the type has none. Keys must not depend on the bars of context.
DrawingUpdateOptionsinterfaceソース
interface DrawingUpdateOptions
merge?: stringMakes the update part of the undoable step of the update before, when that one changed the same drawing with the same key and nothing undoable came between: the keystrokes of one edit of a field, or the moves of one drag of a slider, are then undone at once. Give each edit a key of its own, e.g. the field and a count of the edits.
LevelContextinterfaceソース
interface LevelContext
What lines of a drawing may be computed from, besides its anchors.
readonly bars: BarsViewThe bars alerts watch, e.g. for a regression of their closes.
readonly barIndex: (time: number) => numberContinuous bar index of a time, between bars and beyond them.
readonly timeAt: (index: number) => numberTime at a continuous bar index, the inverse of barIndex.
LevelLabelStyleinterfaceソース
interface LevelLabelStyle
How a tool writes its levels: the level and the price beside it, each where it does.
readonly level: booleanWrites the level, as a ratio (0.618) or as a percent (61.8%).
readonly format: 'ratio' | 'percent'readonly prefix: stringAround the level, such as R after it: 2R.
readonly suffix: stringreadonly price: booleanWrites the price after the level, where the tool's levels are prices.
LevelRangeinterfaceソース
interface LevelRange
What the levels of a tool measure from: the level at the start of its measure and the level at
its end, the others placed in proportion, before, between or beyond them. A Fibonacci
retracement measures from its first anchor to its second, { start: 1, end: 0 } by default;
{ start: 0, end: -1 } counts multiples of the move from the first anchor, as risk multiples
from an entry to a stop. Each tool says what it measures.
readonly start: numberreadonly end: numberDiffers from start.
LevelScaleinterfaceソース
interface LevelScale
The pane's scale, e.g. logarithmic, for levels offset from one another as drawn.
toScale(value: number): numberfromScale(scaled: number): numberTimeframeRangeinterfaceソース
interface TimeframeRange
Counts of a unit of timeframes, both included: { from: 1, to: 59 } minutes.
readonly from: numberreadonly to: numberToolEndEventinterfaceソース
interface ToolEndEvent
The user ended the drawing tool: placed its drawing, or cancelled it with Escape or a right
click. Ending it through the API reports nothing: cancelTool(), another startTool(), or
what closes the editor of its text, such as set(), loadState() or removing its pane.
readonly type: stringThe type of the tool.
readonly completed: booleanWhether the user placed its drawing, which drawingsChange reported first. A type with
editable text ends once its editor closes: completed when the text was kept, not when it was
empty or dropped.
ToolOptionsinterfaceソース
interface ToolOptions
style?: Partial<DrawingStyle>text?: stringcontinuous?: booleanKeeps the tool active after a drawing is placed, for drawing several in a row.
Types
Anchorstypeソース
type Anchors<N extends number> = N extends 0
? readonly [DrawingPoint, DrawingPoint, ...DrawingPoint[]]
: TupleOf<DrawingPoint, N>
The anchors of a drawing of a type of N anchors: that many, or two and more for a type of any
number (0). A definition typed by them, as DrawingTypeDefinition<Anchors<2>>, gets its
anchors and their positions so, none of them missing.
DrawingFieldtypeソース
type DrawingField = keyof DrawingStyle | 'text'
What a form of a type's settings offers: fields of its style, and text when the type paints
its text.
DrawingLevelsInputtypeソース
type DrawingLevelsInput = Pick<DrawingInput, 'points' | 'style'>
A drawing as drawingLevels takes it: its anchors and style, as drawings.add() does.
DrawingsChangeReasontypeソース
type DrawingsChangeReason = 'create' | 'edit' | 'remove' | 'undo' | 'redo'
DrawingsModuletypeソース
type DrawingsModule = ChartModule<{
readonly api: { readonly drawings: DrawingsApi };
readonly options: { readonly drawings: DrawingOptions };
readonly events: DrawingsEventMap;
readonly state: { readonly drawings: readonly Drawing[] };
}>
DrawingTimeframestypeソース
type DrawingTimeframes = {
readonly [U in IntervalUnit]?: TimeframeRange;
} & {
/** Bars that do not stand for a period of time, such as Renko or tick bars. */
readonly untimed?: boolean;
}
The timeframes a drawing shows on, by unit: { minute: { from: 1, to: 59 }, hour: { from: 1, to: 4 } } shows it on minute timeframes and on those of up to 4 hours, and hides it on the
others. Bars of unknown resolution show every drawing.
MagnetModetypeソース
type MagnetMode = 'off' | 'weak' | 'strong'
Snapping of drawing anchors to the open, high, low or close of the bar under the pointer:
weak snaps near those values, strong always. Ctrl/⌘ inverts it while held.
Positionstypeソース
type Positions<A extends readonly DrawingPoint[]> = { readonly [K in keyof A]: Point }
The positions of anchors A, one for each.
TextAligntypeソース
type TextAlign = 'left' | 'center' | 'right'
TextPositiontypeソース
type TextPosition = 'top' | 'middle' | 'bottom'
TupleOftypeソース
type TupleOf<
T,
N extends number,
Items extends readonly T[] = readonly []
> = Items['length'] extends N ? Items : TupleOf<T, N, readonly [...Items, T]>
N items of T.
WaveDegreetypeソース
type WaveDegree =
| 'supermillennium'
| 'millennium'
| 'submillennium'
| 'grand-supercycle'
| 'supercycle'
| 'cycle'
| 'primary'
| 'intermediate'
| 'minor'
| 'minute'
| 'minuette'
| 'subminuette'
| 'micro'
| 'submicro'
| 'miniscule'
Degrees of Elliott waves, from the largest; each labels its waves its own way.
Variables
abcdPatternvariableソース
const abcdPattern: DrawingTypeDefinition<Anchors<4>>
A harmonic ABCD pattern: the legs through four points, and dotted lines labelled with the retracement each measures, BC of AB and CD of BC; the CD leg completes the pattern where it matches AB.
allDrawingsvariableソース
const allDrawings: readonly DrawingTypeDefinition[]
Every drawing type of the library, for drawings(allDrawings). Listed one by one, so that an
application picking a few ships only those.
anchoredVwapvariableソース
const anchoredVwap: DrawingTypeDefinition<Anchors<1>>
The volume-weighted average price from the anchor bar on: of
hlc3 by default, with bands levels volume-weighted standard deviations away (the first,
at 1, shown, in the up color). Only the anchor's time counts: its handle sits on the VWAP. Alerts watch the
VWAP (vwap) and the bands shown, by their deviations from it: 1 and -1 for the band at 1.
arrowvariableソース
const arrow: DrawingTypeDefinition<readonly [DrawingPoint, DrawingPoint], readonly [DrawingPoint, DrawingPoint]>
A trend line ending in an arrowhead at the second anchor.
arrowMarkDownvariableソース
const arrowMarkDown: DrawingTypeDefinition<readonly [DrawingPoint], readonly [DrawingPoint]>
arrowMarkUpvariableソース
const arrowMarkUp: DrawingTypeDefinition<readonly [DrawingPoint], readonly [DrawingPoint]>
brushvariableソース
const brush: DrawingTypeDefinition<Anchors<0>>
A stroke drawn by hand: press, draw and let go. It is smoothed, can end in arrowheads, and with
fill it closes into an area. It has no handles: it moves as a whole.
calloutvariableソース
const callout: DrawingTypeDefinition<Anchors<2>>
Text in a box pointing at a place on the chart: place the target, then the box.
circlevariableソース
const circle: DrawingTypeDefinition<Anchors<2>>
A circle around the first anchor through the second, round on screen as zooming stretches the chart, with its text in the middle.
crossLinevariableソース
const crossLine: DrawingTypeDefinition<Anchors<1>>
A horizontal and a vertical line crossing at the anchor; its value and time stay labelled on the axes. Alerts watch its horizontal line.
cyclicLinesvariableソース
const cyclicLines: DrawingTypeDefinition<Anchors<2>>
Cyclic lines: vertical lines at the first anchor and at every span between the two anchors after it, on to the right edge of the plot, to time the cycles of a market.
datePriceRangevariableソース
const datePriceRange: DrawingTypeDefinition<readonly [DrawingPoint, DrawingPoint], readonly [DrawingPoint, DrawingPoint]>
Measures both the change and the time between two anchors.
dateRangevariableソース
const dateRange: DrawingTypeDefinition<readonly [DrawingPoint, DrawingPoint], readonly [DrawingPoint, DrawingPoint]>
Measures the time between two anchors: an arrow towards the second, labelled below.
elliottCorrectionvariableソース
const elliottCorrection: DrawingTypeDefinition<readonly DrawingPoint[], readonly DrawingPoint[]>
The three waves of a correction, A to C, from four points.
elliottDoubleCombovariableソース
const elliottDoubleCombo: DrawingTypeDefinition<readonly DrawingPoint[], readonly DrawingPoint[]>
The three waves of a double combination, W, X and Y, from four points.
elliottImpulsevariableソース
const elliottImpulse: DrawingTypeDefinition<readonly DrawingPoint[], readonly DrawingPoint[]>
The five waves of an impulse, 1 to 5, from six points.
elliottTrianglevariableソース
const elliottTriangle: DrawingTypeDefinition<readonly DrawingPoint[], readonly DrawingPoint[]>
The five waves of a triangle, A to E, from six points.
elliottTripleCombovariableソース
const elliottTripleCombo: DrawingTypeDefinition<readonly DrawingPoint[], readonly DrawingPoint[]>
The five waves of a triple combination, W, X, Y, X and Z, from six points.
ellipsevariableソース
const ellipse: DrawingTypeDefinition<Anchors<3>>
An ellipse at any angle: the first two anchors are the ends of one axis and the third sets the width across it. Its handles are the ends of the axis and the end of the other half axis.
extendedLinevariableソース
const extendedLine: DrawingTypeDefinition<readonly [DrawingPoint, DrawingPoint], readonly [DrawingPoint, DrawingPoint]>
fibChannelvariableソース
const fibChannel: DrawingTypeDefinition<Anchors<3>>
A Fibonacci channel, lines parallel to a trend line at Fibonacci ratios of the channel's width: the first two anchors make the base line (0), the third its parallel (1), and the other ratios lie beyond or between them, each labelled with its value where it starts.
fibExtensionvariableソース
const fibExtension: DrawingTypeDefinition<readonly [DrawingPoint, DrawingPoint, DrawingPoint], readonly [DrawingPoint, DrawingPoint, DrawingPoint]>
A trend-based extension: the move from the first anchor to the second, projected from the third by each ratio. It measures from the third anchor to as far again as the move, 0 to 1 by default (1 repeats the move, 1.618 extends it).
fibRetracementvariableソース
const fibRetracement: DrawingTypeDefinition<readonly [DrawingPoint, DrawingPoint], readonly [DrawingPoint, DrawingPoint]>
Levels of how far a move retraces, measured from where it began, the first anchor, to where it ended, the second: by default from 1 there back to 0 at the end.
fibSpeedFanvariableソース
const fibSpeedFan: DrawingTypeDefinition<Anchors<2>>
A Fibonacci speed resistance fan: rays from the first anchor through the levels of the box it
spans with the second, the price levels on the second anchor's side and the time levels on its
other side. Both measure from the first anchor to the second, by default from 1 there back to
0 at the second, so 0 is the trend line itself. A grid marks the levels in the box, labelled on
every side. Alerts watch the rays of the price levels shown, by their level, and those of the
time levels as time-0.382.
fibTimeZonevariableソース
const fibTimeZone: DrawingTypeDefinition<Anchors<2>>
Fibonacci time zones: the bars from the first anchor to the second make one unit, and vertical lines mark 0, 1, 2, 3, 5, 8, 13, … units from the first anchor, where turns are expected. Each is labelled with its count at the bottom.
flagMarkvariableソース
const flagMark: DrawingTypeDefinition<Anchors<1>>
A small flag planted at its point, to mark a place on the chart.
gannBoxvariableソース
const gannBox: DrawingTypeDefinition<Anchors<2>>
A Gann box: the box from the first anchor to the second divided in price and in time at
levels and timeLevels, each labelled on both sides. Both measure from the first anchor, 0 by
default, to the second, 1. Alerts watch the price levels shown, by their level.
gannFanvariableソース
const gannFan: DrawingTypeDefinition<Anchors<2>>
A Gann fan: rays from the first anchor at Gann's angles, 8×1 to 1×8, the 1×1 through the
second anchor, each labelled where it leaves the plot, where the rays are furthest apart, and
the wedges between them filled. Alerts watch each ray, by its angle, as 2×1.
headAndShouldersvariableソース
const headAndShoulders: DrawingTypeDefinition<Anchors<7>>
A head and shoulders pattern from seven points: the start, the left shoulder, the first low of
the neckline, the head, the second low, the right shoulder and the end. The neckline runs
through the two lows, between the legs that cross it; alerts watch it (neckline), on past the
second low. Upside down it is an inverse head and shoulders.
highlightervariableソース
const highlighter: DrawingTypeDefinition<Anchors<0>>
A broad stroke drawn by hand that the chart shows through, as of a marker pen: a see-through color, smoothed, without arrows or a fill. It moves as a whole, as a brush does.
horizontalLinevariableソース
const horizontalLine: DrawingTypeDefinition<readonly [DrawingPoint], readonly [DrawingPoint]>
horizontalRayvariableソース
const horizontalRay: DrawingTypeDefinition<readonly [DrawingPoint], readonly [DrawingPoint]>
infoLinevariableソース
const infoLine: DrawingTypeDefinition<Anchors<2>>
An info line: a trend line with its figures in a box under its middle, the change of value and its percentage, the bars and the time between the anchors, and its angle on screen.
longPositionvariableソース
const longPosition: DrawingTypeDefinition<readonly [DrawingPoint, DrawingPoint, DrawingPoint], readonly [DrawingPoint, DrawingPoint]>
modifiedSchiffPitchforkvariableソース
const modifiedSchiffPitchfork: DrawingTypeDefinition<readonly [DrawingPoint, DrawingPoint, DrawingPoint], readonly [DrawingPoint, DrawingPoint, DrawingPoint]>
A modified Schiff pitchfork: its median line starts halfway from the first anchor to the second, in time and in value.
parallelChannelvariableソース
const parallelChannel: DrawingTypeDefinition<Anchors<3>>
pathvariableソース
const path: DrawingTypeDefinition<Anchors<0>>
An open-ended polyline through every anchor, with arrowheads at its ends as the style says.
pitchforkvariableソース
const pitchfork: DrawingTypeDefinition<readonly [DrawingPoint, DrawingPoint, DrawingPoint], readonly [DrawingPoint, DrawingPoint, DrawingPoint]>
Andrews' pitchfork: a median line and two parallels through the swing points.
priceLabelvariableソース
const priceLabel: DrawingTypeDefinition<Anchors<1>>
The price of its point in a label above and to the right of it, with a tail pointing at it. Its color is the label's; the text has its own.
priceRangevariableソース
const priceRange: DrawingTypeDefinition<readonly [DrawingPoint, DrawingPoint], readonly [DrawingPoint, DrawingPoint]>
Measures the change between two anchors: an arrow towards the second, labelled beyond it.
rayvariableソース
const ray: DrawingTypeDefinition<readonly [DrawingPoint, DrawingPoint], readonly [DrawingPoint, DrawingPoint]>
rectanglevariableソース
const rectangle: DrawingTypeDefinition<Anchors<2>>
regressionTrendvariableソース
const regressionTrend: DrawingTypeDefinition<Anchors<2>>
A linear regression channel of the bars between two times: the base line fits the
closes (or another source) by least squares, and the lines levels standard deviations away,
+2 and -2 by default, bound the channel. Pearson's R shows how well the line fits. Only the
anchors' times count: their handles sit on the base line. Hiding a line hides it. Alerts watch
the lines shown by their deviations: 2, -2, and 0 for the base line.
rotatedRectanglevariableソース
const rotatedRectangle: DrawingTypeDefinition<Anchors<3>>
A rectangle at any angle, as along a sloping channel or a flag: its middle line from the first anchor to the second, the middles of its ends, and as wide on each side as the third anchor is from it, filled. Its handles are those ends and its four corners: an end turns or stretches it at its width, as the screen shows it; a corner widens or narrows it on both sides.
schiffPitchforkvariableソース
const schiffPitchfork: DrawingTypeDefinition<readonly [DrawingPoint, DrawingPoint, DrawingPoint], readonly [DrawingPoint, DrawingPoint, DrawingPoint]>
A Schiff pitchfork: its median line starts halfway from the first anchor to the second in value.
shortPositionvariableソース
const shortPosition: DrawingTypeDefinition<readonly [DrawingPoint, DrawingPoint, DrawingPoint], readonly [DrawingPoint, DrawingPoint]>
textvariableソース
const text: DrawingTypeDefinition<Anchors<1>>
Text in one or more lines, edited in place; moved by dragging it. Its style can set a background.
trendAnglevariableソース
const trendAngle: DrawingTypeDefinition<Anchors<2>>
A trend line labelled with its angle on screen, in degrees up from the horizontal: a dotted level from the first anchor and an arc up to the line show it. As the angle is the one drawn, it changes as the chart is zoomed.
trendLinevariableソース
const trendLine: DrawingTypeDefinition<readonly [DrawingPoint, DrawingPoint], readonly [DrawingPoint, DrawingPoint]>
trianglevariableソース
const triangle: DrawingTypeDefinition<Anchors<3>>
A triangle through three anchors, filled.
verticalLinevariableソース
const verticalLine: DrawingTypeDefinition<Anchors<1>>
A vertical line at the anchor's time; its time stays labelled on the time axis.
xabcdPatternvariableソース
const xabcdPattern: DrawingTypeDefinition<Anchors<5>>
A harmonic XABCD pattern (Gartley, butterfly, bat, crab): legs through the five points, the triangles XAB and BCD filled, and dotted lines labelled with the retracement each measures.