import * as react_jsx_runtime from 'react/jsx-runtime'; import { ReactNode, RefObject } from 'react'; import { WidgetLanguage as WidgetLanguage$1 } from '@/constants/language.constant'; /* eslint-disable jsdoc/require-jsdoc */ declare const dateFormatFunctions: { readonly "qq 'yy": (date: Date, local: boolean) => string; readonly "qq yyyy": (date: Date, local: boolean) => string; readonly "dd MMM 'yy": (date: Date, local: boolean) => string; readonly "MMM 'yy": (date: Date, local: boolean) => string; readonly "MMM dd, yyyy": (date: Date, local: boolean) => string; readonly "MMM yyyy": (date: Date, local: boolean) => string; readonly "MMM dd": (date: Date, local: boolean) => string; readonly "dd MMM": (date: Date, local: boolean) => string; readonly "yyyy-MM-dd": (date: Date, local: boolean) => string; readonly "yy-MM-dd": (date: Date, local: boolean) => string; readonly "yy/MM/dd": (date: Date, local: boolean) => string; readonly "yyyy/MM/dd": (date: Date, local: boolean) => string; readonly "dd-MM-yyyy": (date: Date, local: boolean) => string; readonly "dd-MM-yy": (date: Date, local: boolean) => string; readonly "dd/MM/yy": (date: Date, local: boolean) => string; readonly "dd/MM/yyyy": (date: Date, local: boolean) => string; readonly "MM/dd/yy": (date: Date, local: boolean) => string; readonly "MM/dd/yyyy": (date: Date, local: boolean) => string; }; /* eslint-enable jsdoc/require-jsdoc */ declare enum ColorType { Solid = "solid", Gradient = "gradient" } declare enum PlotSymbolSize { Auto = "auto", Tiny = "tiny", Small = "small", Normal = "normal", Large = "large", Huge = "huge" } declare const enum PaneSize { Tiny = "tiny", Small = "small", Medium = "medium", Large = "large" } declare const enum PropertyKeyType { DefaultsKey = 1, StateKey = 2, TemplateKey = 4 } declare const enum SearchInitiationPoint { SymbolSearch = "symbolSearch", Watchlist = "watchlist", Compare = "compare", IndicatorInputs = "indicatorInputs" } declare enum ChartStyle { Bar = 0, Candle = 1, Line = 2, Area = 3, Renko = 4, Kagi = 5, PnF = 6, LineBreak = 7, HeikinAshi = 8, HollowCandle = 9, Baseline = 10, HiLo = 12, Column = 13, LineWithMarkers = 14, Stepline = 15, HLCArea = 16, VolCandle = 19, HLCBars = 21 } /** * Mode to clear the marks on the chart. */ declare enum ClearMarksMode { /** Will clear both bar marks AND timescale marks - default value */ All = 0, /** Will only clear bar marks */ BarMarks = 1, /** Will only clear timescale marks */ TimeScaleMarks = 2 } /** * Filled area type. */ declare enum FilledAreaType { /** * Filled area type for plots. */ TypePlots = "plot_plot", /** * Filled area type for bands. */ TypeHlines = "hline_hline" } /** * Histogram Direction. * * Will determine which side of the chart that the histogram appears on. */ declare enum HHistDirection { LeftToRight = "left_to_right", RightToLeft = "right_to_left" } /** * An enum describing a plot style. */ declare enum LineStudyPlotStyle { /** * Line plot style. */ Line = 0, /** * Histogram plot style. */ Histogram = 1, /** * Cross plot style. */ Cross = 3, /** * Area plot style. */ Area = 4, /** * Column plot style. */ Columns = 5, /** * Circles plot style. */ Circles = 6, /** * Line with breaks plot style. */ LineWithBreaks = 7, /** * Area with breaks plot style. */ AreaWithBreaks = 8, /** * Step line plot style. */ StepLine = 9, /** * Step line with diamonds plot style. */ StepLineWithDiamonds = 10, /** * Step line with breaks, like LineWithBreaks */ StepLineWithBreaks = 11 } /** * A line style. */ declare enum LineStyle { /** * Solid line style. */ Solid = 0, /** * Dotted line style. */ Dotted = 1, /** * Dashed line style. */ Dashed = 2 } declare enum MarkLocation { AboveBar = "AboveBar", BelowBar = "BelowBar", Top = "Top", Bottom = "Bottom", Right = "Right", Left = "Left", Absolute = "Absolute", AbsoluteUp = "AbsoluteUp", AbsoluteDown = "AbsoluteDown" } /** * Market status for the symbol. */ declare enum MarketStatus { Open = "market", Pre = "pre_market", Post = "post_market", Close = "out_of_session", Holiday = "holiday" } declare enum OhlcStudyPlotStyle { OhlcBars = "ohlc_bars", OhlcCandles = "ohlc_candles" } /** * Plot line style */ declare enum OverrideLineStyle { /** * Solid line style. */ Solid = 0, /** * Dotted line style. */ Dotted = 1, /** * Dashed line style. */ Dashed = 2 } /** * Last value label mode. */ declare enum OverridePriceAxisLastValueMode { /** * Price and % value. */ LastPriceAndPercentageValue = 0, /** * Value according to scale. */ LastValueAccordingToScale = 1 } declare enum PlDisplay { Money = 0, Pips = 1, Percentage = 2 } declare enum PriceScaleMode { /** Normal mode of the price scale */ Normal = 0, /** Logarithmic mode of the price scale */ Log = 1, /** Percentage mode of the price scale */ Percentage = 2, /** Indexed to 100 mode of the price scale */ IndexedTo100 = 3 } declare enum SeriesType { Bars = 0, Candles = 1, Line = 2, Area = 3, HeikenAshi = 8, HollowCandles = 9, Baseline = 10, HiLo = 12, Column = 13, LineWithMarkers = 14, Stepline = 15, HLCArea = 16, VolCandle = 19, HLCBars = 21, Renko = 4, Kagi = 5, PointAndFigure = 6, LineBreak = 7 } declare enum StudyInputType { Integer = "integer", Float = "float", Price = "price", Bool = "bool", Text = "text", Symbol = "symbol", Session = "session", Source = "source", Resolution = "resolution", Time = "time", BarTime = "bar_time", Color = "color", Textarea = "text_area" } declare enum StudyPlotDisplayTarget { None = 0, Pane = 1, DataWindow = 2, PriceScale = 4, StatusLine = 8, All = 15 } declare enum StudyPlotType { Line = "line", Colorer = "colorer", BarColorer = "bar_colorer", BgColorer = "bg_colorer", TextColorer = "text_colorer", OhlcColorer = "ohlc_colorer", CandleWickColorer = "wick_colorer", CandleBorderColorer = "border_colorer", UpColorer = "up_colorer", DownColorer = "down_colorer", Shapes = "shapes", Chars = "chars", Arrows = "arrows", Data = "data", DataOffset = "dataoffset", OhlcOpen = "ohlc_open", OhlcHigh = "ohlc_high", OhlcLow = "ohlc_low", OhlcClose = "ohlc_close" } declare enum StudyTargetPriceScale { Right = 0, Left = 1, NoScale = 2 } declare enum TimeFrameType { PeriodBack = "period-back", TimeRange = "time-range" } declare enum TimeHoursFormat { TwentyFourHours = "24-hours", TwelveHours = "12-hours" } declare enum TradedGroupHorizontalAlignment { Left = 0, Center = 1, Right = 2 } declare enum VisibilityType { AlwaysOn = "alwaysOn", VisibleOnMouseOver = "visibleOnMouseOver", AlwaysOff = "alwaysOff" } /** * This is the generic type useful for declaring a nominal type, * which does not structurally matches with the base type and * the other types declared over the same base type * * Usage: * @example * type Index = Nominal; * // let i: Index = 42; // this fails to compile * let i: Index = 42 as Index; // OK * @example * type TagName = Nominal; */ declare type Nominal = T & { /* eslint-disable-next-line jsdoc/require-jsdoc */ [Symbol.species]: Name; }; /** * Overrides for the 'Accelerator Oscillator' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface AcceleratorOscillatorIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `histogram` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#000080` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Accumulation/Distribution' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface AccumulationDistributionIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Accumulative Swing Index' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface AccumulativeSwingIndexIndicatorOverrides { /** Default value: `15` */ "asi.display": number; /** Default value: `0` */ "asi.linestyle": number; /** Default value: `1` */ "asi.linewidth": number; /** Default value: `line` */ "asi.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "asi.trackprice": boolean; /** Default value: `0` */ "asi.transparency": number; /** Default value: `#2196F3` */ "asi.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Advance/Decline' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface AdvanceDeclineIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Anchored VWAP' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface AnchoredVWAPIndicatorOverrides { /** Default value: `#4caf50` */ "background #1.color": string; /** Default value: `95` */ "background #1.transparency": number; /** Default value: `true` */ "background #1.visible": boolean; /** Default value: `15` */ "vwap.display": number; /** Default value: `#1e88e5` */ "vwap.color": string; /** Default value: `0` */ "vwap.linestyle": number; /** Default value: `1` */ "vwap.linewidth": number; /** Default value: `line` */ "vwap.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "vwap.trackprice": boolean; /** Default value: `0` */ "vwap.transparency": number; /** Default value: `15` */ "lower band #1.display": number; /** Default value: `#4caf50` */ "lower band #1.color": string; /** Default value: `0` */ "lower band #1.linestyle": number; /** Default value: `1` */ "lower band #1.linewidth": number; /** Default value: `line` */ "lower band #1.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "lower band #1.trackprice": boolean; /** Default value: `0` */ "lower band #1.transparency": number; /** Default value: `15` */ "lower band #2.display": number; /** Default value: `#808000` */ "lower band #2.color": string; /** Default value: `0` */ "lower band #2.linestyle": number; /** Default value: `1` */ "lower band #2.linewidth": number; /** Default value: `line` */ "lower band #2.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "lower band #2.trackprice": boolean; /** Default value: `0` */ "lower band #2.transparency": number; /** Default value: `15` */ "lower band #3.display": number; /** Default value: `#00897b` */ "lower band #3.color": string; /** Default value: `0` */ "lower band #3.linestyle": number; /** Default value: `1` */ "lower band #3.linewidth": number; /** Default value: `line` */ "lower band #3.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "lower band #3.trackprice": boolean; /** Default value: `0` */ "lower band #3.transparency": number; /** Default value: `15` */ "upper band #1.display": number; /** Default value: `#4caf50` */ "upper band #1.color": string; /** Default value: `0` */ "upper band #1.linestyle": number; /** Default value: `1` */ "upper band #1.linewidth": number; /** Default value: `line` */ "upper band #1.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "upper band #1.trackprice": boolean; /** Default value: `0` */ "upper band #1.transparency": number; /** Default value: `15` */ "upper band #2.display": number; /** Default value: `#808000` */ "upper band #2.color": string; /** Default value: `0` */ "upper band #2.linestyle": number; /** Default value: `1` */ "upper band #2.linewidth": number; /** Default value: `line` */ "upper band #2.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "upper band #2.trackprice": boolean; /** Default value: `0` */ "upper band #2.transparency": number; /** Default value: `15` */ "upper band #3.display": number; /** Default value: `#00897b` */ "upper band #3.color": string; /** Default value: `0` */ "upper band #3.linestyle": number; /** Default value: `1` */ "upper band #3.linewidth": number; /** Default value: `line` */ "upper band #3.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "upper band #3.trackprice": boolean; /** Default value: `0` */ "upper band #3.transparency": number; [key: string]: StudyOverrideValueType; } interface AreaStylePreferences { /** Top color of the gradient fill. Must be an RGBA color string (e.g., `"rgba(255, 0, 0, 0.5)"`). */ color1: string; /** Bottom color of the gradient fill. Must be an RGBA color string (e.g., `"rgba(255, 0, 0, 0.5)"`). */ color2: string; /** Line color. Must be a simple color string (e.g., `"red"`, `"#FF0000"`). */ linecolor: string; /** Line Style {@link LineStyle} */ linestyle: number; /** Line width */ linewidth: number; /** * Transparency. Range [0..100] * `0` - fully opaque, * `100` - fully transparent. * * **Note**: Rather use `rgba` color string for setting transparency. */ transparency: number; } /** * Overrides for the 'Arnaud Legoux Moving Average' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface ArnaudLegouxMovingAverageIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Aroon' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface AroonIndicatorOverrides { /** Default value: `15` */ "upper.display": number; /** Default value: `0` */ "upper.linestyle": number; /** Default value: `1` */ "upper.linewidth": number; /** Default value: `line` */ "upper.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "upper.trackprice": boolean; /** Default value: `0` */ "upper.transparency": number; /** Default value: `#FB8C00` */ "upper.color": string; /** Default value: `15` */ "lower.display": number; /** Default value: `0` */ "lower.linestyle": number; /** Default value: `1` */ "lower.linewidth": number; /** Default value: `line` */ "lower.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "lower.trackprice": boolean; /** Default value: `0` */ "lower.transparency": number; /** Default value: `#2196F3` */ "lower.color": string; [key: string]: StudyOverrideValueType; } interface AvailableZOrderOperations { /** 'Bring Forward' is possible */ bringForwardEnabled: boolean; /** 'Bring to Front' is possible */ bringToFrontEnabled: boolean; /** 'Send Backward' is possible */ sendBackwardEnabled: boolean; /** 'Send to Back' is possible */ sendToBackEnabled: boolean; } /** * Overrides for the 'Average Directional Index' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface AverageDirectionalIndexIndicatorOverrides { /** Default value: `15` */ "adx.display": number; /** Default value: `0` */ "adx.linestyle": number; /** Default value: `1` */ "adx.linewidth": number; /** Default value: `line` */ "adx.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "adx.trackprice": boolean; /** Default value: `0` */ "adx.transparency": number; /** Default value: `#FF5252` */ "adx.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Average Price' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface AveragePriceIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Average True Range' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface AverageTrueRangeIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#801922` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Awesome Oscillator' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface AwesomeOscillatorIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `histogram` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#000080` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Balance of Power' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface BalanceofPowerIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#FF5252` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Bar data point */ interface Bar { /** Bar time. * Amount of **milliseconds** since Unix epoch start in **UTC** timezone. * `time` for daily, weekly, and monthly bars is expected to be a trading day (not session start day) at 00:00 UTC. * The library adjusts time according to `session` from {@link LibrarySymbolInfo}. */ time: number; /** Opening price */ open: number; /** High price */ high: number; /** Low price */ low: number; /** Closing price */ close: number; /** Trading Volume */ volume?: number; } interface BarStylePreferences { /** Up bar color */ upColor: string; /** Down bar color */ downColor: string; /** Bar color determined by previous close value */ barColorsOnPrevClose: boolean; /** Whether to draw opening value for bar */ dontDrawOpen: boolean; /** Draw thin bars. Default - `true` */ thinBars: boolean; } interface BaselineStylePreferences { /** Top fill color of positive area */ topFillColor1: string; /** Bottom fill color of positive area */ topFillColor2: string; /** Top fill color of negative area */ bottomFillColor1: string; /** Bottom fill color of negative area */ bottomFillColor2: string; /** Positive area line color */ topLineColor: string; /** Negative area line color */ bottomLineColor: string; /** Baseline line color */ baselineColor: string; /** Positive area line width */ topLineWidth: number; /** Negative area line width */ bottomLineWidth: number; /** Top line style */ topLineStyle: number; /** Bottom line style */ bottomLineStyle: number; /** * Transparency. Range [0..100] * `0` - fully opaque, * `100` - fully transparent. * * **Note**: Rather use `rgba` color string for setting transparency. */ transparency: number; /** Baseline level percentage */ baseLevelPercentage: number; } /** * Overrides for the 'Bollinger Bands %B' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface BollingerBandsBIndicatorOverrides { /** Default value: `#26A69A` */ "hlines background.color": string; /** Default value: `90` */ "hlines background.transparency": number; /** Default value: `true` */ "hlines background.visible": boolean; /** Default value: `#787B86` */ "upperlimit.color": string; /** Default value: `2` */ "upperlimit.linestyle": number; /** Default value: `1` */ "upperlimit.linewidth": number; /** Default value: `true` */ "upperlimit.visible": boolean; /** Default value: `1` */ "upperlimit.value": number; /** Default value: `#787B86` */ "lowerlimit.color": string; /** Default value: `2` */ "lowerlimit.linestyle": number; /** Default value: `1` */ "lowerlimit.linewidth": number; /** Default value: `true` */ "lowerlimit.visible": boolean; /** Default value: `0` */ "lowerlimit.value": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `true` */ "plot.visible": boolean; /** Default value: `#22AB94` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Bollinger Bands' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface BollingerBandsIndicatorOverrides { /** Default value: `#2196F3` */ "plots background.color": string; /** Default value: `95` */ "plots background.transparency": number; /** Default value: `true` */ "plots background.visible": boolean; /** Default value: `0` */ "median.linestyle": number; /** Default value: `1` */ "median.linewidth": number; /** Default value: `line` */ "median.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "median.trackprice": boolean; /** Default value: `0` */ "median.transparency": number; /** Default value: `true` */ "median.visible": boolean; /** Default value: `#FF6D00` */ "median.color": string; /** Default value: `0` */ "upper.linestyle": number; /** Default value: `1` */ "upper.linewidth": number; /** Default value: `line` */ "upper.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "upper.trackprice": boolean; /** Default value: `0` */ "upper.transparency": number; /** Default value: `true` */ "upper.visible": boolean; /** Default value: `#2196F3` */ "upper.color": string; /** Default value: `0` */ "lower.linestyle": number; /** Default value: `1` */ "lower.linewidth": number; /** Default value: `line` */ "lower.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "lower.trackprice": boolean; /** Default value: `0` */ "lower.transparency": number; /** Default value: `true` */ "lower.visible": boolean; /** Default value: `#2196F3` */ "lower.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Bollinger Bands Width' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface BollingerBandsWidthIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#FF6D00` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Override properties that can be used within {@link TradingCustomization.brokerOrder} of the {@link TradingTerminalWidgetOptions.trading_customization} object. * * In a property name, "normal" indicates the line is active and visible in the UI, while "disabled" means the line is inactive, such as when another dialog is open. */ interface BrokerOrderOverrides { "buy.normal.anchor.backgroundColor": string; "buy.normal.anchor.borderColor": string; "buy.normal.anchor.shadowColor": string; "buy.normal.borderBackgroundColor": string; "buy.normal.borderColor": string; "buy.normal.close.activeColor": string; "buy.normal.close.backgroundColor": string; "buy.normal.close.iconColor": string; "buy.normal.confirm.activeColor": string; "buy.normal.confirm.backgroundColor": string; "buy.normal.confirm.borderColor": string; "buy.normal.confirm.disableBackgroundColor": string; "buy.normal.confirm.disableTextColor": string; "buy.normal.confirm.textColor": string; "buy.normal.disabledLineColor": string; "buy.normal.informer.backgroundColor": string; "buy.normal.informer.iconColor": string; "buy.normal.labelTickColor": string; "buy.normal.lineColor": string; "buy.normal.negativePlColor": string; "buy.normal.pointBackgroundColor": string; "buy.normal.pointShadowColor": string; "buy.normal.positivePlColor": string; "buy.normal.qty.activeColor": string; "buy.normal.qty.backgroundColor": string; "buy.normal.qty.dividerColor": string; "buy.normal.qty.textColor": string; "buy.normal.text.backgroundColor": string; "buy.normal.text.buttonTextColor": string; "buy.normal.text.dividerColor": string; "buy.normal.text.textColor": string; "buy.normal.text.activeColor": string; "buy.disabled.anchor.backgroundColor": string; "buy.disabled.anchor.borderColor": string; "buy.disabled.anchor.shadowColor": string; "buy.disabled.borderBackgroundColor": string; "buy.disabled.borderColor": string; "buy.disabled.close.activeColor": string; "buy.disabled.close.backgroundColor": string; "buy.disabled.close.iconColor": string; "buy.disabled.confirm.activeColor": string; "buy.disabled.confirm.backgroundColor": string; "buy.disabled.confirm.borderColor": string; "buy.disabled.confirm.disableBackgroundColor": string; "buy.disabled.confirm.disableTextColor": string; "buy.disabled.confirm.textColor": string; "buy.disabled.disabledLineColor": string; "buy.disabled.informer.backgroundColor": string; "buy.disabled.informer.iconColor": string; "buy.disabled.labelTickColor": string; "buy.disabled.lineColor": string; "buy.disabled.negativePlColor": string; "buy.disabled.pointBackgroundColor": string; "buy.disabled.pointShadowColor": string; "buy.disabled.positivePlColor": string; "buy.disabled.qty.activeColor": string; "buy.disabled.qty.backgroundColor": string; "buy.disabled.qty.dividerColor": string; "buy.disabled.qty.textColor": string; "buy.disabled.text.backgroundColor": string; "buy.disabled.text.buttonTextColor": string; "buy.disabled.text.dividerColor": string; "buy.disabled.text.textColor": string; "buy.disabled.text.activeColor": string; "sell.normal.anchor.backgroundColor": string; "sell.normal.anchor.borderColor": string; "sell.normal.anchor.shadowColor": string; "sell.normal.borderBackgroundColor": string; "sell.normal.borderColor": string; "sell.normal.close.activeColor": string; "sell.normal.close.backgroundColor": string; "sell.normal.close.iconColor": string; "sell.normal.confirm.activeColor": string; "sell.normal.confirm.backgroundColor": string; "sell.normal.confirm.borderColor": string; "sell.normal.confirm.disableBackgroundColor": string; "sell.normal.confirm.disableTextColor": string; "sell.normal.confirm.textColor": string; "sell.normal.disabledLineColor": string; "sell.normal.informer.backgroundColor": string; "sell.normal.informer.iconColor": string; "sell.normal.labelTickColor": string; "sell.normal.lineColor": string; "sell.normal.negativePlColor": string; "sell.normal.pointBackgroundColor": string; "sell.normal.pointShadowColor": string; "sell.normal.positivePlColor": string; "sell.normal.qty.activeColor": string; "sell.normal.qty.backgroundColor": string; "sell.normal.qty.dividerColor": string; "sell.normal.qty.textColor": string; "sell.normal.text.backgroundColor": string; "sell.normal.text.buttonTextColor": string; "sell.normal.text.dividerColor": string; "sell.normal.text.textColor": string; "sell.normal.text.activeColor": string; "sell.disabled.anchor.backgroundColor": string; "sell.disabled.anchor.borderColor": string; "sell.disabled.anchor.shadowColor": string; "sell.disabled.borderBackgroundColor": string; "sell.disabled.borderColor": string; "sell.disabled.close.activeColor": string; "sell.disabled.close.backgroundColor": string; "sell.disabled.close.iconColor": string; "sell.disabled.confirm.activeColor": string; "sell.disabled.confirm.backgroundColor": string; "sell.disabled.confirm.borderColor": string; "sell.disabled.confirm.disableBackgroundColor": string; "sell.disabled.confirm.disableTextColor": string; "sell.disabled.confirm.textColor": string; "sell.disabled.disabledLineColor": string; "sell.disabled.informer.backgroundColor": string; "sell.disabled.informer.iconColor": string; "sell.disabled.labelTickColor": string; "sell.disabled.lineColor": string; "sell.disabled.negativePlColor": string; "sell.disabled.pointBackgroundColor": string; "sell.disabled.pointShadowColor": string; "sell.disabled.positivePlColor": string; "sell.disabled.qty.activeColor": string; "sell.disabled.qty.backgroundColor": string; "sell.disabled.qty.dividerColor": string; "sell.disabled.qty.textColor": string; "sell.disabled.text.backgroundColor": string; "sell.disabled.text.buttonTextColor": string; "sell.disabled.text.dividerColor": string; "sell.disabled.text.textColor": string; "sell.disabled.text.activeColor": string; "takeProfit.normal.anchor.backgroundColor": string; "takeProfit.normal.anchor.borderColor": string; "takeProfit.normal.anchor.shadowColor": string; "takeProfit.normal.borderBackgroundColor": string; "takeProfit.normal.borderColor": string; "takeProfit.normal.close.activeColor": string; "takeProfit.normal.close.backgroundColor": string; "takeProfit.normal.close.iconColor": string; "takeProfit.normal.confirm.activeColor": string; "takeProfit.normal.confirm.backgroundColor": string; "takeProfit.normal.confirm.borderColor": string; "takeProfit.normal.confirm.disableBackgroundColor": string; "takeProfit.normal.confirm.disableTextColor": string; "takeProfit.normal.confirm.textColor": string; "takeProfit.normal.disabledLineColor": string; "takeProfit.normal.informer.backgroundColor": string; "takeProfit.normal.informer.iconColor": string; "takeProfit.normal.labelTickColor": string; "takeProfit.normal.lineColor": string; "takeProfit.normal.negativePlColor": string; "takeProfit.normal.pointBackgroundColor": string; "takeProfit.normal.pointShadowColor": string; "takeProfit.normal.positivePlColor": string; "takeProfit.normal.qty.activeColor": string; "takeProfit.normal.qty.backgroundColor": string; "takeProfit.normal.qty.dividerColor": string; "takeProfit.normal.qty.textColor": string; "takeProfit.normal.text.backgroundColor": string; "takeProfit.normal.text.buttonTextColor": string; "takeProfit.normal.text.dividerColor": string; "takeProfit.normal.text.textColor": string; "takeProfit.normal.text.activeColor": string; "takeProfit.normal.text.hintAreaColor": string; "takeProfit.normal.movingBackgroundColor": string; "takeProfit.disabled.anchor.backgroundColor": string; "takeProfit.disabled.anchor.borderColor": string; "takeProfit.disabled.anchor.shadowColor": string; "takeProfit.disabled.borderBackgroundColor": string; "takeProfit.disabled.borderColor": string; "takeProfit.disabled.close.activeColor": string; "takeProfit.disabled.close.backgroundColor": string; "takeProfit.disabled.close.iconColor": string; "takeProfit.disabled.confirm.activeColor": string; "takeProfit.disabled.confirm.backgroundColor": string; "takeProfit.disabled.confirm.borderColor": string; "takeProfit.disabled.confirm.disableBackgroundColor": string; "takeProfit.disabled.confirm.disableTextColor": string; "takeProfit.disabled.confirm.textColor": string; "takeProfit.disabled.disabledLineColor": string; "takeProfit.disabled.informer.backgroundColor": string; "takeProfit.disabled.informer.iconColor": string; "takeProfit.disabled.labelTickColor": string; "takeProfit.disabled.lineColor": string; "takeProfit.disabled.negativePlColor": string; "takeProfit.disabled.pointBackgroundColor": string; "takeProfit.disabled.pointShadowColor": string; "takeProfit.disabled.positivePlColor": string; "takeProfit.disabled.qty.activeColor": string; "takeProfit.disabled.qty.backgroundColor": string; "takeProfit.disabled.qty.dividerColor": string; "takeProfit.disabled.qty.textColor": string; "takeProfit.disabled.text.backgroundColor": string; "takeProfit.disabled.text.buttonTextColor": string; "takeProfit.disabled.text.dividerColor": string; "takeProfit.disabled.text.textColor": string; "takeProfit.disabled.text.activeColor": string; "takeProfit.disabled.text.hintAreaColor": string; "takeProfit.disabled.movingBackgroundColor": string; "stopLoss.normal.anchor.backgroundColor": string; "stopLoss.normal.anchor.borderColor": string; "stopLoss.normal.anchor.shadowColor": string; "stopLoss.normal.borderBackgroundColor": string; "stopLoss.normal.borderColor": string; "stopLoss.normal.close.activeColor": string; "stopLoss.normal.close.backgroundColor": string; "stopLoss.normal.close.iconColor": string; "stopLoss.normal.confirm.activeColor": string; "stopLoss.normal.confirm.backgroundColor": string; "stopLoss.normal.confirm.borderColor": string; "stopLoss.normal.confirm.disableBackgroundColor": string; "stopLoss.normal.confirm.disableTextColor": string; "stopLoss.normal.confirm.textColor": string; "stopLoss.normal.disabledLineColor": string; "stopLoss.normal.informer.backgroundColor": string; "stopLoss.normal.informer.iconColor": string; "stopLoss.normal.labelTickColor": string; "stopLoss.normal.lineColor": string; "stopLoss.normal.negativePlColor": string; "stopLoss.normal.pointBackgroundColor": string; "stopLoss.normal.pointShadowColor": string; "stopLoss.normal.positivePlColor": string; "stopLoss.normal.qty.activeColor": string; "stopLoss.normal.qty.backgroundColor": string; "stopLoss.normal.qty.dividerColor": string; "stopLoss.normal.qty.textColor": string; "stopLoss.normal.text.backgroundColor": string; "stopLoss.normal.text.buttonTextColor": string; "stopLoss.normal.text.dividerColor": string; "stopLoss.normal.text.textColor": string; "stopLoss.normal.text.activeColor": string; "stopLoss.normal.text.hintAreaColor": string; "stopLoss.normal.movingBackgroundColor": string; "stopLoss.disabled.anchor.backgroundColor": string; "stopLoss.disabled.anchor.borderColor": string; "stopLoss.disabled.anchor.shadowColor": string; "stopLoss.disabled.borderBackgroundColor": string; "stopLoss.disabled.borderColor": string; "stopLoss.disabled.close.activeColor": string; "stopLoss.disabled.close.backgroundColor": string; "stopLoss.disabled.close.iconColor": string; "stopLoss.disabled.confirm.activeColor": string; "stopLoss.disabled.confirm.backgroundColor": string; "stopLoss.disabled.confirm.borderColor": string; "stopLoss.disabled.confirm.disableBackgroundColor": string; "stopLoss.disabled.confirm.disableTextColor": string; "stopLoss.disabled.confirm.textColor": string; "stopLoss.disabled.disabledLineColor": string; "stopLoss.disabled.informer.backgroundColor": string; "stopLoss.disabled.informer.iconColor": string; "stopLoss.disabled.labelTickColor": string; "stopLoss.disabled.lineColor": string; "stopLoss.disabled.negativePlColor": string; "stopLoss.disabled.pointBackgroundColor": string; "stopLoss.disabled.pointShadowColor": string; "stopLoss.disabled.positivePlColor": string; "stopLoss.disabled.qty.activeColor": string; "stopLoss.disabled.qty.backgroundColor": string; "stopLoss.disabled.qty.dividerColor": string; "stopLoss.disabled.qty.textColor": string; "stopLoss.disabled.text.backgroundColor": string; "stopLoss.disabled.text.buttonTextColor": string; "stopLoss.disabled.text.dividerColor": string; "stopLoss.disabled.text.textColor": string; "stopLoss.disabled.text.activeColor": string; "stopLoss.disabled.text.hintAreaColor": string; "stopLoss.disabled.movingBackgroundColor": string; } /** * Override properties that can be used within {@link TradingCustomization.brokerPosition} of the {@link TradingTerminalWidgetOptions.trading_customization} object. * * In a property name, "normal" indicates the line is active and visible in the UI, while "disabled" means the line is inactive, such as when another dialog is open. */ interface BrokerPositionOverrides { "buy.normal.borderBackgroundColor": string; "buy.normal.borderColor": string; "buy.normal.close.activeColor": string; "buy.normal.close.backgroundColor": string; "buy.normal.close.iconColor": string; "buy.normal.confirm.activeColor": string; "buy.normal.confirm.backgroundColor": string; "buy.normal.confirm.borderColor": string; "buy.normal.confirm.disableBackgroundColor": string; "buy.normal.confirm.disableTextColor": string; "buy.normal.confirm.textColor": string; "buy.normal.disabledLineColor": string; "buy.normal.informer.backgroundColor": string; "buy.normal.informer.iconColor": string; "buy.normal.lineColor": string; "buy.normal.negativePlColor": string; "buy.normal.pointBackgroundColor": string; "buy.normal.pointShadowColor": string; "buy.normal.positivePlColor": string; "buy.normal.qty.activeColor": string; "buy.normal.qty.backgroundColor": string; "buy.normal.qty.dividerColor": string; "buy.normal.qty.textColor": string; "buy.normal.reverse.activeColor": string; "buy.normal.reverse.backgroundColor": string; "buy.normal.reverse.borderColor": string; "buy.normal.reverse.iconColor": string; "buy.normal.text.backgroundColor": string; "buy.normal.text.dividerColor": string; "buy.normal.text.textColor": string; "buy.disabled.borderBackgroundColor": string; "buy.disabled.borderColor": string; "buy.disabled.close.activeColor": string; "buy.disabled.close.backgroundColor": string; "buy.disabled.close.iconColor": string; "buy.disabled.confirm.activeColor": string; "buy.disabled.confirm.backgroundColor": string; "buy.disabled.confirm.borderColor": string; "buy.disabled.confirm.disableBackgroundColor": string; "buy.disabled.confirm.disableTextColor": string; "buy.disabled.confirm.textColor": string; "buy.disabled.disabledLineColor": string; "buy.disabled.informer.backgroundColor": string; "buy.disabled.informer.iconColor": string; "buy.disabled.lineColor": string; "buy.disabled.negativePlColor": string; "buy.disabled.pointBackgroundColor": string; "buy.disabled.pointShadowColor": string; "buy.disabled.positivePlColor": string; "buy.disabled.qty.activeColor": string; "buy.disabled.qty.backgroundColor": string; "buy.disabled.qty.dividerColor": string; "buy.disabled.qty.textColor": string; "buy.disabled.reverse.activeColor": string; "buy.disabled.reverse.backgroundColor": string; "buy.disabled.reverse.borderColor": string; "buy.disabled.reverse.iconColor": string; "buy.disabled.text.backgroundColor": string; "buy.disabled.text.dividerColor": string; "buy.disabled.text.textColor": string; "sell.normal.borderBackgroundColor": string; "sell.normal.borderColor": string; "sell.normal.close.activeColor": string; "sell.normal.close.backgroundColor": string; "sell.normal.close.iconColor": string; "sell.normal.confirm.activeColor": string; "sell.normal.confirm.backgroundColor": string; "sell.normal.confirm.borderColor": string; "sell.normal.confirm.disableBackgroundColor": string; "sell.normal.confirm.disableTextColor": string; "sell.normal.confirm.textColor": string; "sell.normal.disabledLineColor": string; "sell.normal.informer.backgroundColor": string; "sell.normal.informer.iconColor": string; "sell.normal.lineColor": string; "sell.normal.negativePlColor": string; "sell.normal.pointBackgroundColor": string; "sell.normal.pointShadowColor": string; "sell.normal.positivePlColor": string; "sell.normal.qty.activeColor": string; "sell.normal.qty.backgroundColor": string; "sell.normal.qty.dividerColor": string; "sell.normal.qty.textColor": string; "sell.normal.reverse.activeColor": string; "sell.normal.reverse.backgroundColor": string; "sell.normal.reverse.borderColor": string; "sell.normal.reverse.iconColor": string; "sell.normal.text.backgroundColor": string; "sell.normal.text.dividerColor": string; "sell.normal.text.textColor": string; "sell.disabled.borderBackgroundColor": string; "sell.disabled.borderColor": string; "sell.disabled.close.activeColor": string; "sell.disabled.close.backgroundColor": string; "sell.disabled.close.iconColor": string; "sell.disabled.confirm.activeColor": string; "sell.disabled.confirm.backgroundColor": string; "sell.disabled.confirm.borderColor": string; "sell.disabled.confirm.disableBackgroundColor": string; "sell.disabled.confirm.disableTextColor": string; "sell.disabled.confirm.textColor": string; "sell.disabled.disabledLineColor": string; "sell.disabled.informer.backgroundColor": string; "sell.disabled.informer.iconColor": string; "sell.disabled.lineColor": string; "sell.disabled.negativePlColor": string; "sell.disabled.pointBackgroundColor": string; "sell.disabled.pointShadowColor": string; "sell.disabled.positivePlColor": string; "sell.disabled.qty.activeColor": string; "sell.disabled.qty.backgroundColor": string; "sell.disabled.qty.dividerColor": string; "sell.disabled.qty.textColor": string; "sell.disabled.reverse.activeColor": string; "sell.disabled.reverse.backgroundColor": string; "sell.disabled.reverse.borderColor": string; "sell.disabled.reverse.iconColor": string; "sell.disabled.text.backgroundColor": string; "sell.disabled.text.dividerColor": string; "sell.disabled.text.textColor": string; } interface CandleStylePreferences { /** Body color for an up candle */ upColor: string; /** Body color for a down candle */ downColor: string; /** Whether to draw the candle wick */ drawWick: boolean; /** Whether to draw the candle body border */ drawBorder: boolean; /** Whether to draw the candle body */ drawBody: boolean; /** Candle border color */ borderColor: string; /** Up candle border color */ borderUpColor: string; /** Down candle border color */ borderDownColor: string; /** Candle wick color */ wickColor: string; /** Up candle wick color */ wickUpColor: string; /** Down candle wick color */ wickDownColor: string; /** Bar color determined by previous close value */ barColorsOnPrevClose: boolean; } /** * Overrides for the 'Chaikin Money Flow' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface ChaikinMoneyFlowIndicatorOverrides { /** Default value: `#787B86` */ "zero.color": string; /** Default value: `2` */ "zero.linestyle": number; /** Default value: `1` */ "zero.linewidth": number; /** Default value: `true` */ "zero.visible": boolean; /** Default value: `0` */ "zero.value": number; /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#43A047` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Chaikin Oscillator' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface ChaikinOscillatorIndicatorOverrides { /** Default value: `#787B86` */ "zero.color": string; /** Default value: `2` */ "zero.linestyle": number; /** Default value: `1` */ "zero.linewidth": number; /** Default value: `true` */ "zero.visible": boolean; /** Default value: `0` */ "zero.value": number; /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#EC407A` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Chaikin Volatility' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface ChaikinVolatilityIndicatorOverrides { /** Default value: `#787B86` */ "zero.color": string; /** Default value: `2` */ "zero.linestyle": number; /** Default value: `1` */ "zero.linewidth": number; /** Default value: `true` */ "zero.visible": boolean; /** Default value: `0` */ "zero.value": number; /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#AB47BC` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Chande Kroll Stop' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface ChandeKrollStopIndicatorOverrides { /** Default value: `15` */ "long.display": number; /** Default value: `0` */ "long.linestyle": number; /** Default value: `1` */ "long.linewidth": number; /** Default value: `line` */ "long.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "long.trackprice": boolean; /** Default value: `0` */ "long.transparency": number; /** Default value: `#2196F3` */ "long.color": string; /** Default value: `15` */ "short.display": number; /** Default value: `0` */ "short.linestyle": number; /** Default value: `1` */ "short.linewidth": number; /** Default value: `line` */ "short.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "short.trackprice": boolean; /** Default value: `0` */ "short.transparency": number; /** Default value: `#FF6D00` */ "short.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Chande Momentum Oscillator' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface ChandeMomentumOscillatorIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } interface ChangeThemeOptions { /** Disable undo for the theme change */ disableUndo: boolean; } /** * Property overrides that can be used with {@link IChartingLibraryWidget.applyOverrides}. */ interface ChartPropertiesOverrides { /** * Override values. */ [key: string]: string | number | boolean; /** * A timezone ID. The default value depends on the locale. */ "timezone": TimezoneId; /** * A price scale selection strategy. Determines where price scales should be placed: on the left, on the right, or spread evenly (auto). * * @default 'auto' */ "priceScaleSelectionStrategyName": "left" | "right" | "auto"; /** * Pane background type. In the dark theme, the default value is 'gradient'. * * @default 'solid' */ "paneProperties.backgroundType": ColorTypes; /** * Pane background color. * * @default '#ffffff' */ "paneProperties.background": string; /** * Pane background gradient start color. * * @default '#ffffff' */ "paneProperties.backgroundGradientStartColor": string; /** * Pane background gradient end color. * * @default '#ffffff' */ "paneProperties.backgroundGradientEndColor": string; /** * Pane vertical grid color. * * @default 'rgba(42, 46, 57, 0.06)' */ "paneProperties.vertGridProperties.color": string; /** * Pane vertical grid line style. * * @default LineStyle.Solid */ "paneProperties.vertGridProperties.style": OverrideLineStyle; /** * Pane horizontal grid color. * * @default 'rgba(42, 46, 57, 0.06)' */ "paneProperties.horzGridProperties.color": string; /** * Pane horizontal grid line style. * * @default LineStyle.Solid */ "paneProperties.horzGridProperties.style": OverrideLineStyle; /** * Pane grid line mode. * * @default "both" */ "paneProperties.gridLinesMode": GridLinesMode; /** * Crosshair color. * * @default '#9598A1' */ "paneProperties.crossHairProperties.color": string; /** * Crosshair style. * * @default LineStyle.Dashed */ "paneProperties.crossHairProperties.style": OverrideLineStyle; /** * Crosshair transparency. To use this property, specify `paneProperties.crossHairProperties.color` with a **hexadecimal** value such as `#ff0000`. Otherwise, transparency is not applied. * * @default 0 */ "paneProperties.crossHairProperties.transparency": number; /** * Crosshair width. * * @default 1 */ "paneProperties.crossHairProperties.width": number; /** * Pane auto scaling top margin percentage. * * @default 10 */ "paneProperties.topMargin": number; /** * Pane auto scaling bottom margin percentage. * * @default 8 */ "paneProperties.bottomMargin": number; /** * Pane separator color. * * @default '#EBEBEB' */ "paneProperties.separatorColor": string; /** * Study legend input values visibility. * * @default true */ "paneProperties.legendProperties.showStudyArguments": boolean; /** * Study legend title visibility. * * @default true */ "paneProperties.legendProperties.showStudyTitles": boolean; /** * Toggle the visibility for all studies legend values. * * @default true */ "paneProperties.legendProperties.showStudyValues": boolean; /** * Series legend title visibility. * * @default true */ "paneProperties.legendProperties.showSeriesTitle": boolean; /** * Study legend OHLC values visibility. * * @default true */ "paneProperties.legendProperties.showSeriesOHLC": boolean; /** * Adds the ability to show daily changes in the chart legend. * * @default false */ "paneProperties.legendProperties.showLastDayChange": boolean; /** * Series legend change value visibility. * * @default true */ "paneProperties.legendProperties.showBarChange": boolean; /** * Series series legend close value visibility when on mobile. * * @default true */ "paneProperties.legendProperties.showSeriesLegendCloseOnMobile": boolean; /** * Series legend volume value visibility. * * @default false */ "paneProperties.legendProperties.showVolume": boolean; /** * Legend background visibility. * * @default true */ "paneProperties.legendProperties.showBackground": boolean; /** * Legend background transparency percentage. * * @default 50 */ "paneProperties.legendProperties.backgroundTransparency": number; /** * Scales (axis) border line color. * * @default 'rgba(42, 46, 57, 0)' */ "scalesProperties.lineColor": string; /** * Scales (axis) text color. * * @default '#131722' */ "scalesProperties.textColor": string; /** * Scales (axis) font size. * * @default 12 */ "scalesProperties.fontSize": number; /** * Series last value label visibility. * * @default true */ "scalesProperties.showSeriesLastValue": boolean; /** * Series last value label display mode. * * @default PriceAxisLastValueMode.LastValueAccordingToScale */ "scalesProperties.seriesLastValueMode": OverridePriceAxisLastValueMode; /** * Study label value label visibility. * * @default true */ "scalesProperties.showStudyLastValue": boolean; /** * Symbol name label visibility. * * @default false */ "scalesProperties.showSymbolLabels": boolean; /** * Study plot labels visibility. * * @default false */ "scalesProperties.showStudyPlotLabels": boolean; /** * Bid/ask labels visibility. * * @default false */ "scalesProperties.showBidAskLabels": boolean; /** * Pre/post market price labels visibility. * * @default true */ "scalesProperties.showPrePostMarketPriceLabel": boolean; /** * Sets the highlight color of the scales when adding a drawing. * * @default 'rgba(41, 98, 255, 0.25)' */ "scalesProperties.axisHighlightColor": string; /** * Configures the background color of a label shown on an axis scale when a drawing is selected. * * @default '#2962FF' */ "scalesProperties.axisLineToolLabelBackgroundColorCommon": string; /** * Dynamically changes the background color of all labels on the price scale when a drawing is in motion. * * @default '#143EB3' */ "scalesProperties.axisLineToolLabelBackgroundColorActive": string; /** * Price scale crosshair label visibility. * * @default true */ "scalesProperties.showPriceScaleCrosshairLabel": boolean; /** * Time scale crosshair label visibility. * * @default true */ "scalesProperties.showTimeScaleCrosshairLabel": boolean; /** * Crosshair label light theme background color. * * @default '#131722' */ "scalesProperties.crosshairLabelBgColorLight": string; /** * Crosshair label dark theme background color. * * @default '#363A45' */ "scalesProperties.crosshairLabelBgColorDark": string; /** * When enabled, autoscaling considers only the main series prices and ignores other series added with the _Compare_ button. * * @default false */ "scalesProperties.scaleSeriesOnly": boolean; /** * Main series chart style. * * @default ChartStyle.Candle */ "mainSeriesProperties.style": ChartStyle; /** * Displays the countdown to the bar closing on the price scale. Available only for [intraday](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions#resolution-in-minutes-intraday) resolutions. * * @default false */ "mainSeriesProperties.showCountdown": boolean; /** * Main series bid & ask visibility * * @default false */ "mainSeriesProperties.bidAsk.visible": boolean; /** * Style of the line for bid & ask * * @default LineStyle.Dotted */ "mainSeriesProperties.bidAsk.lineStyle": OverrideLineStyle; /** * Width of the line for bid & ask * * @default 1 */ "mainSeriesProperties.bidAsk.lineWidth": number; /** * Color line for the bid * * @default '#2962FF' */ "mainSeriesProperties.bidAsk.bidLineColor": string; /** * Color line for the ask * * @default '#F7525F' */ "mainSeriesProperties.bidAsk.askLineColor": string; /** * High/low price lines visibility. * * @default false */ "mainSeriesProperties.highLowAvgPrice.highLowPriceLinesVisible": boolean; /** * High/low price lines label visibility. * * @default false */ "mainSeriesProperties.highLowAvgPrice.highLowPriceLabelsVisible": boolean; /** * Average close price lines visibility. * * @default false */ "mainSeriesProperties.highLowAvgPrice.averageClosePriceLineVisible": boolean; /** * Average close price lines label visibility. * * @default false */ "mainSeriesProperties.highLowAvgPrice.averageClosePriceLabelVisible": boolean; /** * High/low price lines color. * * @default "" */ "mainSeriesProperties.highLowAvgPrice.highLowPriceLinesColor": string; /** * * High/low price lines width. * * @default 1 */ "mainSeriesProperties.highLowAvgPrice.highLowPriceLinesWidth": number; /** * * Average close price lines color. * * @default "" */ "mainSeriesProperties.highLowAvgPrice.averagePriceLineColor": string; /** * * Average close price lines width. * * @default 1 */ "mainSeriesProperties.highLowAvgPrice.averagePriceLineWidth": number; /** * Main series visibility. * * @default true */ "mainSeriesProperties.visible": boolean; /** * Sessions to display on the chart. Use `'extended'` to include pre- and post-market subsessions. See the [Extended Sessions](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/Extended-Sessions) guide for more info. * * @default 'regular' */ "mainSeriesProperties.sessionId": "regular" | "extended"; /** * Main series price line visibility. * * @default true */ "mainSeriesProperties.showPriceLine": boolean; /** * * Main series price line width. * * @default 1 */ "mainSeriesProperties.priceLineWidth": number; /** * Main series price line color. * * @default "" */ "mainSeriesProperties.priceLineColor": string; /** * Main series previous close price line visibility. * * @default false */ "mainSeriesProperties.showPrevClosePriceLine": boolean; /** * Main series previous close price line width. * * @default 1 */ "mainSeriesProperties.prevClosePriceLineWidth": number; /** * Main series previous close price line color. * * @default "#555555" */ "mainSeriesProperties.prevClosePriceLineColor": string; /** * Main series minimum tick behaviour. * * @default "default" * * @example * * ```javascript * // reset minTick to default * tvWidget.applyOverrides({ 'mainSeriesProperties.minTick': 'default' }); * * // Set main series minTick to { priceScale: 10000, minMove: 1, frac: false } * tvWidget.applyOverrides({ 'mainSeriesProperties.minTick': '10000,1,false' }); * * // Set default minTick for overlay studies to { priceScale: 10000, minMove: 1, frac: false } * tvWidget.applyStudiesOverrides({ 'overlay.minTick': '10000,1,false' }); * ``` */ "mainSeriesProperties.minTick": string; /** * Main series legend exchange visibility. * * @default true */ "mainSeriesProperties.statusViewStyle.showExchange": boolean; /** * Main series legend interval visibility. * * @default true */ "mainSeriesProperties.statusViewStyle.showInterval": boolean; /** * Main series legend text style. * * @default "description" */ "mainSeriesProperties.statusViewStyle.symbolTextSource": SeriesStatusViewSymbolTextSource; /** * Main series candle style up color. * * @default "#089981" */ "mainSeriesProperties.candleStyle.upColor": string; /** * Main series candle style down color. * * @default "#F23645" */ "mainSeriesProperties.candleStyle.downColor": string; /** * Main series candle style wick visibility. * * @default true */ "mainSeriesProperties.candleStyle.drawWick": boolean; /** * Main series candle style border visibility. * * @default true */ "mainSeriesProperties.candleStyle.drawBorder": boolean; /** * * Main series candle style border color. * * @default "#378658" */ "mainSeriesProperties.candleStyle.borderColor": string; /** * * Main series candle style border up color. * * @default "#089981" */ "mainSeriesProperties.candleStyle.borderUpColor": string; /** * Main series candle style border down color. * * @default "#F23645" */ "mainSeriesProperties.candleStyle.borderDownColor": string; /** * Main series candle style wick color. * * @default "#737375" */ "mainSeriesProperties.candleStyle.wickColor": string; /** * Main series candle style wick up color. * * @default "#089981" */ "mainSeriesProperties.candleStyle.wickUpColor": string; /** * Main series candle style wick down color. * * @default "#F23645" */ "mainSeriesProperties.candleStyle.wickDownColor": string; /** * * Main series candle style color on previous close behaviour. * * @default false */ "mainSeriesProperties.candleStyle.barColorsOnPrevClose": boolean; /** * Main series candle style body visibility. * * @default true */ "mainSeriesProperties.candleStyle.drawBody": boolean; /** * Main series volume candle style up color. * * @default "#089981" */ "mainSeriesProperties.volCandlesStyle.upColor": string; /** * Main series volume candle style down color. * * @default "#F23645" */ "mainSeriesProperties.volCandlesStyle.downColor": string; /** * Main series volume candle style wick visibility. * * @default true */ "mainSeriesProperties.volCandlesStyle.drawWick": boolean; /** * Main series volume candle style border visibility. * * @default true */ "mainSeriesProperties.volCandlesStyle.drawBorder": boolean; /** * * Main series volume candle style border color. * * @default "#378658" */ "mainSeriesProperties.volCandlesStyle.borderColor": string; /** * * Main series volume candle style border up color. * * @default "#089981" */ "mainSeriesProperties.volCandlesStyle.borderUpColor": string; /** * Main series volume candle style border down color. * * @default "#F23645" */ "mainSeriesProperties.volCandlesStyle.borderDownColor": string; /** * Main series volume candle style wick color. * * @default "#737375" */ "mainSeriesProperties.volCandlesStyle.wickColor": string; /** * Main series volume candle style wick up color. * * @default "#089981" */ "mainSeriesProperties.volCandlesStyle.wickUpColor": string; /** * Main series volume candle style wick down color. * * @default "#F23645" */ "mainSeriesProperties.volCandlesStyle.wickDownColor": string; /** * * Main series volume candle style color on previous close behaviour. * * @default false */ "mainSeriesProperties.volCandlesStyle.barColorsOnPrevClose": boolean; /** * Main series volume candle style body visibility. * * @default true */ "mainSeriesProperties.volCandlesStyle.drawBody": boolean; /** * Main series hollow candle style up color. * * @default "#089981" */ "mainSeriesProperties.hollowCandleStyle.upColor": string; /** * Main series hollow candle style down color. * * @default "#F23645" */ "mainSeriesProperties.hollowCandleStyle.downColor": string; /** * Main series hollow candle style wick visibility. * * @default true */ "mainSeriesProperties.hollowCandleStyle.drawWick": boolean; /** * Main series hollow candle style border visibility. * * @default true */ "mainSeriesProperties.hollowCandleStyle.drawBorder": boolean; /** * Main series hollow candle style border color. * * @default "#378658" */ "mainSeriesProperties.hollowCandleStyle.borderColor": string; /** * Main series hollow candle style border up color. * * @default "#089981" */ "mainSeriesProperties.hollowCandleStyle.borderUpColor": string; /** * Main series hollow candle style down color. * * @default "#F23645" */ "mainSeriesProperties.hollowCandleStyle.borderDownColor": string; /** * Main series hollow candle style wick color. * * @default "#737375" */ "mainSeriesProperties.hollowCandleStyle.wickColor": string; /** * Main series hollow candle style wick up color. * * @default "#089981" */ "mainSeriesProperties.hollowCandleStyle.wickUpColor": string; /** * Main series hollow candle style wick down color. * * @default "#F23645" */ "mainSeriesProperties.hollowCandleStyle.wickDownColor": string; /** * Main series hollow candle style body visibility. * * @default true */ "mainSeriesProperties.hollowCandleStyle.drawBody": boolean; /** * Main series Heikin Ashi style up color. * * @default "#089981" */ "mainSeriesProperties.haStyle.upColor": string; /** * Main series Heikin Ashi style down color. * * @default "#F23645" */ "mainSeriesProperties.haStyle.downColor": string; /** * Main series Heikin Ashi style wick visibility. * * @default true */ "mainSeriesProperties.haStyle.drawWick": boolean; /** * Main series Heikin Ashi style border visibility. * * @default true */ "mainSeriesProperties.haStyle.drawBorder": boolean; /** * Main series Heikin Ashi style border color. * * @default "#378658" */ "mainSeriesProperties.haStyle.borderColor": string; /** * Main series Heikin Ashi style border up color. * * @default "#089981" */ "mainSeriesProperties.haStyle.borderUpColor": string; /** * Main series Heikin Ashi style border down color. * * @default "#F23645" */ "mainSeriesProperties.haStyle.borderDownColor": string; /** * Main series Heikin Ashi style wick color. * * @default "#737375" */ "mainSeriesProperties.haStyle.wickColor": string; /** * Main series Heikin Ashi style wick up color. * * @default "#089981" */ "mainSeriesProperties.haStyle.wickUpColor": string; /** * Main series Heikin Ashi style wick down color. * * @default "#F23645" */ "mainSeriesProperties.haStyle.wickDownColor": string; /** * Main series Heikin Ashi style color on previous close behaviour. * * @default false */ "mainSeriesProperties.haStyle.barColorsOnPrevClose": boolean; /** * Main series Heikin Ashi style body visibility. * * @default true */ "mainSeriesProperties.haStyle.drawBody": boolean; /** * Main series bar style up color. * * @default "#089981" */ "mainSeriesProperties.barStyle.upColor": string; /** * Main series bar style down color. * * @default "#F23645" */ "mainSeriesProperties.barStyle.downColor": string; /** * Main series bar style color on previous close behaviour. * * @default false */ "mainSeriesProperties.barStyle.barColorsOnPrevClose": boolean; /** * Main series bar style don't draw open behaviour. * * @default false */ "mainSeriesProperties.barStyle.dontDrawOpen": boolean; /** * Main series bar style thin bars behaviour. * * @default true */ "mainSeriesProperties.barStyle.thinBars": boolean; /** * Main series High-low style color. * * @default "#2962FF" */ "mainSeriesProperties.hiloStyle.color": string; /** * Main series High-low style border visibility. * * @default true */ "mainSeriesProperties.hiloStyle.showBorders": boolean; /** * Main series High-low style border color. * * @default "#2962FF" */ "mainSeriesProperties.hiloStyle.borderColor": string; /** * Main series High-low style label visibility. * * @default true */ "mainSeriesProperties.hiloStyle.showLabels": boolean; /** * Main series High-low style label color. * * @default "#2962FF" */ "mainSeriesProperties.hiloStyle.labelColor": string; /** * Main series column style up color. * * @default "rgba(8, 153, 129, 0.5)" */ "mainSeriesProperties.columnStyle.upColor": string; /** * Main series column style down color. * * @default "rgba(242, 54, 69, 0.5)" */ "mainSeriesProperties.columnStyle.downColor": string; /** * Main series column style color on previous close behaviour. * * @default true */ "mainSeriesProperties.columnStyle.barColorsOnPrevClose": boolean; /** * Main series column style price source. * * @default "close" */ "mainSeriesProperties.columnStyle.priceSource": PriceSource; /** * Main series line style color. * * @default "#2962FF" */ "mainSeriesProperties.lineStyle.color": string; /** * Main series line style line style. * * @default LineStyle.Solid */ "mainSeriesProperties.lineStyle.linestyle": OverrideLineStyle; /** * Main series line style line width. * * @default 2 */ "mainSeriesProperties.lineStyle.linewidth": number; /** * Main series line style price source. * * @default "close" */ "mainSeriesProperties.lineStyle.priceSource": PriceSource; /** * Main series step line style color. * * @default "#2962FF" */ "mainSeriesProperties.steplineStyle.color": string; /** * Main series step line style line style. * * @default LineStyle.Solid */ "mainSeriesProperties.steplineStyle.linestyle": OverrideLineStyle; /** * Main series step line style line width. * * @default 2 */ "mainSeriesProperties.steplineStyle.linewidth": number; /** * Main series step line style price source. * * @default "close" */ "mainSeriesProperties.steplineStyle.priceSource": PriceSource; /** * Main series area style color1. * * @default "rgba(41, 98, 255, 0.28)" */ "mainSeriesProperties.areaStyle.color1": string; /** * Main series area style color2. * * @default "#2962FF" */ "mainSeriesProperties.areaStyle.color2": string; /** * Main series area style line color. * * @default "#2962FF" */ "mainSeriesProperties.areaStyle.linecolor": string; /** * Main series area style line style. * * @default LineStyle.Solid */ "mainSeriesProperties.areaStyle.linestyle": OverrideLineStyle; /** * Main series area style line width. * * @default 2 */ "mainSeriesProperties.areaStyle.linewidth": number; /** * Main series area style price source. * * @default "close" */ "mainSeriesProperties.areaStyle.priceSource": PriceSource; /** * Main series area style transparency. * * @default 100 */ "mainSeriesProperties.areaStyle.transparency": number; /** * Main series hlc area style close line color. * * @default "#868993" */ "mainSeriesProperties.hlcAreaStyle.closeLineColor": string; /** * Main series hlc area style close line style. * * @default LineStyle.Solid */ "mainSeriesProperties.hlcAreaStyle.closeLineStyle": OverrideLineStyle; /** * Main series hlc area style close line width. * * @default 2 */ "mainSeriesProperties.hlcAreaStyle.closeLineWidth": number; /** * Main series hlc area style close low fill color. * * @default "rgba(242, 54, 69, 0.2)" */ "mainSeriesProperties.hlcAreaStyle.closeLowFillColor": string; /** * Main series hlc area style high close fill color. * * @default "rgba(8, 153, 129, 0.2)" */ "mainSeriesProperties.hlcAreaStyle.highCloseFillColor": string; /** * Main series hlc area style high line color. * * @default "#089981" */ "mainSeriesProperties.hlcAreaStyle.highLineColor": string; /** * Main series hlc area style high line style. * * @default LineStyle.Solid */ "mainSeriesProperties.hlcAreaStyle.highLineStyle": OverrideLineStyle; /** * Main series hlc area style high line width. * * @default 2 */ "mainSeriesProperties.hlcAreaStyle.highLineWidth": number; /** * Main series hlc area style low line color. * * @default "#F23645" */ "mainSeriesProperties.hlcAreaStyle.lowLineColor": string; /** * Main series hlc area style low line style. * * @default LineStyle.Solid */ "mainSeriesProperties.hlcAreaStyle.lowLineStyle": OverrideLineStyle; /** * Main series hlc area style low line width. * * @default 2 */ "mainSeriesProperties.hlcAreaStyle.lowLineWidth": number; /** * Main series price axis percentage mode. * * @default false */ "mainSeriesProperties.priceAxisProperties.percentage": boolean; /** * Main series price axis indexed to 100 mode. * * @default false */ "mainSeriesProperties.priceAxisProperties.indexedTo100": boolean; /** * Main series price axis log mode. * * @default false */ "mainSeriesProperties.priceAxisProperties.log": boolean; /** * Main series price axis inverted mode. * * @default false */ "mainSeriesProperties.priceAxisProperties.isInverted": boolean; /** * Main series price axis label alignment behaviour. * * @default true */ "mainSeriesProperties.priceAxisProperties.alignLabels": boolean; /** * Main series Renko style up color. * * @default "#089981" */ "mainSeriesProperties.renkoStyle.upColor": string; /** * Main series Renko style down color. * * @default "#F23645" */ "mainSeriesProperties.renkoStyle.downColor": string; /** * Main series Renko style border up color. * * @default "#089981" */ "mainSeriesProperties.renkoStyle.borderUpColor": string; /** * Main series Renko style border down color. * * @default "#F23645" */ "mainSeriesProperties.renkoStyle.borderDownColor": string; /** * Main series Renko style up projection color. * * @default "#a9dcc3" */ "mainSeriesProperties.renkoStyle.upColorProjection": string; /** * Main series Renko style down projection color. * * @default "#f5a6ae" */ "mainSeriesProperties.renkoStyle.downColorProjection": string; /** * Main series Renko style up projection border color. * * @default "#a9dcc3" */ "mainSeriesProperties.renkoStyle.borderUpColorProjection": string; /** * Main series Renko style down projection border color. * * @default "#f5a6ae" */ "mainSeriesProperties.renkoStyle.borderDownColorProjection": string; /** * Main series Renko style wick up color. * * @default "#089981" */ "mainSeriesProperties.renkoStyle.wickUpColor": string; /** * Main series Renko style wick down color. * * @default "#F23645" */ "mainSeriesProperties.renkoStyle.wickDownColor": string; /** * Main series Line Break style up color. * * @default "#089981" */ "mainSeriesProperties.pbStyle.upColor": string; /** * Main series Line Break style down color. * * @default "#F23645" */ "mainSeriesProperties.pbStyle.downColor": string; /** * Main series Line Break style border up color. * * @default "#089981" */ "mainSeriesProperties.pbStyle.borderUpColor": string; /** * Main series Line Break style border down color. * * @default "#F23645" */ "mainSeriesProperties.pbStyle.borderDownColor": string; /** * Main series Line Break style up projection color. * * @default "#a9dcc3" */ "mainSeriesProperties.pbStyle.upColorProjection": string; /** * Main series Line Break style down projection color. * * @default "#f5a6ae" */ "mainSeriesProperties.pbStyle.downColorProjection": string; /** * Main series Line Break style up projection color. * * @default "#a9dcc3" */ "mainSeriesProperties.pbStyle.borderUpColorProjection": string; /** * Main series Line Break style down projection color. * * @default "#f5a6ae" */ "mainSeriesProperties.pbStyle.borderDownColorProjection": string; /** * Main series Kagi style up color. * * @default "#089981" */ "mainSeriesProperties.kagiStyle.upColor": string; /** * Main series Kagi style down color. * * @default "#F23645" */ "mainSeriesProperties.kagiStyle.downColor": string; /** * Main series Kagi style up projection color. * * @default "#a9dcc3" */ "mainSeriesProperties.kagiStyle.upColorProjection": string; /** * Main series Kagi style down projection color. * * @default "#f5a6ae" */ "mainSeriesProperties.kagiStyle.downColorProjection": string; /** * Main series Point & Figure style up color. * * @default "#089981" */ "mainSeriesProperties.pnfStyle.upColor": string; /** * Main series Point & Figure style down color. * * @default "#F23645" */ "mainSeriesProperties.pnfStyle.downColor": string; /** * Main series Point & Figure style up projection color. * * @default "#a9dcc3" */ "mainSeriesProperties.pnfStyle.upColorProjection": string; /** * Main series Point & Figure style down projection color. * * @default "#f5a6ae" */ "mainSeriesProperties.pnfStyle.downColorProjection": string; /** * Main series Baseline style baseline color. * * @default "#758696" */ "mainSeriesProperties.baselineStyle.baselineColor": string; /** * Main series Baseline style top fill color1. * * @default "rgba(8, 153, 129, 0.28)" */ "mainSeriesProperties.baselineStyle.topFillColor1": string; /** * Main series Baseline style top fill color2. * * @default "rgba(8, 153, 129, 0.05)" */ "mainSeriesProperties.baselineStyle.topFillColor2": string; /** * Main series Baseline style bottom fill color1. * * @default "rgba(242, 54, 69, 0.05)" */ "mainSeriesProperties.baselineStyle.bottomFillColor1": string; /** * Main series Baseline style bottom fill color2. * * @default "rgba(242, 54, 69, 0.28)" */ "mainSeriesProperties.baselineStyle.bottomFillColor2": string; /** * Main series Baseline style top line color. * * @default "#089981" */ "mainSeriesProperties.baselineStyle.topLineColor": string; /** * Main series Baseline style bottom line color. * * @default "#F23645" */ "mainSeriesProperties.baselineStyle.bottomLineColor": string; /** * Main series Baseline style top line width. * * @default 2 */ "mainSeriesProperties.baselineStyle.topLineWidth": number; /** * Main series Baseline style bottom line width. * * @default 2 */ "mainSeriesProperties.baselineStyle.bottomLineWidth": number; /** * Main series Baseline style price source. * * @default "close" */ "mainSeriesProperties.baselineStyle.priceSource": PriceSource; /** * Main series Baseline style transparency. * * @default 50 */ "mainSeriesProperties.baselineStyle.transparency": number; /** * Main series Baseline style base level percentage. * * @default 50 */ "mainSeriesProperties.baselineStyle.baseLevelPercentage": number; /** * Main series Line With Markers style Line Color. * * @default '#2962FF' */ "mainSeriesProperties.lineWithMarkersStyle.color": string; /** * Main series Line With Markers style Line style. * * @default LineStyle.Solid */ "mainSeriesProperties.lineWithMarkersStyle.linestyle": OverrideLineStyle; /** * Main series Line With Markers style Line width. * * @default 2 */ "mainSeriesProperties.lineWithMarkersStyle.linewidth": number; /** * Main series Line With Markers style Price Source. * * @default 'close' */ "mainSeriesProperties.lineWithMarkersStyle.priceSource": string; /** * Show positions. * * Trading Platform only */ "tradingProperties.showPositions": boolean; /** * Show profit & loss for positions. * * Trading Platform only */ "tradingProperties.positionPL.visibility": boolean; /** * Displayed unit for profit & loss for positions. * * Trading Platform only */ "tradingProperties.positionPL.display": PlDisplay; /** * Show profit & loss for brackets. * * Trading Platform only */ "tradingProperties.bracketsPL.visibility": boolean; /** * Displayed unit for profit & loss for brackets. * * Trading Platform only */ "tradingProperties.bracketsPL.display": PlDisplay; /** * Show profit & loss for brackets and positions. * * Trading Platform only */ "tradingProperties.positionAndBracketsPL": boolean; /** * Show orders. * * Trading Platform only */ "tradingProperties.showOrders": boolean; /** * Show executions. * * Trading Platform only */ "tradingProperties.showExecutions": boolean; /** * Show execution shapes. * * Trading Platform only */ "tradingProperties.showExecutionsLabels": boolean; /** * Show reverse position. * * Trading Platform only */ "tradingProperties.showReverse": boolean; /** * Extend lines to the left for positions and orders. * * Trading Platform only */ "tradingProperties.extendLeft": boolean; /** * Displayed lines length for positions and orders. * * Trading Platform only */ "tradingProperties.lineLength": number; /** * Horizontal alignment of labels on position and order lines. * * Trading Platform only */ "tradingProperties.horizontalAlignment": TradedGroupHorizontalAlignment; /** * Width of line for position and order lines. * * Trading Platform only */ "tradingProperties.lineWidth": number; /** * Style of line for position and order lines. * * Trading Platform only */ /** * Size of the volume panel. * Only works when `volume_force_overlay` featureset is disabled. * * @default PaneSize.Large */ "volumePaneSize": PaneSize; } /** * Overrides for the 'Chop Zone' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface ChopZoneIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `columns` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#000080` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Choppiness Index' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface ChoppinessIndexIndicatorOverrides { /** Default value: `#2196F3` */ "hlines background.color": string; /** Default value: `90` */ "hlines background.transparency": number; /** Default value: `true` */ "hlines background.visible": boolean; /** Default value: `#787B86` */ "upperlimit.color": string; /** Default value: `2` */ "upperlimit.linestyle": number; /** Default value: `1` */ "upperlimit.linewidth": number; /** Default value: `true` */ "upperlimit.visible": boolean; /** Default value: `61.8` */ "upperlimit.value": number; /** Default value: `#787B86` */ "lowerlimit.color": string; /** Default value: `2` */ "lowerlimit.linestyle": number; /** Default value: `1` */ "lowerlimit.linewidth": number; /** Default value: `true` */ "lowerlimit.visible": boolean; /** Default value: `38.2` */ "lowerlimit.value": number; /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } interface ClientSnapshotOptions { /** Background color */ backgroundColor: string; /** Border color */ borderColor: string; /** Font */ font: string; /** Size of font */ fontSize: number; /** Legend Mode. */ legendMode: LegendMode; /** Hide resolution */ hideResolution: boolean; /** Hide studies from Legend */ hideStudiesFromLegend: boolean; } interface ColumnStylePreferences { /** Up column color */ upColor: string; /** Down column color */ downColor: string; /** Color column based on previous close */ barColorsOnPrevClose: boolean; /** Column baseline position */ baselinePosition: ColumnStyleBaselinePosition; } /** * Overrides for the 'Commodity Channel Index' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface CommodityChannelIndexIndicatorOverrides { /** Default value: `#2196F3` */ "hlines background.color": string; /** Default value: `90` */ "hlines background.transparency": number; /** Default value: `true` */ "hlines background.visible": boolean; /** Default value: `#787B86` */ "upperlimit.color": string; /** Default value: `2` */ "upperlimit.linestyle": number; /** Default value: `1` */ "upperlimit.linewidth": number; /** Default value: `true` */ "upperlimit.visible": boolean; /** Default value: `100` */ "upperlimit.value": number; /** Default value: `#787B86` */ "lowerlimit.color": string; /** Default value: `2` */ "lowerlimit.linestyle": number; /** Default value: `1` */ "lowerlimit.linewidth": number; /** Default value: `true` */ "lowerlimit.visible": boolean; /** Default value: `-100` */ "lowerlimit.value": number; /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; /** Default value: `0` */ "smoothed ma.display": number; /** Default value: `0` */ "smoothed ma.linestyle": number; /** Default value: `1` */ "smoothed ma.linewidth": number; /** Default value: `line` */ "smoothed ma.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "smoothed ma.trackprice": boolean; /** Default value: `0` */ "smoothed ma.transparency": number; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Compare' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface CompareIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `2` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#9C27B0` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Connors RSI' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface ConnorsRSIIndicatorOverrides { /** Default value: `#2196F3` */ "hlines background.color": string; /** Default value: `90` */ "hlines background.transparency": number; /** Default value: `true` */ "hlines background.visible": boolean; /** Default value: `#787B86` */ "upperlimit.color": string; /** Default value: `2` */ "upperlimit.linestyle": number; /** Default value: `1` */ "upperlimit.linewidth": number; /** Default value: `true` */ "upperlimit.visible": boolean; /** Default value: `70` */ "upperlimit.value": number; /** Default value: `#787B86` */ "lowerlimit.color": string; /** Default value: `2` */ "lowerlimit.linestyle": number; /** Default value: `1` */ "lowerlimit.linewidth": number; /** Default value: `true` */ "lowerlimit.visible": boolean; /** Default value: `30` */ "lowerlimit.value": number; /** Default value: `15` */ "crsi.display": number; /** Default value: `0` */ "crsi.linestyle": number; /** Default value: `1` */ "crsi.linewidth": number; /** Default value: `line` */ "crsi.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "crsi.trackprice": boolean; /** Default value: `0` */ "crsi.transparency": number; /** Default value: `#2196F3` */ "crsi.color": string; [key: string]: StudyOverrideValueType; } interface ContextMenuItem { /** Position of the context menu item */ position: "top" | "bottom"; /** Text content for the context menu item */ text: string; /** Callback event when menu item is clicked */ click: EmptyCallback; } /** * Overrides for the 'Coppock Curve' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface CoppockCurveIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Correlation Coefficient' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface CorrelationCoefficientIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `area` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Correlation - Log' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface CorrelationLogIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Options for creating an anchored drawing. */ interface CreateAnchoredShapeOptions extends CreateShapeOptionsBase { /** * A drawing to create; */ shape: "anchored_text" | "anchored_note"; } interface CreateHTMLButtonOptions { /** * Alignment for the button. * @default 'left' */ align: "left" | "right"; /** * A placeholder HTMLElement will be created. */ useTradingViewStyle: false; } /** * Options for creating a multipoint drawing. */ interface CreateMultipointShapeOptions extends CreateShapeOptionsBase { /** * A drawing to create. */ shape?: Exclude; } /** * Options for creating a drawing. */ interface CreateShapeOptions extends CreateShapeOptionsBase { /** * A drawing to create. */ shape?: "arrow_up" | "arrow_down" | "flag" | "vertical_line" | "horizontal_line" | "long_position" | "short_position" | "icon" | "emoji" | "sticker" | "text" | "anchored_text" | "note" | "anchored_note"; /** * The ID of an indicator that the drawing is attached to. * For more information, refer to the [Attach drawing to indicator](https://www.tradingview.com/charting-library-docs/latest/ui_elements/drawings/drawings-api#attach-drawing-to-indicator) section. */ ownerStudyId?: EntityId; } /** * Options for creating a drawing. */ interface CreateShapeOptionsBase { /** Text for a drawing. * * For `long_positions` and `short_positions` ({@link shape}), the text is generated automatically based on the drawing's inputs and position. * Do not set this property for these drawing types as doing so will throw *Error: Value is undefined*. */ text?: string; /** Should drawing be locked */ lock?: boolean; /** * Disable/enable selecting the drawing. */ disableSelection?: boolean; /** * Disable/enable saving the drawing. */ disableSave?: boolean; /** * If `true`, users cannot cancel the drawing creation in the UI. However, users can still click the _Undo_ button to cancel previous actions. */ disableUndo?: boolean; /** * Drawing properties overrides. Refer to [Drawing Overrides](https://www.tradingview.com/charting-library-docs/latest/customization/overrides/Drawings-Overrides) for more information. */ overrides?: TOverrides; /** * Create the drawing in front of all other drawings, or behind all other drawings. */ zOrder?: "top" | "bottom"; /** * Enable/disable showing the drawing in the objects tree. */ showInObjectsTree?: boolean; /** * The ID of an indicator that the drawing is attached to. For more information, refer to the [Attach drawing to indicator](https://www.tradingview.com/charting-library-docs/latest/ui_elements/drawings/drawings-api#attach-drawing-to-indicator) section. */ ownerStudyId?: EntityId; /** * Enable/disable filling the drawing with color (if the drawing supports filling). */ filled?: boolean; /** * Specify an icon to render. Only icons from the [Drawings list](https://www.tradingview.com/charting-library-docs/latest/ui_elements/drawings/Drawings-List#icons) are supported. * Note that the value should be a **hex number**, not a string. */ icon?: number; } /** * Options for creating a study. */ interface CreateStudyOptions { /** if it is `true` then the study limit dialog will be shown if the limit is exceeded. */ checkLimit?: boolean; /** * Price scale */ priceScale?: StudyPriceScale; /** Allow the currency to be changed */ allowChangeCurrency?: boolean; /** Allow the unit to be changed */ allowChangeUnit?: boolean; /** prevents adding of the action to the undo stack */ disableUndo?: boolean; } /** * Options for creating a study template. */ interface CreateStudyTemplateOptions { /** * An optional boolean flag to include the symbol in the saved state. */ saveSymbol?: boolean; /** * An optional boolean flag to include the interval in the saved state. */ saveInterval?: boolean; } interface CreateTradingViewStyledButtonOptions { /** * Alignment for the button. * @default 'left' */ align: "left" | "right"; /** * A button with the built-in styles will be created in the header. */ useTradingViewStyle: true; /** * The text shown on the button. */ text: string; /** * The text shown on hovering the button. */ title?: string; /** * A function called when the button is clicked. */ onClick?: () => void; } /** * Crosshair move event information. */ interface CrossHairMovedEventParams { /** * The crosshair time coordinate represented with a UNIX timestamp in UTC. * You can use this property to do some calculations or retrieve additional data from the datafeed. */ time: number; /** * The price coordinate of the crosshair. */ price: number; /** * The crosshair time coordinate represented with a UNIX timestamp in the selected time zone. * You can use this property to display the crosshair time value in the UI, for example, in a tooltip or data window. */ userTime?: number; /** * Series and study values at the crosshair position. The object keys are study or series IDs, and the object value are study or series values. * The ID for the main series will always be the string `'_seriesId'`. */ entityValues?: Record; /** * X coordinate of the crosshair relative to the left edge of the element containing the library. */ offsetX?: number; /** * Y coordinate of the crosshair relative to the top edge of the element containing the library. */ offsetY?: number; } /** * Data source (a series or a study) values for a crosshair position. */ interface CrossHairMovedEventSource { /** * `true` if the source is hovered by the crosshair `false` otherwise. */ isHovered: boolean; /** * The title of the source. Matches the title shown in the data window. */ title: string; /** * The values of the source. Matches the values shown in the data window. */ values: CrossHairMovedEventSourceValue[]; } interface CrossHairMovedEventSourceValue { /** * Value title. E.g. 'open', 'high', 'change', etc. Matches the title shown in the data window. */ title: string; /** * The value formatted as a string. Matches the value shown in the data window. */ value: string; } /** * Contains information on the currency currently displayed on the [price scale](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Price-Scale). * To get a `CurrencyInfo` instance, call the {@link IPriceScaleApi.currency} method. */ interface CurrencyInfo { /** * Returns the currently selected currency for the [price scale](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Price-Scale). Returns `null` if there are several different currencies on the scale. */ selectedCurrency: string | null; /** * Original currencies for the price scale. */ originalCurrencies: string[]; /** * Available currencies for the price scale provided by the datafeed. */ currencies: string[]; /** * Symbols on the price scale */ symbols: string[]; } interface CurrencyItem { /** Unique ID */ id: string; /** Currency code. @example `USD` */ code: string; /** URL to an image of the currency. SVG logos are preferable, but please make sure that the provided image fits nicely in the currency select control (for raster images the expected size is 24x24px). */ logoUrl?: string; /** Description for the currency */ description?: string; } interface CustomIndicator { /** Your study name, it will be used internally by the library */ readonly name: string; /** * The metainfo field is designed to contain the main info about the custom study. * * Refer to [Custom Studies Metainfo](https://www.tradingview.com/charting-library-docs/latest/custom_studies/metainfo/) for more information. */ readonly metainfo: StudyMetaInfo; /** * The field should contain an ES5 constructor function. The library applies the `new` operator to the constructor to create an instance of the custom indicator. * The constructor contains the mandatory `main` method and the optional `init` method. * Once the indicator instance is created, the library calls `init` (if exists) and `main` sequentially with empty context to collect information about all variables. * * Refer to the [Constructor](https://www.tradingview.com/charting-library-docs/latest/custom_studies/custom-indicator-constructor) article for more information. */ readonly constructor: LibraryPineStudyConstructor | ((this: LibraryPineStudy) => void); } /** * Action link to be displayed at the end of the section for the * status item in the pop-up tooltip. */ interface CustomStatusDropDownAction { /** * Text to be displayed as the link */ text: string; /** * Tooltip text to be displayed when the user hovers over * the action link. */ tooltip?: string; /** * Callback function to be executed when the user clicks * on the action. */ onClick: () => void; } /** * Specifies the content to be displayed within a section of * the pop-up tooltip which is displayed when a user clicks on * the symbol status items. * * The pop-up tooltip should be used to display additional * information related to the status item. */ interface CustomStatusDropDownContent { /** * Title to be displayed next to the icon for this section * of the pop-up tooltip. */ title: string; /** * Color to be used for the icon and title. If unspecified * then the color from the status item will be used. */ color?: string; /** * Icon to be displayed next to the title for this section * of the pop-up tooltip. If unspecified then the icon from * the status item will be used. */ icon?: string; /** * Content to the displayed within this section of the * pop-up tooltip. * * **It is essential to protect the content you provide * against cross-site scripting (XSS) attacks, as these * strings will be interpreted as HTML markup.** */ content: string[]; /** * Optional action link to be displayed at the bottom of * the status section. */ action?: CustomStatusDropDownAction; } /** * Custom colors to override either the default light or dark theme. */ interface CustomThemeColors { /** * Replaces the TradingView blue color. */ color1: ColorGradient; /** * Replaces the TradingView grey color. */ color2: ColorGradient; /** * Replaces the TradingView red color. */ color3: ColorGradient; /** * Replaces the TradingView green color. */ color4: ColorGradient; /** * Replaces the TradingView orange color. */ color5: ColorGradient; /** * Replaces the TradingView purple color. */ color6: ColorGradient; /** * Replaces the TradingView yellow color. */ color7: ColorGradient; white: string; black: string; } /** * Custom color palettes for the light and dark themes. */ interface CustomThemes { light: CustomThemeColors; dark: CustomThemeColors; } /** * Depth of Market (Order Book) Data */ interface DOMData { /** * Whether the Depth of Market data is a snapshot (has the full set of depth data). * - If `true` then the data contains the full set of depth data. * - If `false` then data only contains updated levels. */ snapshot: boolean; /** Ask order levels (must be sorted by `price` in ascending order) */ asks: DOMLevel[]; /** Bid order levels (must be sorted by `price` in ascending order) */ bids: DOMLevel[]; } /** * Depth of Market Level */ interface DOMLevel { /** Price for DOM level */ price: number; /** Volume for DOM level */ volume: number; } /** * Datafeed configuration data. * Pass the resulting array of properties as a parameter to {@link OnReadyCallback} of the [`onReady`](https://www.tradingview.com/charting-library-docs/latest/connecting_data/datafeed-api/required-methods#onready) method. */ interface DatafeedConfiguration { /** * List of exchange descriptors. * An empty array leads to an absence of the exchanges filter in the Symbol Search list. * Use `value=''` if you wish to include all exchanges. */ exchanges?: Exchange[]; /** * List of [resolutions](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions) that the chart should support. * Each item of the array is expected to be a string that has a specific [format](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Resolution#resolution-format). * If you set this property to `undefined` or an empty array, the _Resolution_ drop-down menu displays the list of resolutions available for * the current symbol ({@link LibrarySymbolInfo.supported_resolutions}). * * @example * `["1", "15", "240", "D", "6M"]` will give you "1 minute, 15 minutes, 4 hours, 1 day, 6 months" in the _Resolution_ drop-down menu. */ supported_resolutions?: ResolutionString[]; /** * Supported unit groups. Each group can have several unit objects. * * @example * ```javascript * { * weight: [ * { id: 'kg', name: 'kg', description: 'Kilograms' }, * { id: 'lb', name: 'lb', description: 'Pounds'}, * ] * } * ``` */ units?: Record; /** * Supported currencies for currency conversion. * * When a currency code is supplied as a string then the library will automatically convert it to `{ id: value, code: value }` object. * * @example `["USD", "EUR", "GBP"]` * @example `[{ id: "USD", code: "USD", description: "$" }, { id: "EUR", code: "EUR", description: "€" }]` */ currency_codes?: (string | CurrencyItem)[]; /** Does the datafeed supports marks on bars (`true`), or not (`false | undefined`). */ supports_marks?: boolean; /** Set this one to `true` if your datafeed provides server time (unix time). It is used to adjust Countdown on the Price scale. */ supports_time?: boolean; /** Does the datafeed supports marks on the timescale (`true`), or not (`false | undefined`). */ supports_timescale_marks?: boolean; /** * List of filter descriptors. * * Setting this property to `undefined` or an empty array leads to the absence of filter types in Symbol Search list. Use `value = ''` if you wish to include all filter types. * `value` within the descriptor will be passed as `symbolType` argument to {@link IDatafeedChartApi.searchSymbols} */ symbols_types?: DatafeedSymbolType[]; /** * Set it if you want to group symbols in the [Symbol Search](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Symbol-Search). * Represents an object where keys are symbol types {@link SymbolType} and values are regular expressions (each regular expression should divide an instrument name into 2 parts: a root and an expiration). * * Sample: * ``` * { * "futures": `/^(.+)([12]!|[FGHJKMNQUVXZ]\d{1,2})$/`, * "stock": `/^(.+)([12]!|[FGHJKMNQUVXZ]\d{1,2})$/`, * } * ``` * It will be applied to the instruments with futures and stock as a type. * Refer to [Symbol grouping](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Symbol-Search#symbol-grouping) for more information. */ symbols_grouping?: Record; } interface DatafeedSymbolType { /** Name of the symbol type */ name: string; /** Value to be passed as the `symbolType` argument to `searchSymbols` */ value: string; } /** * Overrides for the 'Detrended Price Oscillator' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface DetrendedPriceOscillatorIndicatorOverrides { /** Default value: `#787B86` */ "zero.color": string; /** Default value: `2` */ "zero.linestyle": number; /** Default value: `1` */ "zero.linewidth": number; /** Default value: `true` */ "zero.visible": boolean; /** Default value: `0` */ "zero.value": number; /** Default value: `15` */ "dpo.display": number; /** Default value: `0` */ "dpo.linestyle": number; /** Default value: `1` */ "dpo.linewidth": number; /** Default value: `line` */ "dpo.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "dpo.trackprice": boolean; /** Default value: `0` */ "dpo.transparency": number; /** Default value: `#43A047` */ "dpo.color": string; [key: string]: StudyOverrideValueType; } interface DialogParams { /** Dialog title */ title: string; /** Dialog content */ body: string; /** Callback */ callback: CallbackType; } /** * Overrides for the 'Directional Movement' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface DirectionalMovementIndicatorOverrides { /** Default value: `15` */ "+di.display": number; /** Default value: `0` */ "+di.linestyle": number; /** Default value: `1` */ "+di.linewidth": number; /** Default value: `line` */ "+di.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "+di.trackprice": boolean; /** Default value: `0` */ "+di.transparency": number; /** Default value: `#2196F3` */ "+di.color": string; /** Default value: `15` */ "-di.display": number; /** Default value: `0` */ "-di.linestyle": number; /** Default value: `1` */ "-di.linewidth": number; /** Default value: `line` */ "-di.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "-di.trackprice": boolean; /** Default value: `0` */ "-di.transparency": number; /** Default value: `#FF6D00` */ "-di.color": string; /** Default value: `15` */ "adx.display": number; /** Default value: `0` */ "adx.linestyle": number; /** Default value: `1` */ "adx.linewidth": number; /** Default value: `line` */ "adx.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "adx.trackprice": boolean; /** Default value: `0` */ "adx.transparency": number; /** Default value: `#F50057` */ "adx.color": string; /** Default value: `15` */ "dx.display": number; /** Default value: `0` */ "dx.linestyle": number; /** Default value: `1` */ "dx.linewidth": number; /** Default value: `line` */ "dx.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "dx.trackprice": boolean; /** Default value: `0` */ "dx.transparency": number; /** Default value: `#FFA726` */ "dx.color": string; /** Default value: `15` */ "adxr.display": number; /** Default value: `0` */ "adxr.linestyle": number; /** Default value: `1` */ "adxr.linewidth": number; /** Default value: `line` */ "adxr.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "adxr.trackprice": boolean; /** Default value: `0` */ "adxr.transparency": number; /** Default value: `#ab47bc` */ "adxr.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Donchian Channels' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface DonchianChannelsIndicatorOverrides { /** Default value: `#2196F3` */ "plots background.color": string; /** Default value: `95` */ "plots background.transparency": number; /** Default value: `true` */ "plots background.visible": boolean; /** Default value: `15` */ "lower.display": number; /** Default value: `0` */ "lower.linestyle": number; /** Default value: `1` */ "lower.linewidth": number; /** Default value: `line` */ "lower.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "lower.trackprice": boolean; /** Default value: `0` */ "lower.transparency": number; /** Default value: `#2196F3` */ "lower.color": string; /** Default value: `15` */ "upper.display": number; /** Default value: `0` */ "upper.linestyle": number; /** Default value: `1` */ "upper.linewidth": number; /** Default value: `line` */ "upper.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "upper.trackprice": boolean; /** Default value: `0` */ "upper.transparency": number; /** Default value: `#2196F3` */ "upper.color": string; /** Default value: `15` */ "basis.display": number; /** Default value: `0` */ "basis.linestyle": number; /** Default value: `1` */ "basis.linewidth": number; /** Default value: `line` */ "basis.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "basis.trackprice": boolean; /** Default value: `0` */ "basis.transparency": number; /** Default value: `#FF6D00` */ "basis.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Double EMA' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface DoubleEMAIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#43A047` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Drag start parameters */ interface DragStartParams { /** * Prevent default drag event */ preventDefault: () => void; /** * Hovered source ID */ hoveredSourceId: EntityId | null; /** * Export data function */ exportData: (exportOptions: Partial) => void; /** * Set data function */ setData: (format: string, data: string) => void; /** * Set drag image */ setDragImage: (image: HTMLElement, xOffset: number, yOffset: number) => void; /** * Keys currently being pressed when the `dragstart` event occurred. */ keys: { ctrlKey: boolean; metaKey: boolean; altKey: boolean; shiftKey: boolean; }; } /** Item within a dropdown menu */ interface DropdownItem { /** Title of the menu item */ title: string; /** Icons for the menu item (SVG mark-up) */ icon?: string; /** Callback for when the item is selected by the user */ onSelect: () => void; } /** Parameters for configuring a dropdown menu */ interface DropdownParams { /** Title for the dropdown menu */ title: string; /** Menu items */ items: DropdownItem[]; /** Dropdown menu tooltip */ tooltip?: string; /** Icons for the dropdown menu. (SVG mark-up) */ icon?: string; /** Alignment of the dropdown menu */ align?: "right" | "left"; } /** * Overrides for the 'EMA Cross' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface EMACrossIndicatorOverrides { /** Default value: `15` */ "short:plot.display": number; /** Default value: `0` */ "short:plot.linestyle": number; /** Default value: `1` */ "short:plot.linewidth": number; /** Default value: `line` */ "short:plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "short:plot.trackprice": boolean; /** Default value: `0` */ "short:plot.transparency": number; /** Default value: `#FF6D00` */ "short:plot.color": string; /** Default value: `15` */ "long:plot.display": number; /** Default value: `0` */ "long:plot.linestyle": number; /** Default value: `1` */ "long:plot.linewidth": number; /** Default value: `line` */ "long:plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "long:plot.trackprice": boolean; /** Default value: `0` */ "long:plot.transparency": number; /** Default value: `#43A047` */ "long:plot.color": string; /** Default value: `15` */ "crosses.display": number; /** Default value: `0` */ "crosses.linestyle": number; /** Default value: `4` */ "crosses.linewidth": number; /** Default value: `cross` */ "crosses.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "crosses.trackprice": boolean; /** Default value: `0` */ "crosses.transparency": number; /** Default value: `#2196F3` */ "crosses.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Ease Of Movement' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface EaseOfMovementIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#43A047` */ "plot.color": string; [key: string]: StudyOverrideValueType; } interface EditObjectDialogEventParams { /** Dialog type */ objectType: EditObjectDialogObjectType; /** Title of the object described within the dialog */ scriptTitle: string; } /** * Overrides for the 'Elder's Force Index' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface EldersForceIndexIndicatorOverrides { /** Default value: `#787B86` */ "zero.color": string; /** Default value: `2` */ "zero.linestyle": number; /** Default value: `1` */ "zero.linewidth": number; /** Default value: `true` */ "zero.visible": boolean; /** Default value: `0` */ "zero.value": number; /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#F23645` */ "plot.color": string; [key: string]: StudyOverrideValueType; } interface EmojiOptions { /** Emoji */ emoji: string; } interface EntityInfo { /** Entity id (string) */ id: EntityId; /** Name of entity */ name: string; } /** * Overrides for the 'Envelopes' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface EnvelopesIndicatorOverrides { /** Default value: `#2196F3` */ "plots background.color": string; /** Default value: `95` */ "plots background.transparency": number; /** Default value: `true` */ "plots background.visible": boolean; /** Default value: `15` */ "average.display": number; /** Default value: `0` */ "average.linestyle": number; /** Default value: `1` */ "average.linewidth": number; /** Default value: `line` */ "average.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "average.trackprice": boolean; /** Default value: `0` */ "average.transparency": number; /** Default value: `#FF6D00` */ "average.color": string; /** Default value: `15` */ "upper.display": number; /** Default value: `0` */ "upper.linestyle": number; /** Default value: `1` */ "upper.linewidth": number; /** Default value: `line` */ "upper.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "upper.trackprice": boolean; /** Default value: `0` */ "upper.transparency": number; /** Default value: `#2196F3` */ "upper.color": string; /** Default value: `15` */ "lower.display": number; /** Default value: `0` */ "lower.linestyle": number; /** Default value: `1` */ "lower.linewidth": number; /** Default value: `line` */ "lower.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "lower.trackprice": boolean; /** Default value: `0` */ "lower.transparency": number; /** Default value: `#2196F3` */ "lower.color": string; [key: string]: StudyOverrideValueType; } interface ErrorFormatterParseResult extends FormatterParseResult { /** Optional message when there's an error while parsing */ error?: string; /** @inheritDoc */ res: false; } /** Exchange Description */ interface Exchange { /** Value to be passed as the `exchange` argument to `searchSymbols` */ value: string; /** Name of the exchange */ name: string; /** Description of the exchange */ desc: string; } interface ExportDataOptions { /** * Optional timestamp of the first exported bar. */ from?: number; /** * Optional timestamp of the last exported bar. */ to?: number; /** * If true then each exported data item will include a time value. * * @default true */ includeTime?: boolean; /** * If true then each exported data item will include a user time value. * User time is the time that user sees on the chart. * This time depends on the selected time zone and resolution. * * @default false */ includeUserTime?: boolean; /** * If true then the exported data will include open, high, low, close values from the main series. * * @default true */ includeSeries?: boolean; /** * If true then the exported data will include formatted value as displayed to the user. * * @default false */ includeDisplayedValues?: boolean; /** * If true then each exported data item will include a value for the specified studies. */ includedStudies: readonly string[] | "all"; /** * Include study data that has a positive offset from the main series data. That is study data that is "to the right of" the last main series data point. */ includeOffsetStudyValues?: boolean; /** * Include open, high, low, and close values for plots that only display a single value on the chart. For example line series or symbols with visible_plot_set = 'c'. */ includeOHLCValuesForSingleValuePlots?: boolean; /** * Include hidden studies in the exported data. * * @default false */ includeHiddenStudies?: boolean; } /** * Export data from the chart */ interface ExportedData { /** An array of {@link FieldDescriptor} */ schema: FieldDescriptor[]; /** Array of the same length as `schema` that represents the associated field's item */ data: Float64Array[]; /** Array of strings that represents the display value of the associated field element */ displayedData: string[][]; } /** * Overrides for the '52 Week High/Low' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface FiftyTwoWeekHighLowIndicatorOverrides { [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Fisher Transform' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface FisherTransformIndicatorOverrides { /** Default value: `#E91E63` */ "level:band.color": string; /** Default value: `2` */ "level:band.linestyle": number; /** Default value: `1` */ "level:band.linewidth": number; /** Default value: `true` */ "level:band.visible": boolean; /** Default value: `-1.5` */ "level:band.value": number; /** Default value: `15` */ "fisher.display": number; /** Default value: `0` */ "fisher.linestyle": number; /** Default value: `1` */ "fisher.linewidth": number; /** Default value: `line` */ "fisher.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "fisher.trackprice": boolean; /** Default value: `0` */ "fisher.transparency": number; /** Default value: `#2196F3` */ "fisher.color": string; /** Default value: `15` */ "trigger.display": number; /** Default value: `0` */ "trigger.linestyle": number; /** Default value: `1` */ "trigger.linewidth": number; /** Default value: `line` */ "trigger.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "trigger.trackprice": boolean; /** Default value: `0` */ "trigger.transparency": number; /** Default value: `#FF6D00` */ "trigger.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Fixed Range' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface FixedRangeIndicatorOverrides { /** Default value: `undefined` */ "developing poc.color": string; /** Default value: `0` */ "developing poc.linestyle": number; /** Default value: `1` */ "developing poc.linewidth": number; /** Default value: `step_line` */ "developing poc.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "developing poc.trackprice": boolean; /** Default value: `0` */ "developing poc.transparency": number; /** Default value: `0` */ "developing poc.display": number; /** Default value: `undefined` */ "developing va high.color": string; /** Default value: `0` */ "developing va high.linestyle": number; /** Default value: `1` */ "developing va high.linewidth": number; /** Default value: `step_line` */ "developing va high.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "developing va high.trackprice": boolean; /** Default value: `0` */ "developing va high.transparency": number; /** Default value: `0` */ "developing va high.display": number; /** Default value: `undefined` */ "developing va low.color": string; /** Default value: `0` */ "developing va low.linestyle": number; /** Default value: `1` */ "developing va low.linewidth": number; /** Default value: `step_line` */ "developing va low.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "developing va low.trackprice": boolean; /** Default value: `0` */ "developing va low.transparency": number; /** Default value: `0` */ "developing va low.display": number; [key: string]: StudyOverrideValueType; } /** * Format options */ interface FormatterFormatOptions { /** * Ignore locale number format settings like decimal/thousands separators */ ignoreLocaleNumberFormat?: boolean; } /** * Format options */ interface FormatterParseOptions { /** * Ignore locale number format settings like decimal/thousands separators */ ignoreLocaleNumberFormat?: boolean; } interface FormatterParseResult { /** Returns if the formatter support parsing */ res: boolean; } interface GrayedObject { /** Type for grayed object */ type: "drawing" | "study"; /** Name of grayed object */ name: string; } /** * Overrides for the 'Guppy Multiple Moving Average' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface GuppyMultipleMovingAverageIndicatorOverrides { /** Default value: `15` */ "trader ema 1.display": number; /** Default value: `#00FFFF` */ "trader ema 1.color": string; /** Default value: `0` */ "trader ema 1.linestyle": number; /** Default value: `1` */ "trader ema 1.linewidth": number; /** Default value: `line` */ "trader ema 1.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "trader ema 1.trackprice": boolean; /** Default value: `15` */ "trader ema 1.transparency": number; /** Default value: `15` */ "trader ema 2.display": number; /** Default value: `#00FFFF` */ "trader ema 2.color": string; /** Default value: `0` */ "trader ema 2.linestyle": number; /** Default value: `1` */ "trader ema 2.linewidth": number; /** Default value: `line` */ "trader ema 2.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "trader ema 2.trackprice": boolean; /** Default value: `12` */ "trader ema 2.transparency": number; /** Default value: `15` */ "trader ema 3.display": number; /** Default value: `#00FFFF` */ "trader ema 3.color": string; /** Default value: `0` */ "trader ema 3.linestyle": number; /** Default value: `1` */ "trader ema 3.linewidth": number; /** Default value: `line` */ "trader ema 3.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "trader ema 3.trackprice": boolean; /** Default value: `9` */ "trader ema 3.transparency": number; /** Default value: `15` */ "trader ema 4.display": number; /** Default value: `#00FFFF` */ "trader ema 4.color": string; /** Default value: `0` */ "trader ema 4.linestyle": number; /** Default value: `1` */ "trader ema 4.linewidth": number; /** Default value: `line` */ "trader ema 4.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "trader ema 4.trackprice": boolean; /** Default value: `6` */ "trader ema 4.transparency": number; /** Default value: `15` */ "trader ema 5.display": number; /** Default value: `#00FFFF` */ "trader ema 5.color": string; /** Default value: `0` */ "trader ema 5.linestyle": number; /** Default value: `1` */ "trader ema 5.linewidth": number; /** Default value: `line` */ "trader ema 5.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "trader ema 5.trackprice": boolean; /** Default value: `3` */ "trader ema 5.transparency": number; /** Default value: `15` */ "trader ema 6.display": number; /** Default value: `#00FFFF` */ "trader ema 6.color": string; /** Default value: `0` */ "trader ema 6.linestyle": number; /** Default value: `1` */ "trader ema 6.linewidth": number; /** Default value: `line` */ "trader ema 6.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "trader ema 6.trackprice": boolean; /** Default value: `0` */ "trader ema 6.transparency": number; /** Default value: `15` */ "investor ema 1.display": number; /** Default value: `#FF0000` */ "investor ema 1.color": string; /** Default value: `0` */ "investor ema 1.linestyle": number; /** Default value: `1` */ "investor ema 1.linewidth": number; /** Default value: `line` */ "investor ema 1.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "investor ema 1.trackprice": boolean; /** Default value: `15` */ "investor ema 1.transparency": number; /** Default value: `15` */ "investor ema 2.display": number; /** Default value: `#FF0000` */ "investor ema 2.color": string; /** Default value: `0` */ "investor ema 2.linestyle": number; /** Default value: `1` */ "investor ema 2.linewidth": number; /** Default value: `line` */ "investor ema 2.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "investor ema 2.trackprice": boolean; /** Default value: `12` */ "investor ema 2.transparency": number; /** Default value: `15` */ "investor ema 3.display": number; /** Default value: `#FF0000` */ "investor ema 3.color": string; /** Default value: `0` */ "investor ema 3.linestyle": number; /** Default value: `1` */ "investor ema 3.linewidth": number; /** Default value: `line` */ "investor ema 3.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "investor ema 3.trackprice": boolean; /** Default value: `9` */ "investor ema 3.transparency": number; /** Default value: `15` */ "investor ema 4.display": number; /** Default value: `#FF0000` */ "investor ema 4.color": string; /** Default value: `0` */ "investor ema 4.linestyle": number; /** Default value: `1` */ "investor ema 4.linewidth": number; /** Default value: `line` */ "investor ema 4.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "investor ema 4.trackprice": boolean; /** Default value: `6` */ "investor ema 4.transparency": number; /** Default value: `15` */ "investor ema 5.display": number; /** Default value: `#FF0000` */ "investor ema 5.color": string; /** Default value: `0` */ "investor ema 5.linestyle": number; /** Default value: `1` */ "investor ema 5.linewidth": number; /** Default value: `line` */ "investor ema 5.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "investor ema 5.trackprice": boolean; /** Default value: `3` */ "investor ema 5.transparency": number; /** Default value: `15` */ "investor ema 6.display": number; /** Default value: `#FF0000` */ "investor ema 6.color": string; /** Default value: `0` */ "investor ema 6.linestyle": number; /** Default value: `1` */ "investor ema 6.linewidth": number; /** Default value: `line` */ "investor ema 6.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "investor ema 6.trackprice": boolean; /** Default value: `0` */ "investor ema 6.transparency": number; [key: string]: StudyOverrideValueType; } /** Histogram Preferences */ interface HHistPreferences { /** * Colors for the histogram up and down bars. * Example: * ```js * colors: ['#1592e6', '#fbc123'] * ``` */ colors: string[]; /** Transparency values for the histogram */ transparencies: number[]; /** Should the histogram be visible */ visible: boolean; /** Percentage width of the chart for which the histogram should occupy */ percentWidth: number; /** Should the values be shown */ showValues: boolean; /** Color for values shown */ valuesColor: string; /** * Direction of the histogram. * Whether the histogram will be shown on the left or right edge of the chart */ direction: HHistDirection; } interface HLCAreaStylePreferences { highLineVisible: boolean; /** High line color */ highLineColor: string; /** High line style */ highLineStyle: number; /** High line width */ highLineWidth: number; lowLineVisible: boolean; /** Low line color */ lowLineColor: string; /** Low line style */ lowLineStyle: number; /** Low line width */ lowLineWidth: number; /** Close line color */ closeLineColor: string; /** Close line style */ closeLineStyle: number; /** Close line width */ closeLineWidth: number; /** Fill color of area between high and close lines */ highCloseFillColor: string; /** Fill color of area between close and low lines */ closeLowFillColor: string; } interface HLCBarsStylePreferences { /** Bar color */ color: string; /** Draw thin bars. Default - `true` */ thinBars: boolean; } interface HeikinAshiStylePreferences { /** Body color for an up candle */ upColor: string; /** Body color for down candle */ downColor: string; /** Whether to draw the candle wick */ drawWick: boolean; /** Whether to draw the candle border */ drawBorder: boolean; /** Whether to draw the candle body */ drawBody: boolean; /** Candle border color */ borderColor: string; /** Up candle border color */ borderUpColor: string; /** Down candle border color */ borderDownColor: string; /** Candle wick color */ wickColor: string; /** Up candle wick color */ wickUpColor: string; /** Down candle wick color */ wickDownColor: string; /** Show real last price */ showRealLastPrice: boolean; /** Color bars based on previous close value */ barColorsOnPrevClose: boolean; } interface HiLoStylePreferences { /** Color for Hi Lo chart */ color: string; /** Show borders. Default - `false` */ showBorders: boolean; /** Border Color */ borderColor: string; /** Show Labels. Default - `false` */ showLabels: boolean; /** Label color */ labelColor: string; /** Draw body. Default - `true` */ drawBody: boolean; } /** * Overrides for the 'Historical Volatility' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface HistoricalVolatilityIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Information passed to `onHistoryCallback` for getBars. */ interface HistoryMetadata { /** * Optional value indicating to the library that there is no more data on the server. */ noData?: boolean; /** * The time of the next available bar in history. The time value should be represented with a Unix timestamp in milliseconds. * * You can pass the `nextTime` value to the library if there is no data in the time range that the library requests. * Therefore, you notify the library about available data before the requested range and ensure that the next data request is for the right range. * For more information, refer to the [How nextTime works](https://www.tradingview.com/charting-library-docs/latest/connecting_data/UDF#how-nexttime-works) section. */ nextTime?: number | null; } interface HollowCandleStylePreferences { /** Body color for an up candle */ upColor: string; /** Body color for a down candle */ downColor: string; /** Whether to draw the candle wick */ drawWick: boolean; /** Whether to draw the candle body border */ drawBorder: boolean; /** Whether to draw the candle body */ drawBody: boolean; /** Candle border color */ borderColor: string; /** Up candle border color */ borderUpColor: string; /** Down candle border color */ borderDownColor: string; /** Candle wick color */ wickColor: string; /** Up candle wick color */ wickUpColor: string; /** Down candle wick color */ wickDownColor: string; } /** * Horizontal Line Preferences */ interface HorizLinePreferences { /** Is visible if set to `true` */ visible: boolean; /** Width of the horizontal line */ width: number; /** Color of the horizontal line */ color: string; /** Line style */ style: LineStyle; /** Show price if set to `true` */ showPrice?: boolean; } /** * Overrides for the 'Hull Moving Average' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface HullMovingAverageIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } interface IBoxedValue extends IBoxedValueReadOnly { /** * Set boxed value * @param {T} value - value to be set */ setValue(value: T): void; } interface IBoxedValueReadOnly { /** Value */ value(): T; } /** * The main chart API. * * This interface can be retrieved by using the following widget ({@link IChartingLibraryWidget}) methods: * - `chart` ({@link IChartingLibraryWidget.chart}) * - `activeChart` ({@link IChartingLibraryWidget.activeChart}) */ interface IChartWidgetApi { /** * Get a subscription object for new data being loaded for the chart. * * **Example** * ```javascript * widget.activeChart().onDataLoaded().subscribe( * null, * () => console.log('New history bars are loaded'), * true * ); * ``` * @returns A subscription object for new data loaded for the chart. */ onDataLoaded(): ISubscription<() => void>; /** * Get a subscription object for the chart symbol changing. * * **Example** * ```javascript * widget.activeChart().onSymbolChanged().subscribe(null, () => console.log('The symbol is changed')); * ``` * @returns A subscription object for when a symbol is resolved (ie changing resolution, timeframe, currency, etc.) */ onSymbolChanged(): ISubscription<(symbol: LibrarySymbolInfo) => void>; /** * Get a subscription object for the chart resolution (interval) changing. This method also allows you to track whether the chart's [date range](https://www.tradingview.com/charting-library-docs/latest/getting_started/glossary#date-range) is changed. * The `timeframe` argument represents if a user clicks on the [time frame toolbar](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Time-Scale#time-frame-toolbar) or changes the date range manually. * If `timeframe` is `undefined`, you can change a date range before data loading starts. * To do this, you can specify a time frame value or a certain date range. * * **Examples** * * The following code sample specifies a time frame value: * * ```javascript * widget.activeChart().onIntervalChanged().subscribe(null, (interval, timeframeObj) => * timeframeObj.timeframe = { * value: "12M", * type: "period-back" * }); * ``` * * The following code sample specifies a certain date range: * * ```javascript * widget.activeChart().onIntervalChanged().subscribe(null, (interval, timeframeObj) => * timeframeObj.timeframe = { * from: new Date('2015-01-01').getTime() / 1000, * to: new Date('2017-01-01').getTime() / 1000, * type: "time-range" * }); * ``` * @returns A subscription object for the chart interval (resolution) changing. */ onIntervalChanged(): ISubscription<(interval: ResolutionString, timeFrameParameters: { timeframe?: TimeFrameValue; }) => void>; /** * Get a subscription object for the chart's visible range changing. * * **Example** * ```javascript * widget.activeChart().onVisibleRangeChanged().subscribe( * null, * ({ from, to }) => console.log(from, to) * ); * ``` * @returns A subscription object for the chart's visible range changing. */ onVisibleRangeChanged(): ISubscription<(range: VisibleTimeRange) => void>; /** * Get a subscription object for the chart type changing. * * **Example** * ```javascript * widget.activeChart().onChartTypeChanged().subscribe( * null, * (chartType) => console.log('The type of chart is changed') * ); * ``` * @returns A subscription object for the chart type changing. */ onChartTypeChanged(): ISubscription<(chartType: SeriesType) => void>; /** * Provide a callback function that will be called when chart data is loaded. * If chart data is already loaded when this method is called, the callback is called immediately. * * **Example** * ```javascript * widget.activeChart().dataReady(() => { * // ... * } * ``` * * @param callback A callback function called when chart data is loaded. */ dataReady(callback?: () => void): boolean; /** * Get a subscription object for the crosshair moving over the chart. * * **Example** * ```javascript * widget.activeChart().crossHairMoved().subscribe( * null, * ({ time, price }) => console.log(time, price) * ); * ``` * @returns A subscription object for the crosshair moving over the chart. */ crossHairMoved(): ISubscription<(params: CrossHairMovedEventParams) => void>; /** * Get a subscription object for the ID of the study or series hovered by the crosshair. * * @returns A subscription object for the ID of the study or series hovered by the crosshair. Subscribers will be called with `null` if there is no study or series hovered. */ onHoveredSourceChanged(): ISubscription<(sourceId: EntityId) => void>; /** * Allows you to display a certain time range on the chart. * * **Example** * ```javascript * widget.activeChart().setVisibleRange( * { from: 1420156800, to: 1451433600 }, * { percentRightMargin: 20 } * ) * ``` * If the library cannot fit the specified range within the canvas, which may happen on small screens, it will ignore the `from` parameter. For more information, refer to the [Time scale](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Time-Scale#time-range) article. * * @param range A range that will be made visible. * @param options Options for the new visible range. * @returns A promise that resolves when the visible range is set. */ setVisibleRange(range: SetVisibleTimeRange, options?: SetVisibleRangeOptions): Promise; /** * Change the chart's symbol. * * **Example** * ```javascript * widget.activeChart().setSymbol('IBM'); * ``` * Note: if you are attempting to change multiple charts (multi-chart layouts) at the same time with * multiple `setSymbol` calls then you should set `doNotActivateChart` option to `true`. * * @param symbol A symbol. * @param options Optional object of options for the new symbol or optional callback that is called when the data for the new symbol has loaded. * @returns A promise that resolves with a boolean value. It's `true` when the symbol has been set and `false` when setting the symbol is not possible. */ setSymbol(symbol: string, options?: SetSymbolOptions | (() => void)): Promise; /** * Change the chart's interval (resolution). * * **Example** * ```javascript * widget.activeChart().setResolution('2M'); * ``` * Note: if you are attempting to change multiple charts (multi-chart layouts) at the same time with * multiple `setResolution` calls then you should set `doNotActivateChart` option to `true`. * * @param resolution A resolution. * @param options Optional object of options for the new resolution or optional callback that is called when the data for the new resolution has loaded. * @returns A promise that resolves with a boolean value. It's `true` when the resolution has been set and `false` when setting the resolution is not possible. */ setResolution(resolution: ResolutionString, options?: SetResolutionOptions | (() => void)): Promise; /** * Change the chart's type. * * **Example** * ```javascript * widget.activeChart().setChartType(12); // Specifies the High-low type * ``` * * @param type A chart type. * @param callback An optional callback function. Called when the chart type has changed and data has loaded. * @returns A promise that resolves with a boolean value. It's `true` when the chart type has been set and `false` when setting the chart type is not possible. */ setChartType(type: SeriesType, callback?: () => void): void; /** * Force the chart to re-request data, for example if there are [internet connection issues](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Datafeed-Issues#internet-connection-issues). * Before calling this function the {@link IChartWidgetApi.resetCache} method should be called. * * **Example** * ```javascript * widget.activeChart().resetData(); * ``` * */ resetData(): void; /** * Execute an action by ID. * See [Chart methods](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Chart#execute-action-by-id) for more information. * * **Example** * ```javascript * // Undoes the last applied action * widget.activeChart().executeActionById("undo"); * * // Opens or hides the drawing toolbar * widget.activeChart().executeActionById("drawingToolbarAction"); * ``` * * @param actionId An action ID. */ executeActionById(actionId: ChartActionId): void; /** * Get the state of a checkable action. * * **Example** * ```javascript * if (widget.activeChart().getCheckableActionState("drawingToolbarAction")) { * // ... * }; * ``` * * @param actionId An action ID. * @returns `null` if the action with specified id doesn't exist or is not checkable, `true` if the action is checked, `false` otherwise. */ getCheckableActionState(actionId: ChartActionId): boolean | null; /** * Force the chart to re-request all bar marks and timescale marks. * * **Example** * ```javascript * widget.activeChart().refreshMarks(); * ``` * */ refreshMarks(): void; /** * Remove marks from the chart. * * **Example** * ```javascript * widget.activeChart().clearMarks(); * ``` * * @param marksToClear type of marks to clear. If nothing is specified both bar & timescale marks will be removed. */ clearMarks(marksToClear?: ClearMarksMode): void; /** * Get an array of IDs and name for all drawings on the chart. * * **Example** * ```javascript * widget.activeChart().getAllShapes().forEach(({ name }) => console.log(name)); * ``` * * @returns An array of drawing information. */ getAllShapes(): EntityInfo[]; /** * Get an array of IDs and names for all studies on the chart. * * **Example** * ```javascript * widget.activeChart().getAllStudies().forEach(({ name }) => console.log(name)); * ``` * * @returns An array of study information. */ getAllStudies(): EntityInfo[]; /** * Get the chart's price to bar ratio. * * **Example** * ```javascript * console.log(widget.activeChart().getPriceToBarRatio()); * ``` * * @returns The ratio or `null` if no ratio is defined. */ getPriceToBarRatio(): number | null; /** * Set the chart's price to bar ratio. * * **Example** * ```javascript * widget.activeChart().setPriceToBarRatio(0.4567, { disableUndo: true }); * ``` * * @param ratio The new price to bar ratio. * @param options Optional undo options. */ setPriceToBarRatio(ratio: number, options?: UndoOptions): void; /** * Get the locked/unlocked state of the chart's price to bar ratio. * * **Example** * ```javascript * console.log(widget.activeChart().isPriceToBarRatioLocked()); * ``` * */ isPriceToBarRatioLocked(): boolean; /** * Lock or unlock the chart's price to bar ratio. * * **Example** * ```javascript * widget.activeChart().setPriceToBarRatioLocked(true, { disableUndo: false }); * ``` * * @param value `true` to lock, `false` to unlock. * @param options Optional undo options. */ setPriceToBarRatioLocked(value: boolean, options?: UndoOptions): void; /** * Get an array of the heigh of all panes. * * **Example** * ```javascript * console.log(widget.activeChart().getAllPanesHeight()); * ``` * * @returns An array of heights. */ getAllPanesHeight(): number[]; /** * Set the height for each pane in the order provided. * * **Example** * ```javascript * console.log(widget.activeChart().setAllPanesHeight([250, 400, 200])); * ``` * * @param heights An array of heights. */ setAllPanesHeight(heights: readonly number[]): void; /** * Maximize to its full size currently selected chart. * * **Example** * ```javascript * widget.activeChart().maximizeChart(); * ``` */ maximizeChart(): void; /** * Check if the chart is maximized or not. * * @returns `true` if maximized, `false` otherwise. */ isMaximized(): boolean; /** * Restore to its initial size currently selected chart. * * **Example** * ```javascript * widget.activeChart().restoreChart(); * ``` */ restoreChart(): void; /** * Get an object with operations available for the specified set of entities. * * **Example** * ```javascript * widget.activeChart().availableZOrderOperations([id]); * ``` * * @param sources An array of entity IDs. */ availableZOrderOperations(sources: readonly EntityId[]): AvailableZOrderOperations; /** * Move the group to the bottom of the Z-order. * * **Example** * ```javascript * widget.activeChart().sendToBack([id]); * ``` * * @param entities An array of entity IDs. */ sendToBack(entities: readonly EntityId[]): void; /** * Move the sources to the top of the Z-order. * * **Example** * ```javascript * widget.activeChart().bringToFront([id]); * ``` * * @param sources An array of source IDs. */ bringToFront(sources: readonly EntityId[]): void; /** * Move the sources one level up in the Z-order. * * **Example** * ```javascript * widget.activeChart().bringForward([id]); * ``` * * @param sources An array of source IDs. */ bringForward(sources: readonly EntityId[]): void; /** * Move the sources one level down in the Z-order. * * **Example** * ```javascript * widget.activeChart().sendBackward([id]); * ``` * * @param sources An array of source IDs. */ sendBackward(sources: readonly EntityId[]): void; /** * Adds an indicator or a symbol for comparison to the chart. * For more information, refer to the [Indicators](https://www.tradingview.com/charting-library-docs/latest/ui_elements/indicators/) article. * * @param {string} name - name of an indicator as shown in the `Indicators` widget * @param {boolean} [forceOverlay] - forces the Charting Library to place the created indicator on the main pane * @param {boolean} [lock] - whether a user will be able to remove/change/hide the indicator or not * @param {Record>(name: string, forceOverlay?: boolean, lock?: boolean, inputs?: Record, overrides?: TOverrides, options?: CreateStudyOptions): Promise; /** * Get a study by ID. * * **Example** * ```javascript * widget.activeChart().getStudyById(id).setVisible(false); * ``` * * @param entityId The study ID. * @returns An API object for interacting with the study. */ getStudyById(entityId: EntityId): IStudyApi; /** * Get the main series. * * **Example** * ```javascript * widget.activeChart().getSeries().setVisible(false); * ``` * * @returns An API object for interacting with the main series. */ getSeries(): ISeriesApi; /** * Create a new single point drawing. * * **Example** * ```javascript * widget.activeChart().createShape({ time: 1514764800 }, { shape: 'vertical_line' }); * ``` * * For more information, refer to [Drawings API](https://www.tradingview.com/charting-library-docs/latest/ui_elements/drawings/drawings-api#createshape). * * @param point A point. The location of the new drawing. * @param options An options object for the new drawing. * @returns Promise of the ID for the new drawing if it was created successfully. */ createShape(point: ShapePoint, options: CreateShapeOptions): Promise; /** * Create a new multi point drawing. * * **Example** * ```javascript * const from = Date.now() / 1000 - 500 * 24 * 3600; // 500 days ago * const to = Date.now() / 1000; * widget.activeChart().createMultipointShape( * [{ time: from, price: 150 }, { time: to, price: 150 }], * { * shape: "trend_line", * lock: true, * disableSelection: true, * disableSave: true, * disableUndo: true, * text: "text", * } * ); * ``` * * For more information, refer to [Drawings API](https://www.tradingview.com/charting-library-docs/latest/ui_elements/drawings/drawings-api#createmultipointshape). * * @param points An array of points that define the drawing. * @param options An options object for the new drawing. * @returns Promise of the ID for the new drawing if it was created successfully. */ createMultipointShape(points: ShapePoint[], options: CreateMultipointShapeOptions): Promise; /** * Create a new anchored drawing. Anchored drawings maintain their position when the chart's visible range changes. * * **Example** * ```javascript * widget.activeChart().createAnchoredShape({ x: 0.1, y: 0.9 }, { shape: 'anchored_text', text: 'Hello, charts!', overrides: { color: 'green' }}); * ``` * * For more information, refer to [Drawings API](https://www.tradingview.com/charting-library-docs/latest/ui_elements/drawings/drawings-api#createanchoredshape). * * @param position Percent-based x and y position of the new drawing, relative to the top left of the chart. * @param options An options object for the new drawing. */ createAnchoredShape(position: PositionPercents, options: CreateAnchoredShapeOptions): Promise; /** * Get a drawing by ID. * * **Example** * ```javascript * widget.activeChart().getShapeById(id).bringToFront(); * ``` * * For more information, refer to [Drawings API](https://www.tradingview.com/charting-library-docs/latest/ui_elements/drawings/drawings-api#manage-drawings). * * @param entityId A drawing ID. * @returns An API object for interacting with the drawing. */ getShapeById(entityId: EntityId): ILineDataSourceApi; /** * Remove an entity (e.g. drawing or study) from the chart. * * **Example** * ```javascript * widget.activeChart().removeEntity(id); * ``` * * @param entityId The ID of the entity. * @param options Optional undo options. */ removeEntity(entityId: EntityId, options?: UndoOptions): void; /** * Remove all drawings from the chart. * * **Example** * ```javascript * widget.activeChart().removeAllShapes(); * ``` * */ removeAllShapes(): void; /** * Remove all studies from the chart. * * **Example** * ```javascript * widget.activeChart().removeAllStudies(); * ``` * */ removeAllStudies(): void; /** * Get an API object for interacting with the selection. * * **Example** * ```javascript * widget.activeChart().selection().clear(); * ``` * */ selection(): ISelectionApi; /** * Show the properties dialog for a study or drawing. * * **Example** * ```javascript * const chart = widget.activeChart(); * chart.showPropertiesDialog(chart.getAllShapes()[0].id);` * ``` * * @param studyId An ID of the study or drawing. */ showPropertiesDialog(studyId: EntityId): void; /** * Save the current study template to a object. * * **Example** * ```javascript * const options = { saveSymbol: true, saveInterval: true }; * const template = widget.activeChart().createStudyTemplate(options); * ``` * * @param options An object of study template options. * @returns A study template object. */ createStudyTemplate(options: CreateStudyTemplateOptions): object; /** * Apply a study template to the chart. * * **Example** * ```javascript * widget.activeChart().applyStudyTemplate(template); * ``` * * @param template A study template object. */ applyStudyTemplate(template: object): void; /** * Creates a new trading order on the chart. * For more information, refer to [Trading primitives](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Trading-Primitives). * * Starting from version 29, this method is only available in [Trading Platform](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/). * * **Example** * ```javascript * const orderLine = await widget.activeChart().createOrderLine(); * orderLine * .setTooltip("Additional order information") * .setModifyTooltip("Modify order") * .setCancelTooltip("Cancel order") * .onMove(function() { * this.setText("onMove called"); * }) * .onModify("onModify called", function(text) { * this.setText(text); * }) * .onCancel("onCancel called", function(text) { * this.setText(text); * }) * .setText("STOP: 73.5 (5,64%)") * .setQuantity("2"); * ``` * * @returns An API object for interacting with the order. */ createOrderLine(): Promise; /** * Creates a new trading position on the chart. * For more information, refer to [Trading primitives](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Trading-Primitives). * * Starting from version 29, this method is only available in [Trading Platform](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/). * * **Example** * ```javascript * const positionLine = await widget.chart().createPositionLine(); * positionLine * .onModify(function() { * this.setText("onModify called"); * }) * .onReverse("onReverse called", function(text) { * this.setText(text); * }) * .onClose("onClose called", function(text) { * this.setText(text); * }) * .setText("PROFIT: 71.1 (3.31%)") * .setTooltip("Additional position information") * .setProtectTooltip("Protect position") * .setCloseTooltip("Close position") * .setReverseTooltip("Reverse position") * .setQuantity("8.235") * .setPrice(160) * .setExtendLeft(false) * .setLineStyle(0) * .setLineLength(25); * ``` * * @returns An API object for interacting with the position. */ createPositionLine(): Promise; /** * Creates a new trade execution on the chart. * For more information, refer to [Trading primitives](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Trading-Primitives). * * Starting from version 29, this method is only available in [Trading Platform](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/). * * **Example** * ```javascript * const executionLine = widget.activeChart().createExecutionShape(); * executionLine * .setText("@1,320.75 Limit Buy 1") * .setTooltip("@1,320.75 Limit Buy 1") * .setTextColor("rgba(0,255,0,0.5)") * .setArrowColor("#0F0") * .setDirection("buy") * .setTime(widget.activeChart().getVisibleRange().from) * .setPrice(160); * ``` * * @returns An API object for interacting with the execution. */ createExecutionShape(): Promise; /** * Get the name of the current symbol. * * **Example** * ```javascript * console.log(widget.activeChart().symbol()); * ``` * */ symbol(): string; /** * Get an extended information object for the current symbol. * * **Example** * ```javascript * console.log(widget.activeChart().symbolExt().name); * ``` * */ symbolExt(): SymbolExt | null; /** * Get the current resolution (interval). * * **Example** * ```javascript * console.log(widget.activeChart().resolution()); * ``` * */ resolution(): ResolutionString; /** * Get the current visible time range. * * **Example** * ```javascript * console.log(widget.activeChart().getVisibleRange()); * ``` * */ getVisibleRange(): VisibleTimeRange; /** * Returns the range of bar times currently shown on the chart. * - This range **includes** existing bars and any visible incomplete bars created by non-time-based chart styles (for example, Renko). * - This range **does not include** future bar times beyond the last visible bar. To include them, use {@link IChartWidgetApi.getVisibleRange} instead. */ getVisibleBarsRange(): VisibleBarsTimeRange | null; /** * Returns the object with 'format' function that you can use to format the prices. * * ```javascript * widget.activeChart().priceFormatter().format(123); * ``` */ priceFormatter(): INumberFormatter; /** * Returns the main series style type. * * ```javascript * console.log(widget.activeChart().chartType()); * ``` */ chartType(): SeriesType; /** * Get an API object for interacting with the chart timezone. */ getTimezoneApi(): ITimezoneApi; /** * Get an array of API objects for interacting with the chart panes. * * **Example** * ```javascript * widget.activeChart().getPanes()[1].moveTo(0); * ``` * */ getPanes(): IPaneApi[]; /** * Export the current data from the chart. * * **Example** * ```javascript * // Exports series' data only * widget.activeChart().exportData({ includeTime: false, includedStudies: [] }); * // Exports series' data with times * widget.activeChart().exportData({ includedStudies: [] }); * // Exports series' data with with user time * widget.activeChart().exportData({ includeTime: false, includeUserTime: true, includedStudies: [] }); * // Exports data for the indicator which ID is STUDY_ID * widget.activeChart().exportData({ includeTime: false, includeSeries: false, includedStudies: ['STUDY_ID'] }); * // Exports all available data from the chart * widget.activeChart().exportData({ includeUserTime: true }); * // Exports series' data before 2018-01-01 * widget.activeChart().exportData({ includeTime: false, to: Date.UTC(2018, 0, 1) / 1000 }); * // Exports series' data after 2018-01-01 * widget.activeChart().exportData({ includeTime: false, from: Date.UTC(2018, 0, 1) / 1000 }); * // Exports series' data in the range between 2018-01-01 and 2018-02-01 * widget.activeChart().exportData({ includeTime: false, from: Date.UTC(2018, 0, 1) / 1000, to: Date.UTC(2018, 1, 1) / 1000 }); * // Exports all displayed data on the chart * widget.activeChart().exportData({ includeDisplayedValues: true }); * ``` * * @param options Optional object of options to control the exported data. * @returns A promise that resolves with the exported data. */ exportData(options?: Partial): Promise; /** * Enable or disable [drag-to-export feature](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Chart#enable-drag-to-export-feature). * * **Example** * ```javascript * // Enable drag-to-export, disable default chart drag to scroll * widget.activeChart().setDragExportEnabled(true); * widget.subscribe('dragstart', (params) => { * // create a HTML element for drag image * const dragImage = createDragImage(); * // set drag image * params.setDragImage(dragImage, 0, 0); * const exportData = widget.activeChart().exportData(); * // transform export data to csv * const csvData = transformExportDataToCsv(exportData); * params.setData('text/plain', csvData); * }); * ``` * To implement drag-to-export, you need to handle the `dragstart` event in your application and set the data to the `dataTransfer` object. * @param enabled `true` to enable drag-to-export, `false` to disable. */ setDragExportEnabled(enabled: boolean): void; /** * Check if the chart can be zoomed out using the {@link zoomOut} method. * * **Example** * ```javascript * if(widget.activeChart().canZoomOut()) { * widget.activeChart().zoomOut(); * }; * ``` * * @returns `true` if the chart can be zoomed out. */ canZoomOut(): boolean; /** * Subscription if the chart can be zoomed out using the {@link zoomOut} method. */ canZoomOutWV(): IWatchedValueReadonly; /** * Zoom out. The method has the same effect as clicking on the "Zoom out" button. */ zoomOut(): void; /** * Enable or disable zooming of the chart. * * **Example** * ```javascript * widget.activeChart().setZoomEnabled(false); * ``` * * @param enabled `true` to enable zooming, `false` to disable. */ setZoomEnabled(enabled: boolean): void; /** * Enable or disable scrolling of the chart. * * **Example** * ```javascript * widget.activeChart().setScrollEnabled(false); * ``` * * @param enabled `true` to enable scrolling, `false` to disable. */ setScrollEnabled(enabled: boolean): void; /** * Get an API object for interacting with groups of drawings. * Refer to the [Drawings API](https://www.tradingview.com/charting-library-docs/latest/ui_elements/drawings/drawings-api#drawing-groups-api) article for more information. * * **Example** * ```javascript * widget.activeChart().shapesGroupController().createGroupFromSelection(); * ``` * */ shapesGroupController(): IShapesGroupControllerApi; /** * Get the bar time to the end of the period * @param {number} unixTime - date timestamp */ barTimeToEndOfPeriod(unixTime: number): number; /** * Get the end of period to bar time * @param {number} unixTime - date timestamp */ endOfPeriodToBarTime(unixTime: number): number; /** * Apply overrides to a specific chart instance without reloading. See also {@link ChartingLibraryWidgetOptions.overrides}. * * **Example** * ```javascript * widget.chart(0).applyOverrides({"paneProperties.legendProperties.showLegend": false}); * ``` * * If you want to apply overrides to all charts, use {@link IChartingLibraryWidget.applyOverrides} instead. * * @param overrides An object of overrides to apply to the chart. */ applyOverrides(props: object): void; /** * Get an API object for interacting with the timescale. * * **Example** * ```javascript * var time = widget.activeChart().getTimeScale().coordinateToTime(100); * ``` * */ getTimeScale(): ITimeScaleApi; /** * Check if bar selection mode is active or not. * * **Example** * ```javascript * var isRequested = widget.activeChart().isSelectBarRequested(); * ``` * * @returns `true` if active, `false` otherwise. */ isSelectBarRequested(): boolean; /** * Switch the chart to bar selection mode. * * **Example** * ```javascript * widget.activeChart().requestSelectBar() * .then(function(time) { * console.log('user selects bar with time', time); * }) * .catch(function() { * console.log('bar selection was rejected'); * }); * ``` * * @returns A promise that resolves to the timestamp of a bar selected by the user. Rejects if the bar selection was already requested or is cancelled. */ requestSelectBar(): Promise; /** * Cancel any active bar selection requests. * * **Example** * ```javascript * widget.activeChart().cancelSelectBar(); * ``` * */ cancelSelectBar(): void; /** * Load and apply a chart template. * * @param templateName The name of the template to load. */ loadChartTemplate(templateName: string): Promise; /** * Get a readonly watched value that can be used to read/subscribe to the state of the chart's market status. */ marketStatus(): IWatchedValueReadonly; /** * Set the time frame for this chart. * * **Note:** This action will set this chart as active in a multi-chart layout. * * **Example** * To apply the '1Y' timeframe: * ```js * tvWidget.setTimeFrame({ * val: { type: 'period-back', value: '12M' }, * res: '1W', * }); * ``` * * @param timeFrame Object specifying the range and resolution to be applied */ setTimeFrame(timeFrame: RangeOptions): void; /** * Get the line tools state containing the drawings on the active chart. * * This method requires that the [`saveload_separate_drawings_storage`](https://www.tradingview.com/charting-library-docs/latest/customization/Featuresets#saveload_separate_drawings_storage) featureset is enabled. */ getLineToolsState(): LineToolsAndGroupsState; /** * Apply line tools state to the chart which will restore the drawings from the saved content. * * This method requires that the [`saveload_separate_drawings_storage`](https://www.tradingview.com/charting-library-docs/latest/customization/Featuresets#saveload_separate_drawings_storage) featureset is enabled. */ applyLineToolsState(state: LineToolsAndGroupsState): Promise; /** * Manually trigger the chart to request the linetools again from the {@link IExternalSaveLoadAdapter.loadLineToolsAndGroups} method * or the 'load_line_tools' endpoint of the [Save and load REST API](https://www.tradingview.com/charting-library-docs/latest/saving_loading/save-load-rest-api/). * * This method requires that the [`saveload_separate_drawings_storage`](https://www.tradingview.com/charting-library-docs/latest/customization/Featuresets#saveload_separate_drawings_storage) featureset is enabled. */ reloadLineToolsFromServer(): void; /** * The visibility of inactivity gaps on intraday and DWM (daily, weekly, monthly) charts. * * The [`inactivity_gaps`](https://www.tradingview.com/charting-library-docs/latest/customization/Featuresets#inactivity_gaps) featureset should be enabled to use this option. * * When enabled (`true`), the chart displays gaps during trading sessions where there is missing data due to market inactivity. * Otherwise, these gaps are hidden and the chart appears continuous. */ inactivityGaps(): IWatchedValue; } /** * The main interface for interacting with the library, returned by {@link ChartingLibraryWidgetConstructor}. * For more information, refer to the [Widget methods](https://www.tradingview.com/charting-library-docs/latest/core_concepts/widget-methods) article. */ interface IChartingLibraryWidget { /** * A promise that resolves if and when the header is ready to be used. */ headerReady(): Promise; /** * The library will call `callback` when the chart is ready to be used. * * @param callback A function that will be called when the chart is ready to be used. */ onChartReady(callback: EmptyCallback): void; /** * The library will call `callback` when a greyed-out drawing tool or study is clicked. * * @param callback A function that will be called when a greyed-out drawing tool or study is clicked. */ onGrayedObjectClicked(callback: (obj: GrayedObject) => void): void; /** * This method specifies an action that happens when a user presses certain keys. * It allows you to override the built‑in shortcuts or specify custom ones. * * To do this, pass a keyboard shortcut and a callback function as parameters. * The library invokes the callback when the `shortCut` keys are pressed. * * Note that the `shortCut` argument depends on the key types. Refer to the [Manage shortcuts](https://www.tradingview.com/charting-library-docs/latest/getting_started/Shortcuts#manage-shortcuts) section for more information and examples. * * @param shortCut A number, a string, or an array of numbers and strings. * @param callback A function that is called when the `shortCut` keys are pressed. */ onShortcut(shortCut: string | number | (string | number)[], callback: EmptyCallback): void; /** * Subscribe to library events. * * @param event A event to subscribe to. * @param callback A callback that will be called when the event happens. */ subscribe(event: EventName, callback: SubscribeEventsMap[EventName]): void; /** * Unsubscribe from library events. * * @param event A event to unsubscribe from. * @param callback A callback to unsubscribe. Must be the same reference as a callback passed to {@link subscribe}. */ unsubscribe(event: EventName, callback: SubscribeEventsMap[EventName]): void; /** * Get an API instance that can be used to interact with a chart. * * @param index Zero based index of the chart. * @returns An API instance. */ chart(index?: number): IChartWidgetApi; /** * Get the configured locale of the widget. For example `en`, `zh`, `ru`. * * @returns A code representing the locale of the widget. */ getLanguage(): LanguageCode; /** * Set the symbol and resolution of the active chart. * @param symbol A symbol to load. * @param interval A interval (resolution) to load. * @param callback A callback. Called when the symbol's data has finished loading. */ setSymbol(symbol: string, interval: ResolutionString, callback: EmptyCallback): void; /** * Remove the widget and all its data from the page. The widget cannot be interacted with after it has been removed. */ remove(): void; /** * Close all open context menus, pop-ups or dialogs. */ closePopupsAndDialogs(): void; /** * Select an icon. It's the same as clicking on the corresponding button in the left toolbar. * * @param linetool An icon drawing tool. * @param options An optional object with options. */ selectLineTool(linetool: "icon", options?: IconOptions): Promise; /** * Select a drawing or a cursor. It's the same as clicking on the corresponding button in the left toolbar. * * @param linetool A drawing or cursor to select (excluding 'icon') */ selectLineTool(linetool: Omit<"icon", SupportedLineTools>): Promise; /** * Select the Icon line tool. It's the same as clicking on the corresponding button in the left toolbar. * * @param linetool Icon line tool. * @param options An optional object with options. Currently only used for the 'icon' drawing. */ selectLineTool(linetool: "icon", options?: IconOptions): Promise; /** * Select the Emoji line tool. It's the same as clicking on the corresponding button in the left toolbar. * * @param linetool Emoji line tool. * @param options Options for the Emoji line tool */ selectLineTool(linetool: "emoji", options?: EmojiOptions): Promise; /** * Select a drawing, icon, or a cursor. It's the same as clicking on the corresponding button in the left toolbar. * * @param linetool A drawing or cursor to select. * @param options An optional object with options. */ selectLineTool(linetool: SupportedLineTools, options?: IconOptions | EmojiOptions): Promise; /** * Get the currently selected drawing or cursor. * * @returns An identifier for drawing or cursor. */ selectedLineTool(): SupportedLineTools; /** * Saves the chart state to an object. This method is part of the [low-level save/load API](https://www.tradingview.com/charting-library-docs/latest/saving_loading/low-level-api). * * @param callback A function called with the chart state as the first argument. * @param options Options for customising the saved data. */ save(callback: (state: object) => void, options?: SaveChartOptions): void; /** * Loads the chart state from an object. This method is part of the [low-level save/load API](https://www.tradingview.com/charting-library-docs/latest/saving_loading/low-level-api). * * @param state A chart state object to load. * @param extendedData A optional object of information about the saved state. */ load(state: object, extendedData?: SavedStateMetaInfo): Promise; /** * Get a list of chart descriptions saved to the server for the current user. * * @param callback A function called with an array of saved chart information as the first argument. */ getSavedCharts(callback: (chartRecords: SaveLoadChartRecord[]) => void): void; /** * Load a saved chart from the server. * * @param chartRecord A chart information object (returned by {@link getSavedCharts}). */ loadChartFromServer(chartRecord: SaveLoadChartRecord): Promise; /** * Save the current chart to the server. * * @param onComplete An optional callback function called when the chart is successfully saved. * @param onFail An optional callback function called when the chart fails to save. * @param options An optional object of options for saving the chart. */ saveChartToServer(onComplete?: EmptyCallback, onFail?: (error: SaveChartErrorInfo) => void, options?: SaveChartToServerOptions): void; /** * Remove a saved chart from the server. * * @param chartId A chart ID from a {@link SaveLoadChartRecord} (returned by {@link getSavedCharts}). * @param onCompleteCallback A callback function called when the chart is successfully saved. */ removeChartFromServer(chartId: string | number, onCompleteCallback: EmptyCallback): void; /** * The widget will call the callback function each time the widget wants to display a context menu. * See also {@link ChartingLibraryWidgetOptions.context_menu}. * * **Example** * ```javascript * widget.onChartReady(function() { * widget.onContextMenu(function(unixtime, price) { * return [{ * position: "top", * text: "First top menu item, time: " + unixtime + ", price: " + price, * click: function() { alert("First clicked."); } * }, * { text: "-", position: "top" }, // Adds a separator between buttons * { text: "-Paste" }, // Removes the existing item from the menu * { * position: "top", * text: "Second top menu item 2", * click: function() { alert("Second clicked."); } * }, { * position: "bottom", * text: "Bottom menu item", * click: function() { alert("Third clicked."); } * }]; * }); * }); * ``` * * @param callback A function called with the time and price of the location on the chart that triggered the context menu. * The array of objects returned will add or remove items from the context menu. */ onContextMenu(callback: (unixTime: number, price: number) => ContextMenuItem[]): void; /** * Create a button in the top toolbar. This should be called after {@link headerReady} has resolved. * * **Example** * ```javascript * widget.headerReady().then(function() { * var button = widget.createButton(); * button.setAttribute('title', 'My custom button tooltip'); * button.addEventListener('click', function() { alert("My custom button pressed!"); }); * button.textContent = 'My custom button caption'; * }); * ``` * * @param options A optional object of options for the button. * @returns A `HTMLElement` you can customize. */ createButton(options?: CreateHTMLButtonOptions): HTMLElement; /** * Create a button in the top toolbar. This should be called after {@link headerReady} has resolved. * If the `title` option is provided then the title text will be shown in a tooltip on hover. * If the `onClick` option is provided then the button will be clickable. * @param options A object of options for the button. * @returns A `string` button id */ createButton(options: CreateTradingViewStyledButtonOptions): string; /** * Create a button in the top toolbar. This should be called after {@link headerReady} has resolved. * @param options A optional object of options for the button. * @returns A `HTMLElement` if the `useTradingViewStyle` option is `false` or undefined. `string`(button id) if `useTradingViewStyle` is `true`. */ createButton(options?: CreateButtonOptions): HTMLElement | string; /** * Remove a button from the top toolbar. This should be called after {@link headerReady} has resolved. * * **Example** * ```javascript * widget.headerReady().then(function() { * var button = widget.createButton(); * widget.removeButton(button) * }); * ``` * * @param buttonIdOrHtmlElement The button link or id that you receive from createButton method. */ removeButton(buttonIdOrHtmlElement: HTMLElement | string): void; /** * Add a custom dropdown menu to the top toolbar. * * **Example** * ```javascript * widget.createDropdown( * { * title: 'dropdown', * tooltip: 'tooltip for this dropdown', * items: [ * { * title: 'item#1', * onSelect: () => {console.log('1');}, * }, * { * title: 'item#2', * onSelect: () => {widget.setSymbol('IBM', '1D');}, * }, * { * title: 'item#3', * onSelect: () => { * widget.activeChart().createStudy( * 'MACD', * false, * false, * { * in_0: 14, * in_1: 30, * in_3: 'close', * in_2: 9 * } * ); * }, * } * ], * icon: ``, * } * ).then(myDropdownApi => { * // Use myDropdownApi if you need to update the dropdown: * // myDropdownApi.applyOptions({ * // title: 'a new title!' * // }); * * // Or remove the dropdown: * // myDropdownApi.remove(); * }); * ``` * @param {DropdownParams} params */ createDropdown(params: DropdownParams): Promise; /** * Show a dialog with custom title and text along with an "OK" buttons. * @param params A object of options for the created dialog. */ showNoticeDialog(params: DialogParams<() => void>): void; /** * Show a dialog with custom title and text along with "OK" and "CANCEL" buttons. * * @param params A object of options for the created dialog. */ showConfirmDialog(params: DialogParams<(confirmed: boolean) => void>): void; /** * Show the "Load Chart Layout" dialog. */ showLoadChartDialog(): void; /** * Show the "Copy Chart Layout" dialog. */ showSaveAsChartDialog(): void; /** * Get the symbol and interval of the active chart. */ symbolInterval(): SymbolIntervalResult; /** * Get the price formatter for the main series. You can use this to format prices as the char */ mainSeriesPriceFormatter(): INumberFormatter; /** * Get an array of supported intervals (resolutions). * * @returns An array of supported intervals. E.g. `['1D', '5D', '1Y']`. */ getIntervals(): string[]; /** * Get an array of the names of all supported studies. These names can be used when calling {@link IChartWidgetApi.createStudy}. * * @returns An array of supported study names. E.g. `['Accumulation/Distribution', 'Accumulative Swing Index', 'Advance/Decline', ...]`. */ getStudiesList(): string[]; /** * Get an array of information about indicator inputs, including their names. * You need to know an input name to refer to this property in the code. * For example, when you change an input value using the [overrides](https://www.tradingview.com/charting-library-docs/latest/customization/overrides/indicator-overrides). * Consider the [Input property](https://www.tradingview.com/charting-library-docs/latest/customization/overrides/indicator-overrides#input-property) section for more information. * * @param studyName The name of a study. */ getStudyInputs(studyName: string): StudyInputInformation[]; /** * Get information about indicator properties. * You can use this information to refer to the properties in the code. * For example, when you change property values using the [overrides](https://www.tradingview.com/charting-library-docs/latest/customization/overrides/indicator-overrides). * * Note that `getStudyStyles` does not return actual property names but the indicator's [metadata](https://www.tradingview.com/charting-library-docs/latest/custom_studies/metainfo/). * Consider the [Property path](https://www.tradingview.com/charting-library-docs/latest/customization/overrides/indicator-overrides#property-path) section for more information on how to refer to the properties. * * @param studyName The name of a indicator. */ getStudyStyles(studyName: string): StudyStyleInfo; /** * Add a custom CSS file for the library to load. * * @param url A url to the custom CSS file. Should be absolute or relative to the `static` folder. */ addCustomCSSFile(url: string): void; /** * Apply overrides to all charts currently in the widget without reloading. See also {@link ChartingLibraryWidgetOptions.overrides}. * * **Example** * ```javascript * widget.applyOverrides({"paneProperties.legendProperties.showLegend": false}); * ``` * * If you want to apply overrides to a specific chart only, use {@link IChartWidgetApi.applyOverrides} instead. * * @param overrides An object of overrides to apply to the chart(s). */ applyOverrides>(overrides: TOverrides): void; /** * Apply overrides to indicator styles and inputs without reloading. * Refer to [Indicator Overrides](https://www.tradingview.com/charting-library-docs/latest/customization/overrides/indicator-overrides#change-default-properties-on-the-fly) for more information. * Overrides for built-in indicators are listed in {@link StudyOverrides}. * * @param overrides An object of overrides to apply to the studies. */ applyStudiesOverrides(overrides: object): void; /** * Apply overrides to the order and position lines created either using the [Broker API](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/#broker-api) or [trading primitives](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Trading-Primitives) methods. */ applyTradingCustomization(tradingCustomization: TradingCustomization): Promise; /** * Trading Platform only. Get a promise that resolves with an API object for interacting with the widgetbar (right sidebar) watchlist. * * **Example** * ```javascript * const watchlistApi = await widget.watchList(); * const activeListId = watchlistApi.getActiveListId(); * const currentListItems = watchlistApi.getList(activeListId); * // append new section and item to the current watchlist * watchlistApi.updateList(activeListId, [...currentListItems, '###NEW SECTION', 'AMZN']); * ``` * * @returns An API object for interacting with the widgetbar (right sidebar) watchlist. */ watchList(): Promise; /** * Trading Platform only. Get a promise that resolves with an API object for interacting with the widgetbar (right sidebar) news widget. * * @returns An API object for interacting with the widgetbar (right sidebar) widget. */ news(): Promise; /** * Trading Platform only. Get a promise that resolves with an API object for interacting with the widgetbar (right sidebar). * * @returns An API object for interacting with the widgetbar (right sidebar). */ widgetbar(): Promise; /** * Get an API object for interacting with the active chart. * For example, you can subscribe to events on the active chart, such as {@link IChartWidgetApi.onIntervalChanged}. * Note that the library does not manage the event subscriptions when users switch between the charts on the [multiple-chart layout](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#multiple-chart-layout). * If necessary, you should manually unsubscribe from the previous chart and subscribe to the newly selected one. * To track the currently active chart, use the {@link SubscribeEventsMap.activeChartChanged} event. * * @returns An API object for interacting with the chart. */ activeChart(): IChartWidgetApi; /** * Get the index of the active chart in the layout. * * @returns number. */ activeChartIndex(): number; /** * Set which chart is currently active. * It is recommended that this method is only used when linked to a user action * which should change the active chart. * * Use {@link chartsCount} to determine the number of charts currently available. * If an invalid index is supplied (less than zero, or greater than the number of charts minus 1) * then this method will not change the active chart. * @param index - index of chart to set as the active chart. Index is zero-based. */ setActiveChart(index: number): void; /** * Get the number of charts in the current layout. * * @returns A count of the charts in the current layout. */ chartsCount(): number; /** * This method deletes non-visible charts from a multiple-chart layout. * * When a user transitions from a layout with a larger number of charts * to one with fewer charts, the unused chart APIs still exist behind the scenes. * This inherent behavior allows the library to restore previously displayed charts. * * If you prefer that additional charts are displayed as new, with no record of previous * charts at the same position, you can use this method to delete all non-visible charts. * It is most effective to run this method right after a layout change (one can subscribe to * {@link SubscribeEventsMap.layout_changed} to know when this occurs). * * Please ensure that any subscriptions or event listeners associated with the * hidden charts are removed prior to invoking this method. * * @returns void */ unloadUnusedCharts(): void; /** * Get the current chart layout type. * * @returns A string representation of the current layout type. E.g. `'2h'` for two charts split vertically. */ layout(): LayoutType; /** * Set the current chart layout type. * * @params layout A string representation of the new layout type. E.g. `'2h'` for two charts split vertically. */ setLayout(layout: LayoutType): void; /** * Get the name of the current chart layout. The return value will be `undefined` if the current layout has not been saved. * * @returns A string of the name of the current chart layout. */ layoutName(): string; /** * Resets the sizes of all charts within a multiple-chart layout back to their initial default values. * This action redistributes the space equally among all charts to ensure consistency in layout design. * * @param disableUndo When set to true, the reset action is not added to the undo stack. Hence, the user cannot undo the reset operation. */ resetLayoutSizes(disableUndo?: boolean): void; /** * Set the sizes of charts within a multiple-chart layout. * * @param sizes An object of sizes to set for the charts. * @param disableUndo When set to `true`, the set action is not added to the undo stack. Hence, a user cannot undo the size changes. */ setLayoutSizes(sizes: Partial, disableUndo?: boolean): void; /** * Change the theme of the chart. * * @param themeName A theme name. * @param options An optional object of options for the theme. * @returns A promise that resolves when the theme has been changed. */ changeTheme(themeName: ThemeName, options?: ChangeThemeOptions): Promise; /** * Get the current theme of the chart. * * **Example** * ```javascript * console.log(widget.getTheme()); * ``` * * @returns A theme name. The name of the current theme. */ getTheme(): ThemeName; /** * Create a snapshot of the chart and upload it to the server. * When it is ready callback functions subscribed to the `'onScreenshotReady'` event using {@link subscribe} will be called. * The URL of the snapshot will be passed as an argument to the callback function. */ takeScreenshot(): void; /** * Create a snapshot of the chart and return it as a canvas. * Use this method to [implement your logic](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Snapshots#implement-your-logic) for taking snapshots. * * @param options An optional object that customizes the returned snapshot. * @returns A promise containing a `HTMLCanvasElement` of the snapshot. */ takeClientScreenshot(options?: Partial): Promise; /** * Get a watched value that can be used to read/write/subscribe to the state of the "Lock All Drawing Tools" button. * * @returns A watched value of the state of the "Lock All Drawing Tools" button. */ lockAllDrawingTools(): IWatchedValue; /** * Get a watched value that can be used to read/write/subscribe to the state of the "Hide All Drawing Tools" button. * * @returns A watched value of the state of the "Hide All Drawing Tools" button. */ hideAllDrawingTools(): IWatchedValue; /** * Get a watched value that can be used to read/write/subscribe to the state of the magnet. * * @returns A watched value of the state of the magnet. */ magnetEnabled(): IWatchedValue; /** * Get a watched value that can be used to read/write/subscribe to the state of the magnet mode. * * @returns A watched value of the state of the magnet mode. */ magnetMode(): IWatchedValue; /** * Only available in Trading Platform. Get a watched value that can be used to read/write/subscribe to the state of the symbol sync between charts. * * **Example** * ```javascript * if (widget.symbolSync().value()) { * // ... * } * ``` * * @returns A watched value of the state of the symbol sync. */ symbolSync(): IWatchedValue; /** * Only available in Trading Platform. Get a watched value that can be used to read/write/subscribe to the state of the interval sync between charts. * * **Example** * ```javascript * widget.intervalSync().setValue(true); * ``` * * @returns A watched value of the state of the interval sync. */ intervalSync(): IWatchedValue; /** * Only available in Trading Platform. Get a watched value that can be used to read/write/subscribe to the state of the crosshair sync between charts. * * **Example** * ```javascript * widget.crosshairSync().setValue(true); * ``` * * @returns A watched value of the state of the crosshair sync. */ crosshairSync(): IWatchedValue; /** * Only available in Trading Platform. Get a watched value that can be used to read/write/subscribe to the state of the time sync between charts. * * **Example** * ```javascript * widget.timeSync().setValue(true); * ``` * * @returns A watched value of the state of the time sync. */ timeSync(): IWatchedValue; /** * Only available in Trading Platform. Get a watched value that can be used to read/write/subscribe to the state of the date range sync between charts. * * **Example** * ```javascript * widget.dateRangeSync().setValue(true); * ``` * * @returns A watched value of the state of the date range sync. */ dateRangeSync(): IWatchedValue; /** * Set the chart into fullscreen mode (if it isn't already). */ startFullscreen(): void; /** * Set the chart into non-fullscreen mode (if it isn't already). */ exitFullscreen(): void; /** * Get the state of the undo/redo stack. */ undoRedoState(): UndoRedoState; /** * Get a watched value that can be used to read/write/subscribe to the state of the navigation buttons. * * @returns A watched value of the state of the navigation buttons. */ navigationButtonsVisibility(): IWatchedValue; /** * Get a watched value that can be used to read/write/subscribe to the state of the pane buttons. * * @returns A watched value of the state of the pane buttons. */ paneButtonsVisibility(): IWatchedValue; /** * Get a watched value that can be used to read/write/subscribe to the state of the date format. * * @returns A watched value of the state of the date format. */ dateFormat(): IWatchedValue; /** * Get a watched value that can be used to read/write/subscribe to the state of the timeHours format. */ timeHoursFormat(): IWatchedValue; /** * Get a watched value that can be used to read/write/subscribe to the state of the currency and unit * visibility setting on the price scale. * * @returns A watched value of the state of the currency and unit visibility option. */ currencyAndUnitVisibility(): IWatchedValue; /** * Enable or disable writing detailed [Datafeed API](https://www.tradingview.com/charting-library-docs/latest/connecting_data/datafeed-api/) logs into the browser console. * * @param enabled A boolean flag. `true` to enable debug mode, `false` to disable. */ setDebugMode(enabled: boolean): void; /** * Get a watched value that read/write/subscribe to the state of the 'draw on all charts' mode. * * When enabled new drawings will be replicated to all charts in the layout * and shown when the same ticker is selected. */ drawOnAllChartsEnabled(): IWatchedValue; /** * Clears the undo & redo history. * * **Warning:** this should only be used in very specific cases where you have considered * the UX implications. It is generally unexpected for the user that the undo * history has been cleared. * * An example of an acceptable use-case would be reusing a chart when switching * pages / tabs on a Single Page Application, and presenting it to the user as a * new chart. */ clearUndoHistory(): void; /** * This method returns a readonly WatchedValue ({@link IWatchedValueReadonly}) * object that can be used to read/watch the current supported chart types * ({@link SeriesType}) for an active chart. * * The chart type is returned as a number. * You can see which number corresponds to which chart type in the * [Overrides](https://www.tradingview.com/charting-library-docs/latest/customization/overrides/Overrides) * documentation for `mainSeriesProperties.style`. */ supportedChartTypes(): IWatchedValueReadonly; /** * Get an API object for adjusting the watermarks present on the charts. * This can only be accessed when the chart is ready to be used. ({@link onChartReady}) * * @returns An API object for adjusting the watermark settings. */ watermark(): IWatermarkApi; /** * Get an API object for creating, and adjusting, custom status items to * be displayed within the legend for the main series of each chart. * * This can only be accessed when the chart has been created. ({@link headerReady}) * * @returns An API object for controlling additional custom status items within the legend area. */ customSymbolStatus(): ICustomSymbolStatusApi; /** * Sets the value for a CSS custom property. * * **Example:** * ```js * widget.setCSSCustomProperty('--my-theme-color', '#123AAA'); * ``` * * @param customPropertyName A string representing the CSS custom property name. It is expected that the name should start with a double hyphen ('--'). * @param value A string containing the new property value. */ setCSSCustomProperty(customPropertyName: string, value: string): void; /** * Returns the current value for a CSS custom property. * * **Example:** * ```js * const currentValue = widget.getCSSCustomPropertyValue('--my-theme-color'); * ``` * * @param customPropertyName A string representing the CSS custom property name to be checked. It is expected that the name should start with a double hyphen ('--'). * @returns A string containing the value of the property. If not set, returns the empty string. */ getCSSCustomPropertyValue(customPropertyName: string): string; /** * Get a promise that resolves with an API object for interacting with the custom themes. For more information on custom themes, refer to the [Custom themes API](https://www.tradingview.com/charting-library-docs/latest/customization/styles/custom-themes) article. * * @returns An API object for interacting with the custom themes. */ customThemes(): Promise; /** * Reset cached bar data from the datafeed, for all symbols. * * This has the same effect as calling [`onResetCacheNeededCallback`](https://www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.IDatafeedChartApi#subscribebars) for all symbol and resolution combinations at once. */ resetCache(): void; } /** * PineJS execution context. */ interface IContext { /** * Symbol Instrument */ symbol: ISymbolInstrument; /** * Load a new symbol for the custom indicator * @param {string} tickerid - Symbol identifier * @param {string} period - period for the new symbol * @param {string} [currencyCode] - Currency code * @param {string} [unitId] - Unit ID * @param {string} [subsessionId] - Subsession ID */ new_sym(tickerid: string, period: string, currencyCode?: string, unitId?: string, subsessionId?: string): ISymbolInstrument; /** * Switch context to the other symbol received through {@link IContext.new_sym} * @param {number} i - the index of the symbol (`0` for the main series) */ select_sym(i: number): void; /** * Creates an in-memory temporary storage with depth defined by the first call `new_var(value).get(n)` * @param {number} [value] - variable's value */ new_var(value?: number): IPineSeries; /** * Creates an in-memory temporary storage with unlimited depth. * @param {number} [value] - variable's value */ new_unlimited_var(value?: number): IPineSeries; /** * Creates a new context */ new_ctx(): IContext; /** * Checks if symbol is the main symbol * @param {ISymbolInstrument|undefined} symbol - symbol to check * @returns `true` if symbol is the main symbol */ is_main_symbol(symbol: ISymbolInstrument | undefined): boolean; /** * Allows you to specify how many data points beyond the [visible range](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Time-Scale#time-range) the library should request. * You should use this method only in **exceptional** cases. * * By default, the library request data for the visible range and some additional data points required for calculations. * For example, if you calculate 10-period Moving Average with the {@link PineJSStd.sma} function, the library will request at least 10 extra bars of historical data. * * However, the library cannot determine the number of extra bars when your indicator depends on another indicator (chained calculations). * In this exceptional case, you can specify this number using the `setMinimumAdditionalDepth` method. * Consider the [Custom Moving Average](https://www.tradingview.com/charting-library-docs/latest/tutorials/how-to-guides/create-custom-indicator/constructor-implementation#2-call-setminimumadditionaldepth) example, where a series is calculated and then used as an input for the second calculation. * @param {number} value - minimum number of bars to request */ setMinimumAdditionalDepth(value: number): void; } /** * Adapter API for reading and setting the state of a * custom symbol status item. * * The 'set' methods return the same adapter so that you can * chain multiple set functions together. * * **Example** * ```js * const adapter = widget.customSymbolStatus().symbol('ABC'); * adapter.setVisible(true).setColor('#336699').setTooltip('Custom Status') * ``` */ interface ICustomSymbolStatusAdapter { /** * Get the current visibility of the status item. * @returns the current visibility */ getVisible(): boolean; /** * Set the visibility for the status item. @default false * * @param visible - visibility for the status item, where * `true` makes the item visible. * @returns the current symbol status adapter so you can * chain 'set' functions together. */ setVisible(visible: boolean): ICustomSymbolStatusAdapter; /** * Get the current icon for the status item. * @returns the current icon SVG string */ getIcon(): string | null; /** * Set the icon for the status item. @default blank * The icon should be provided as an svg markup. It is * recommended that the icon works well at small sizes. * * **Example** * ```svg * * * * * ``` * * @param icon - svg markup string to be used as the icon, or `null` to display no icon * @returns the current symbol status adapter so you can * chain 'set' functions together. */ setIcon(icon: string | null): ICustomSymbolStatusAdapter; /** * Get the current color of the status item. * @returns the current color */ getColor(): string; /** * Set the color for the status item. @default '#9598a1' * * @param color - color to be used for the status item. * It is recommended that you test that the color works well * for both light and dark themes. * @returns the current symbol status adapter so you can * chain 'set' functions together. */ setColor(color: string): ICustomSymbolStatusAdapter; /** * Get the current tooltip text for the status item. * @returns the current tooltip text */ getTooltip(): string | null; /** * Set the text to be displayed within the tooltip displayed * when hovering over the statuses for the symbol. * @default '' * * @param tooltip - text to be displayed within the tooltip. * @returns the current symbol status adapter so you can * chain 'set' functions together. */ setTooltip(tooltip: string | null): ICustomSymbolStatusAdapter; /** * Get the current content of the status item displayed within * the pop-up tooltip. * @returns the current pop-up content */ getDropDownContent(): CustomStatusDropDownContent[] | null; /** * Set the content to be displayed within the pop-up which appears * when the user clicks on the symbol statuses. * @default null * * @param content - content to be displayed, set to `null` to display * nothing. More than one section can be specified. * @returns the current symbol status adapter so you can * chain 'set' functions together. */ setDropDownContent(content: CustomStatusDropDownContent[] | null): ICustomSymbolStatusAdapter; } /** * This API allows you to create custom sections in the [Market Status](https://www.tradingview.com/charting-library-docs/latest/ui_elements/market-status) popup to display additional information on a symbol, such as warnings. * You can also customize the icon, color, tooltip, and content. * * The API is designed to specify sections for a certain symbol. To do this, you should pass `symbolId` to the `symbol` method. * Note that `symbolId` should match the ID of the resolved symbol that you can retrieve using the {@link IChartWidgetApi.symbol} method. * * **Example** * ```js * widget * .customSymbolStatus() * .symbol('NASDAQNM:AAPL') // select the symbol * .setVisible(true) // make the status visible * .setColor('rgb(255, 40, 60)') // set the color * .setIcon(myCustomIconSvgString) // string for an svg icon, i.e. ' ... ' * .setTooltip('Tooltip') // text to be displayed within the hover tooltip * .setDropDownContent([ // content to be displayed within the large pop-up tooltip * { * title: 'Title', // title to be displayed within the pop-up * color: 'rgb(255, 60, 70)', // optional, if you want it to be different to above * content: [ * 'Explanation of status', * '

', * 'More details...', * ], * action: { // Optional action to be displayed * text: 'Read more here', * tooltip: 'opens in a new window', * onClick: () => { * window.open('https://www.tradingview.com/', '_blank'); * }, * }, * }, * ]); * ``` */ interface ICustomSymbolStatusApi { /** * Get the custom symbol status adapter for a specific symbolId. The * symbolId should exactly match the resolved symbolId. This id can * be retrieved for a chart via the {@link IChartWidgetApi.symbol} method. * * @param symbolId - symbol id for which you would like to create / adjust * the custom status */ symbol(symbolId: string): ICustomSymbolStatusAdapter; /** * Hide all the custom status items. This is equivalent to using * `setVisible(false)` on all of the current custom symbol status items. */ hideAll(): void; } /** * An API for controlling custom themes. To retrieve this interface, call the {@link IChartingLibraryWidget.customThemes} method. * For more information on custom themes, refer to the [Custom Themes API](https://www.tradingview.com/charting-library-docs/latest/customization/styles/custom-themes) article. */ interface ICustomThemesApi { /** * Apply custom theme color definitions to the library widget after the widget is created. * * You can also specify a custom theme using the {@link ChartingLibraryWidgetOptions.custom_themes} property in the Widget Constructor. * * @param customThemes Custom theme color definitions */ applyCustomThemes(customThemes: CustomThemes): Promise; /** * Reset the widget's color theme colors back to the default values. */ resetCustomThemes(): Promise; } interface IDatafeedChartApi { /** * The library calls this function to get marks for visible bars range. * The library assumes that you will call `onDataCallback` only once per `getMarks` call. * * A few marks per bar are allowed (for now, the maximum is 10). The time of each mark must match the time of a bar. For example, if the bar times are `2023-01-01`, `2023-01-08`, and `2023-01-15`, then a mark cannot have the time `2023-01-05`. * * **Remark:** This function will be called only if you confirmed that your back-end is supporting marks ({@link DatafeedConfiguration.supports_marks}). * * @param symbolInfo A SymbolInfo object * @param from Unix timestamp (leftmost visible bar) * @param to Unix timestamp (rightmost visible bar) * @param onDataCallback Callback function containing an array of marks * @param resolution Resolution of the symbol */ getMarks?(symbolInfo: LibrarySymbolInfo, from: number, to: number, onDataCallback: GetMarksCallback, resolution: ResolutionString): void; /** * The library calls this function to get timescale marks for visible bars range. * The library assumes that you will call `onDataCallback` only once per `getTimescaleMarks` call. * * **Remark:** This function will be called only if you confirmed that your back-end is supporting marks ({@link DatafeedConfiguration.supports_timescale_marks}). * * @param symbolInfo A SymbolInfo object * @param from Unix timestamp (leftmost visible bar) * @param to Unix timestamp (rightmost visible bar) * @param onDataCallback Callback function containing an array of marks * @param resolution Resolution of the symbol */ getTimescaleMarks?(symbolInfo: LibrarySymbolInfo, from: number, to: number, onDataCallback: GetMarksCallback, resolution: ResolutionString): void; /** * This function is called if the `supports_time` configuration flag is `true` when the chart needs to know the server time. * The library expects a callback to be called once. * The time is provided without milliseconds. Example: `1445324591`. * * `getServerTime` is used to display countdown on the price scale. * Note that the countdown can be displayed only for [intraday](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions#resolution-in-minutes-intraday) resolutions. */ getServerTime?(callback: ServerTimeCallback): void; /** * Provides a list of symbols that match the user's search query. * * @param userInput Text entered by user in the symbol search field * @param exchange The requested exchange. Empty value means no filter was specified * @param symbolType Type of symbol. Empty value means no filter was specified * @param onResult Callback function that returns an array of results ({@link SearchSymbolResultItem}) or empty array if no symbols found * @param searchSource The source of the search ({@link SearchInitiationPoint}). */ searchSymbols(userInput: string, exchange: string, symbolType: string, onResult: SearchSymbolsCallback, searchSource?: SearchInitiationPoint): void; /** * Provides a list of symbols that match the user's search query. * * Optional. If defined, the library uses this method instead of the non-paginated `searchSymbols`. * * Use the `start` property from `options` to determine which "page" of results to return. * For example, if the first call returns 50 results with 10 remaining, the second call will have `start` set to `50`. * When no more results are available on the server, set the `symbolsRemaining` parameter of the callback to `0`. * * @param options Object containing the user input, exchange, symbol type, and search source ({@link SearchInitiationPoint}). * @param onResult Callback function that returns an array of results ({@link SearchSymbolResultItem}) or an empty array if no symbols are found. */ searchSymbolsPaginated?(options: SymbolSearchPaginatedOptions, onResult: SearchSymbolsPaginatedCallback): void; /** * The library will call this function when it needs to get SymbolInfo by symbol name. * * @param symbolName Symbol name or `ticker` * @param onResolve Callback function returning a SymbolInfo ({@link LibrarySymbolInfo}) * @param onError Callback function whose only argument is a text error message * @param extension An optional object with additional parameters */ resolveSymbol(symbolName: string, onResolve: ResolveCallback, onError: DatafeedErrorCallback, extension?: SymbolResolveExtension): void; /** * This function is called when the chart needs a history fragment defined by dates range. * * @param symbolInfo A SymbolInfo object * @param resolution Resolution of the symbol * @param periodParams An object used to pass specific requirements for getting bars * @param onResult Callback function for historical data * @param onError Callback function whose only argument is a text error message. If using special characters, please consider `encodeURIComponent`. */ getBars(symbolInfo: LibrarySymbolInfo, resolution: ResolutionString, periodParams: PeriodParams, onResult: HistoryCallback, onError: DatafeedErrorCallback): void; /** * The library calls this function when it wants to receive real-time updates for a symbol. * The library assumes that you will call the callback provided by the `onTick` parameter every time you want to update the most recent bar or to add a new one. * * @param symbolInfo A SymbolInfo object * @param resolution Resolution of the symbol * @param onTick Callback function returning a Bar object * @param listenerGuid * @param onResetCacheNeededCallback Function to be executed when bar data has changed */ subscribeBars(symbolInfo: LibrarySymbolInfo, resolution: ResolutionString, onTick: SubscribeBarsCallback, listenerGuid: string, onResetCacheNeededCallback: () => void): void; /** * The library calls this function when it doesn't want to receive updates anymore. * * @param listenerGuid id to unsubscribe from */ unsubscribeBars(listenerGuid: string): void; /** * The library calls this function when it wants to receive real-time symbol data in the [Depth of Market](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/depth-of-market) (DOM) widget. * Note that you should set the {@link BrokerConfigFlags.supportLevel2Data} configuration flag to `true`. * * @param symbol A SymbolInfo object * @param callback A function returning an object to update DOM data * @returns A unique identifier that will be used to unsubscribe from the data */ subscribeDepth?(symbol: string, callback: DOMCallback): string; /** * The library calls this function to stop receiving real-time updates for the [Depth of Market](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/depth-of-market) listener. * Note that you should set the {@link BrokerConfigFlags.supportLevel2Data} configuration flag to `true`. * * @param subscriberUID A string returned by `subscribeDepth` */ unsubscribeDepth?(subscriberUID: string): void; /** * The library calls this function to get the resolution that will be used to calculate the Volume Profile Visible Range indicator. * * Usually you might want to implement this method to calculate the indicator more accurately. * The implementation really depends on how much data you can transfer to the library and the depth of data in your data feed. * **Remark:** If this function is not provided the library uses currentResolution. * * @param currentResolution Resolution of the symbol * @param from Unix timestamp (leftmost visible bar) * @param to Unix timestamp (rightmost visible bar) * @param symbolInfo A Symbol object * @returns A resolution */ getVolumeProfileResolutionForPeriod?(currentResolution: ResolutionString, from: number, to: number, symbolInfo: LibrarySymbolInfo): ResolutionString; } interface IDestroyable { /** Clean up (destroy) any subscriptions, intervals, or other resources that this `IDestroyable` instance has. */ destroy(): void; } /** Dropdown menu API */ interface IDropdownApi { /** * Apply options to the dropdown menu. * Note that this method does not affect the menu's alignment. To change the alignment, you should remove and recreate the menu as follows: * * ```javascript * myCustomDropdownApi.remove(); * widget.createDropdown(optionsWithDifferentAlignment); * ``` * * @param {DropdownUpdateParams} options - Partial options for the dropdown menu */ applyOptions(options: DropdownUpdateParams): void; /** * Remove the dropdown menu. */ remove(): void; } /** * An API object that controls execution lines created with {@link IChartWidgetApi.createExecutionShape}. * For more information, refer to [Trading primitives](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Trading-Primitives). */ interface IExecutionLineAdapter { /** * Remove the execution line. This API object cannot be used after this call. */ remove(): void; /** * Get the price of the execution line. */ getPrice(): number; /** * Set the price of the execution line. * * @param value The new price. */ setPrice(value: number): this; /** * Get the time of the execution line. */ getTime(): number; /** * Set the time of the execution line. * * @param value The new time. */ setTime(value: number): this; /** * Get the direction of the execution line. */ getDirection(): Direction; /** * Set the direction of the execution line. * * @param value The new direction. */ setDirection(value: Direction): this; /** * Get the text of the execution line. */ getText(): string; /** * Set the text of the execution line. * * @param value The new text. */ setText(value: string): this; /** * Get the tooltip of the execution line. */ getTooltip(): string; /** * Set the tooltip of the execution line. * * @param value The new tooltip. */ setTooltip(value: string): this; /** * Get the arrow height of the execution line. */ getArrowHeight(): number; /** * Set the arrow height of the execution line. * * @param value The new arrow height. */ setArrowHeight(value: number): this; /** * Get the arrow spacing of the execution line. */ getArrowSpacing(): number; /** * Set the arrow spacing of the execution line. * * @param value The new arrow spacing. */ setArrowSpacing(value: number): this; /** * Get the font of the execution line. */ getFont(): string; /** * Set the font of the execution line. * * @param value The new font. */ setFont(value: string): this; /** * Get the text color of the execution line. */ getTextColor(): string; /** * Set the text color of the execution line. * * @param value The new text color. */ setTextColor(value: string): this; /** * Get the arrow color of the execution line. */ getArrowColor(): string; /** * Set the arrow color of the execution line. * * @param value The new arrow color. */ setArrowColor(value: string): this; } interface IExternalDatafeed { /** * This call is intended to provide the object filled with the configuration data. * The lib assumes that you will call the callback function and pass your datafeed {@link DatafeedConfiguration} as an argument. * * @param {OnReadyCallback} callback - callback to return your datafeed configuration ({@link DatafeedConfiguration}) to the library. */ onReady(callback: OnReadyCallback): void; } /** Definition of a formatter */ interface IFormatter { /** Whatever the input type, formats the data following a certain logic and return that value as a string */ format(value?: T, options?: FormatterFormatOptions): string; /** Check if the input value satisfies the logic and return either an error or the result of the parsing */ parse?(value: string, options?: FormatterParseOptions): ErrorFormatterParseResult | SuccessFormatterParseResult; } /** * Drawing API * * You can retrieve this interface by using the {@link IChartWidgetApi.getShapeById} method. */ interface ILineDataSourceApi { /** * Is the drawing selectable by the user. * @returns `true` when the drawing can be selected */ isSelectionEnabled(): boolean; /** * Set whether the drawing can be selected by the user or not. * @param {boolean} enable - if `true` then the user can select the drawing (see `disableSelection` option of `createMultipointShape`) */ setSelectionEnabled(enable: boolean): void; /** * Can the drawing be saved in the chart layout * @returns `true` when the drawing can be saved */ isSavingEnabled(): boolean; /** * Enables or disables saving of the drawing in the chart layout (see `disableSave` option of `createMultipointShape`). * @param {boolean} enable - if `true`, the drawing can be saved to the chart */ setSavingEnabled(enable: boolean): void; /** * Is the drawing shown in the Object Tree Panel * @returns `true` when the drawing is visible in the tree. */ isShowInObjectsTreeEnabled(): boolean; /** * Enables or disables the visibility of the drawing in the Object Tree panel * @param {boolean} enabled - if `true` then the drawing will be visible */ setShowInObjectsTreeEnabled(enabled: boolean): void; /** * Is the drawing editable by the user. * @returns `true` when the drawing is editable */ isUserEditEnabled(): boolean; /** * Enables or disables whether the drawing is editable * @param {boolean} enabled - if `true`, then the drawing will be editable */ setUserEditEnabled(enabled: boolean): void; /** * Places the drawing on top of all other chart objects. */ bringToFront(): void; /** * Places the drawing behind all other chart objects. */ sendToBack(): void; /** * Get all the properties of the drawing. * @param {PropertyKeyType} optionally specifies subset of properties to return. * @nopack some shapes line fib retracement could provide properties in a packed format (using arrays instead of objects). This flag allows controlling this. * @returns properties of the drawing */ getProperties

= Record>(target?: PropertyKeyType, nopack?: boolean): P; /** * Sets the properties of the drawing. * @param {object} newProperties - Drawing properties to be set on the drawing. It should have the same structure as an object from {@link ILineDataSourceApi.getProperties}. It can only include the properties that you want to override. * @param {boolean} saveDefaults - If `true`, the properties will be saved as defaults for the drawing. Defaults are used when the drawing is created. */ setProperties

= Record>(newProperties: P, saveDefaults?: boolean): void; /** * Returns the points of the drawing. */ getPoints(): PricedPoint[]; /** * Set the new points of the drawing. All points must be provided: for example if the drawing is defined by 5 points then all 5 must be provided. * * @param points - The new points. * */ setPoints(points: ShapePoint[]): void; /** * Get the position percents of a fixed drawing. */ getAnchoredPosition(): PositionPercents | undefined; /** * Set the position percents for a fixed drawing. * For example `setPoints([{ x: 0.1, y: 0.1 }])` would set a fixed drawing defined by * a single point to be 10% top the left edge of the chart and 10% from the top edge. * * @param positionPercents The new position percents. */ setAnchoredPosition(positionPercents: PositionPercents): void; } interface INewsApi { /** Refresh News */ refresh(): void; } interface INonSeriesStudyBarsResult { type: "non_series_bars"; /** * Non series bars */ bars: IBarArray[]; } interface INonSeriesStudyResult { /** Type is `non_series_data` */ type: "non_series_data"; /** Always true */ nonseries: true; /** Data */ data: object; } /** Specific formatter for number */ interface INumberFormatter extends IFormatter { /** Formatter for a number */ format(value?: number, options?: NumberFormatterFormatOptions): string; /** * Formatter for a price change * @param currentPrice - current price * @param prevPrice - previous price * @param options - format options */ formatChange?(currentPrice: number, prevPrice: number, options?: NumberFormatterFormatOptions): string; } interface IObservable { /** * Subscribe to changes * @param {(value:T)=>void} callback - callback function to be evoked when observed value changes */ subscribe(callback: ObservableCallback): void; /** * Unsubscribe from changes * @param {(value:T)=>void} callback - callback function to be unsubscribed */ unsubscribe(callback: ObservableCallback): void; } interface IObservableValue extends IBoxedValue, IObservable { } interface IObservableValueReadOnly extends IBoxedValueReadOnly, IObservable { } /** * An API object that controls order lines created with {@link IChartWidgetApi.createOrderLine}. * For more information, refer to [Trading primitives](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Trading-Primitives). */ interface IOrderLineAdapter { /** * Remove the order line. This API object cannot be used after this call. */ remove(): void; /** * Attach a callback to be executed when the order line is modified. * * @param callback Callback to be executed when the order line is modified. */ onModify(callback: () => void): this; /** * Attach a callback to be executed when the order line is modified. * * @param data Data to be passed to the callback. * @param callback Callback to be executed when the order line is modified. */ onModify(data: T, callback: (data: T) => void): this; /** * Attach a callback to be executed when the order line is moved. * * @param callback Callback to be executed when the order line is moved. */ onMove(callback: () => void): this; /** * Attach a callback to be executed when the order line is moved. * * @param data Data to be passed to the callback. * @param callback Callback to be executed when the order line is moved. */ onMove(data: T, callback: (data: T) => void): this; /** * Attach a callback to be executed while the order line is being moved. * * @param callback Callback to be executed while the order line is being moved. */ onMoving(callback: () => void): this; /** * Attach a callback to be executed while the order line is being moved. * * @param data Data to be passed to the callback. * @param callback Callback to be executed while the order line is being moved. */ onMoving(data: T, callback: (data: T) => void): this; /** * Attach a callback to be executed when the order line is cancelled. * * @param callback Callback to be executed when the order line is cancelled. */ onCancel(callback: () => void): this; /** * Attach a callback to be executed when the order line is cancelled. * * @param data Data to be passed to the callback. * @param callback Callback to be executed when the order line is cancelled. */ onCancel(data: T, callback: (data: T) => void): this; /** * Get the price of the order line. */ getPrice(): number; /** * Set the price of the order line. * * @param value The new price */ setPrice(value: number): this; /** * Get the text of the order line. */ getText(): string; /** * Set the text of the order line. * * @param value The new text */ setText(value: string): this; /** * Get the tooltip of the order line. */ getTooltip(): string; /** * Set the tooltip of the order line. * * @param value The new tooltip */ setTooltip(value: string): this; /** * Get the modify tooltip of the order line. */ getModifyTooltip(): string; /** * Set the modify tooltip of the order line. * * @param value The new modify tooltip */ setModifyTooltip(value: string): this; /** * Get the cancel tooltip of the order line. */ getCancelTooltip(): string; /** * Set the cancel tooltip of the order line. * * @param value The new cancel tooltip */ setCancelTooltip(value: string): this; /** * Get the quantity of the order line. */ getQuantity(): string; /** * Set the quantity of the order line. * * @param value The new quantity. */ setQuantity(value: string): this; /** * Get the editable flag value of the order line. */ getEditable(): boolean; /** * Set the editable of the order line. * * @param value The new editable. */ setEditable(value: boolean): this; /** * Get the cancellable flag value of the order line. */ getCancellable(): boolean; /** * Set the cancellable flag value of the order line. * * @param value The new cancellable flag value. */ setCancellable(value: boolean): this; /** * Get the extend left flag value of the order line. */ getExtendLeft(): boolean; /** * Set the extend left flag value of the order line. * * @param value The new extend left flag value. */ setExtendLeft(value: boolean): this; /** * Get the line length of the order line. */ getLineLength(): number; /** * Get the unit of length specified for the line length of the order line. */ getLineLengthUnit(): OrderLineLengthUnit; /** * Set the line length of the order line. * * If negative number is provided for the value and the unit is 'pixel' then * the position will be relative to the left edge of the chart. * * @param value The new line length. * @param [unit] - unit for the line length, defaults to 'percentage'. */ setLineLength(value: number, unit?: OrderLineLengthUnit): this; /** * Get the line style of the order line. */ getLineStyle(): number; /** * Set the line style of the order line. * * @param value The new line style. */ setLineStyle(value: number): this; /** * Get the line width of the order line. */ getLineWidth(): number; /** * Set the line width of the order line. * * @param value The new line width. */ setLineWidth(value: number): this; /** * Get the body font of the order line. */ getBodyFont(): string; /** * Set the body font of the order line. * * **Example** * ```javascript * orderLine.setPrice(170).setBodyFont("bold 12px Verdana") * ``` * * @param value The new body font. */ setBodyFont(value: string): this; /** * Get the quantity font of the order line. */ getQuantityFont(): string; /** * Set the quantity font of the order line. * * **Example** * ```javascript * orderLine.setPrice(170).setQuantityFont("bold 12px Verdana") * ``` * * @param value The new quantity font. */ setQuantityFont(value: string): this; /** * Get the line color of the order line. */ getLineColor(): string; /** * Set the line color of the order line. * * @param value The new line color. */ setLineColor(value: string): this; /** * Get the body border color of the order line. */ getBodyBorderColor(): string; /** * Set the body border color of the order line. * * @param value The new body border color. */ setBodyBorderColor(value: string): this; /** * Get the body background color of the order line. */ getBodyBackgroundColor(): string; /** * Set the body background color of the order line. * * @param value A color string in RGBA format for the body background color (e.g., `"rgba(255, 0, 0, 0.5)"`). */ setBodyBackgroundColor(value: string): this; /** * Get the body text color of the order line. */ getBodyTextColor(): string; /** * Set the body text color of the order line. * * @param value A simple color string for the body text (e.g., `"red"`, `"#FF0000"`). */ setBodyTextColor(value: string): this; /** * Get the quantity border color of the order line. */ getQuantityBorderColor(): string; /** * Set the quantity border color of the order line. * * @param value The new quantity border color. */ setQuantityBorderColor(value: string): this; /** * Get the quantity background color of the order line. */ getQuantityBackgroundColor(): string; /** * Set the quantity background color of the order line. * * @param value The new quantity background color. */ setQuantityBackgroundColor(value: string): this; /** * Get the quantity text color of the order line. */ getQuantityTextColor(): string; /** * Set the quantity text color of the order line. * * @param value A color string in RGBA format (e.g., `"rgba(255, 0, 0, 0.5)"`). */ setQuantityTextColor(value: string): this; /** * Get the cancel button border color of the order line. */ getCancelButtonBorderColor(): string; /** * Set the cancel button border color of the order line. * * @param value The new cancel button border color. */ setCancelButtonBorderColor(value: string): this; /** * Get the cancel button background color of the order line. */ getCancelButtonBackgroundColor(): string; /** * Set the cancel button background color of the order line. * * @param value A color string in RGBA format for the cancel button background color (e.g., `"rgba(255, 0, 0, 0.5)"`). */ setCancelButtonBackgroundColor(value: string): this; /** * Get the cancel button icon color of the order line. */ getCancelButtonIconColor(): string; /** * Set the cancel button icon color of the order line. * * @param value The new cancel button icon color. */ setCancelButtonIconColor(value: string): this; } /** * You can retrieve this interface by using the {@link IChartWidgetApi.getPanes} method */ interface IPaneApi { /** Returns `true` if the price scale contains the main series */ hasMainSeries(): boolean; /** * Returns an array of the PriceScaleApi instances that allows interaction with right price scales. * The array may be empty if there is not any price scale on the left side of the pane */ getLeftPriceScales(): readonly IPriceScaleApi[]; /** * Returns an array of the PriceScaleApi instances that allows interaction with right price scales. * The array may be empty if there is not any price scale on the right side of the pane */ getRightPriceScales(): readonly IPriceScaleApi[]; /** * Returns an instance of the PriceScaleApi that allows you to interact with the price scale of the main source * or `null` if the main source is not attached to any price scale (it is in 'No Scale' mode) */ getMainSourcePriceScale(): IPriceScaleApi | null; /** * Returns an instance of the PriceScaleApi that allows you to interact with the price scale of the main source * or `null` if the main source is not attached to any price scale (it is in 'No Scale' mode) */ getPriceScaleById(priceScaleId: string): IPriceScaleApi | null; /** Returns the pane's height */ getHeight(): number; /** Sets the pane's height */ setHeight(height: number): void; /** Moves the pane to a new position, `paneIndex` should be a number between 0 and all panes count - 1 */ moveTo(paneIndex: number): void; /** Returns the pane's index, it's a number between 0 and all panes count - 1 */ paneIndex(): number; /** Collapse the current pane */ collapse(): void; /** Restore the size of a previously collapsed pane */ restore(): void; /** Returns the pane's collapsed state */ isCollapsed(): boolean; /** Change the maximized state of the pane */ setMaximized(value: boolean): void; /** Returns the maximized state of the pane */ isMaximized(): boolean; } interface IPineSeries { /** * Get the value at a specific index. * * Note: The indices of a pine series is opposite. * * Example: * - s.get(1) returns second last, * - s.get(2) - third last * - and so on * @param {number} [n] - index */ get(n?: number): number; /** * Set the value for the pine series at the current index interation. * @param {number} value - value to be set */ set(value: number): void; /** * Get the index for the bar at the specified timestamp * @param {number} time - timestamp */ indexOf(time: number): number; /** * Map some values from one time scale to another. * * @param source Source times. * @param destination Destination times. * @param mode Adopt mode. `0` for continuous, `1` for precise. * * In continuous mode (`0`) every source time will be mapped to a destination time if one exists. Multiple source times may be mapped to the same destination time. * * In precise mode (`1`) every source time will be mapped to a destination time AT MOST ONCE if one exists. Some source times may not be mapped. * * @example * ```javascript * // A pine series with values [5, 5] * const sourceTimes = ctx.new_var(); * // A pine series with values [4, 5] * const destinationTimes = ctx.new_var(); * // A pine series with values [1, 2] * const values = ctx.new_var(); * * // Creates a pine series with values [2, 2] * const adopted1 = values.adopt(sourceTimes, destinationTimes, 0); * * // Creates a pine series with values [NaN, 2] * const adopted2 = values.adopt(sourceTimes, destinationTimes, 1); * ``` * * @example * * Pseudocode of the adopt algorithm: * * ``` * adopt(sourceSeries, destinationSeries, mode) = * destinationValue = most recent value in destinationSeries * sourceIndex = index of destinationValue in sourceSeries * * if mode equals 1 then * previousDestinationValue = second most recent value in destinationSeries * previousSourceIndex = index of previousDestinationValue in sourceSeries * * if sourceIndex equals previousSourceIndex * return NaN * * return value at sourceIndex * ``` */ adopt(source: IPineSeries, destination: IPineSeries, mode: 0 | 1): number; } /** * An API object that controls position lines created with {@link IChartWidgetApi.createPositionLine}. * For more information, refer to [Trading primitives](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Trading-Primitives). */ interface IPositionLineAdapter { /** * Remove the position line. This API object cannot be used after this call. */ remove(): void; /** * Attach a callback to be executed when the position line is closed. * * @param callback Callback to be executed when the position line is closed. */ onClose(callback: () => void): this; /** * Attach a callback to be executed when the position line is closed. * * @param data Data to be passed to the callback. * @param callback Callback to be executed when the position line is closed. */ onClose(data: T, callback: (data: T) => void): this; /** * Attach a callback to be executed when the position line is modified. * * @param callback Callback to be executed when the position line is modified. */ onModify(callback: () => void): this; /** * Attach a callback to be executed when the position line is modified. * * @param data Data to be passed to the callback. * @param callback Callback to be executed when the position line is modified. */ onModify(data: T, callback: (data: T) => void): this; /** * Attach a callback to be executed when the position line is reversed. * * @param callback Callback to be executed when the position line is reversed. */ onReverse(callback: () => void): this; /** * Attach a callback to be executed when the position line is reversed. * * @param data Data to be passed to the callback. * @param callback Callback to be executed when the position line is reversed. */ onReverse(data: T, callback: (data: T) => void): this; /** * Get the price of the position line. */ getPrice(): number; /** * Set the price of the position line. * * @param value The new price. */ setPrice(value: number): this; /** * Get the text of the position line. */ getText(): string; /** * Set the text of the position line. * * @param value The new text. */ setText(value: string): this; /** * Get the tooltip of the position line. */ getTooltip(): string; /** * Set the tooltip of the position line. * * @param value The new tooltip. */ setTooltip(value: string): this; /** * Get the protect tooltip of the position line. */ getProtectTooltip(): string; /** * Set the protect tooltip of the position line. * * @param value The new protect tooltip. */ setProtectTooltip(value: string): this; /** * Get the close tooltip of the position line. */ getCloseTooltip(): string; /** * Set the close tooltip of the position line. * * @param value The new close tooltip. */ setCloseTooltip(value: string): this; /** * Get the reverse tooltip of the position line. */ getReverseTooltip(): string; /** * Set the reverse tooltip of the position line. * * @param value The new reverse tooltip. */ setReverseTooltip(value: string): this; /** * Get the quantity of the position line. */ getQuantity(): string; /** * Set the quantity of the position line. * * @param value The new quantity. */ setQuantity(value: string): this; /** * Get the extend left flag value of the position line. */ getExtendLeft(): boolean; /** * Set the extend left flag value of the position line. * @param value The new extend left flag value. */ setExtendLeft(value: boolean): this; /** * Get the unit of length specified for the line length of the position line. */ getLineLengthUnit(): PositionLineLengthUnit; /** * Get the line length of the position line. */ getLineLength(): number; /** * Set the line length of the position line. * * If negative number is provided for the value and the unit is 'pixel' then * the position will be relative to the left edge of the chart. * * @param value The new line length. * @param [unit] - unit for the line length, defaults to 'percentage'. */ setLineLength(value: number, unit?: PositionLineLengthUnit): this; /** * Get the line style of the position line. */ getLineStyle(): number; /** * Set the line style of the position line. * @param value The new line style. */ setLineStyle(value: number): this; /** * Get the line width of the position line. */ getLineWidth(): number; /** * Set the line width of the position line. * @param value The new line width. */ setLineWidth(value: number): this; /** * Get the body font of the position line. */ getBodyFont(): string; /** * Set the body font of the position line. * * **Example** * ```javascript * positionLine.setPrice(170).setBodyFont("bold 12px Verdana") * ``` * * @param value The new body font. */ setBodyFont(value: string): this; /** * Get the quantity font of the position line. */ getQuantityFont(): string; /** * Set the quantity font of the position line. * * **Example** * ```javascript * positionLine.setPrice(170).setQuantityFont("bold 12px Verdana") * ``` * * @param value The new quantity font. */ setQuantityFont(value: string): this; /** * Get the line color of the position line. */ getLineColor(): string; /** * Set the line color of the position line. * @param value The new line color. */ setLineColor(value: string): this; /** * Get the body border color of the position line. */ getBodyBorderColor(): string; /** * Set the body border color of the position line. * @param value The new body border color. */ setBodyBorderColor(value: string): this; /** * Get the body background color of the position line. */ getBodyBackgroundColor(): string; /** * Set the body background color of the position line. * @param value A color string in RGBA format for the body background color (e.g., `"rgba(255, 0, 0, 0.5)"`). */ setBodyBackgroundColor(value: string): this; /** * Get the body text color of the position line. */ getBodyTextColor(): string; /** * Set the body text color of the position line. * @param value A simple color string for the body text (e.g., `"red"`, `"#FF0000"`). */ setBodyTextColor(value: string): this; /** * Get the quantity border color of the position line. */ getQuantityBorderColor(): string; /** * Set the quantity border color of the position line. * * @param value The new quantity border color. */ setQuantityBorderColor(value: string): this; /** * Get the quantity background color of the position line. */ getQuantityBackgroundColor(): string; /** * Set the quantity background color of the position line. * * @param value The new quantity background color. */ setQuantityBackgroundColor(value: string): this; /** * Get the quantity text color of the position line. */ getQuantityTextColor(): string; /** * Set the quantity text color of the position line. * * @param value A color string in RGBA format (e.g., `"rgba(255, 0, 0, 0.5)"`). */ setQuantityTextColor(value: string): this; /** * Get the reverse button border color of the position line. */ getReverseButtonBorderColor(): string; /** * Set the reverse button border color of the position line. * @param value The new reverse button border color. */ setReverseButtonBorderColor(value: string): this; /** * Get the reverse button background color of the position line. */ getReverseButtonBackgroundColor(): string; /** * Set the reverse button background color of the position line. * @param value A color string in RGBA format for the reverse button background color (e.g., `"rgba(255, 0, 0, 0.5)"`). */ setReverseButtonBackgroundColor(value: string): this; /** * Get the reverse button icon color of the position line. */ getReverseButtonIconColor(): string; /** * Set the reverse button icon color of the position line. * @param value The new reverse button icon color. */ setReverseButtonIconColor(value: string): this; /** * Get the close button border color of the position line. */ getCloseButtonBorderColor(): string; /** * Set the close button border color of the position line. * @param value The new close button border color. */ setCloseButtonBorderColor(value: string): this; /** * Get the close button background color of the position line. */ getCloseButtonBackgroundColor(): string; /** * Set the close button background color of the position line. * @param value The new close button background color. */ setCloseButtonBackgroundColor(value: string): this; /** * Get the close button icon color of the position line. */ getCloseButtonIconColor(): string; /** * Set the close button icon color of the position line. * @param value The new close button icon color. */ setCloseButtonIconColor(value: string): this; } /** * The Price Scale API allows interacting with the [price scale](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Price-Scale). * You can retrieve this interface by evoking the following methods of the {@link IPaneApi}: * - `getLeftPriceScales` * - `getRightPriceScales` * - `getMainSourcePriceScale` */ interface IPriceScaleApi { /** Returns current mode of the price scale */ getMode(): PriceScaleMode; /** * Changes current mode of the price scale * @param newMode new mode to set for the price scale */ setMode(newMode: PriceScaleMode): void; /** Returns whether the price scale is inverted or not */ isInverted(): boolean; /** * Changes current inverted state of the price scale * @param isInverted set to `true` if the price scale should become inverted */ setInverted(isInverted: boolean): void; /** * Returns `true` when the price scale is locked */ isLocked(): boolean; /** * Set whether the price scale should be locked or not * @param {boolean} isLocked - set to `true` to lock the price scale */ setLocked(isLocked: boolean): void; /** * Returns `true` when the price scale has auto scaling enabled */ isAutoScale(): boolean; /** * Set whether auto scaling should be enabled or not for the price scale * @param {boolean} isAutoScale - set to `true` to enable auto scaling */ setAutoScale(isAutoScale: boolean): void; /** * Returns current visible price range of the price scale. * The result is an object with `from` and `to`, * which are the boundaries of the price scale visible range. */ getVisiblePriceRange(): VisiblePriceRange | null; /** * Sets current visible price range of the price scale, * @param range an object with `from` and `to`, which are the boundaries of the price scale visible range. */ setVisiblePriceRange(range: VisiblePriceRange): void; /** Returns `true` if the price scale contains the main series */ hasMainSeries(): boolean; /** Returns an array of IDs of all studies attached to the price scale */ getStudies(): EntityId[]; /** Returns the current currency set on the [price scale](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Price-Scale). Returns `null` if no currency is specified. */ currency(): CurrencyInfo | null; /** * Sets a currency on the price scale. * @param {string|null} currency - currency supported by your backend (for example 'EUR', 'USD'). A null value will reset the currency to default. */ setCurrency(currency: string | null): void; /** Returns the current unit set on the [price scale](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Price-Scale). Returns `null` if no unit is specified. */ unit(): UnitInfo | null; /** * Sets a unit on the price scale. * @param {string|null} unit - unit supported by your backend (for example 'weight', 'energy'). A null value will reset the unit to default. */ setUnit(unit: string | null): void; } interface IProjectionStudyResult { /** array of projection bars */ bars: IProjectionBar[]; /** always true */ nonseries?: boolean; /** last price displayed on price scale */ price?: number; /** always projection */ type: "projection"; /** box size is displayed in the legend */ boxSize?: number; /** reversal amount is displayed in the legend */ reversalAmount?: number; projectionTime?: number; } /** * Allows you to select entities ([drawings](https://www.tradingview.com/charting-library-docs/latest/ui_elements/drawings/) and [indicators](https://www.tradingview.com/charting-library-docs/latest/ui_elements/indicators/)) on the chart. Consider the following example: * * ```js * var chart = tvWidget.activeChart(); * // Prints all selection changes to the console * chart.selection().onChanged().subscribe(null, s => console.log(chart.selection().allSources())); * // Creates an indicator and saves its ID * var studyId = chart.createStudy("Moving Average", false, false, { length: 10 }); * // Adds the indicator to the selection ([] is printed to the console) * chart.selection().add(studyId); * // Clears the selection ([] is printed to the console) * chart.selection().clear(); * ``` * * #### Multiple Selection * * Multiple selection has the following specifics: * * - Either indicators or drawings can be selected at the same time. * - If you add an indicator to the selection, other entities are removed from it. * - Adding an array of objects to the selection works the same as adding these objects one by one. */ interface ISelectionApi { /** * Add entity / entities to selection * @param {EntityId[]|EntityId} entities - entities to be added to selection */ add(entities: EntityId[] | EntityId): void; /** * Set entity / entities as the selection * @param {EntityId[]|EntityId} entities - entities to be selected */ set(entities: EntityId[] | EntityId): void; /** * Remove entities from the selection * @param {EntityId[]} entities - entities to be removed from the selection */ remove(entities: EntityId[]): void; /** * Does the selection contain the entity * @param {EntityId} entity - entity to be checked * @returns `true` when entity is in the selection */ contains(entity: EntityId): boolean; /** * Returns all the entities in the selection */ allSources(): EntityId[]; /** * Is the selection empty * @returns `true` when empty */ isEmpty(): boolean; /** * Clear selection */ clear(): void; /** * Subscription for selection changes. */ onChanged(): ISubscription<() => void>; /** * Whether the entity can be added to the selection * @param {EntityId} entity - entity to be checked * @returns `true` when entity can be added to the selection */ canBeAddedToSelection(entity: EntityId): boolean; } /** * Series API * * You can retrieve this interface by using the {@link IChartWidgetApi.getSeries} method */ interface ISeriesApi { /** Returns `true` if a user is able to remove/change/hide the main series */ isUserEditEnabled(): boolean; /** * Enables or disables removing/changing/hiding the main series by the user */ setUserEditEnabled(enabled: boolean): void; /** Moves the main series to the pane above. Note that this method works only if the pane exists. */ mergeUp(): void; /** Moves the main series to the pane below. Note that this method works only if the pane exists. */ mergeDown(): void; /** Moves the main series to a **new** pane above. Note that this method does not work if the main series is the only series on the current pane. */ unmergeUp(): void; /** Moves the main series to a **new** pane below. Note that this method does not work if the main series is the only series on the current pane. */ unmergeDown(): void; /** Pins the main series to a new price axis at right */ detachToRight(): void; /** Pins the main series to a new price axis at left */ detachToLeft(): void; /** Makes the main series to be an overlay source */ detachNoScale(): void; /** Changes the price scale of the main series */ changePriceScale(newPriceScale: SeriesPriceScale): void; /** Returns `true` if the main series is visible */ isVisible(): boolean; /** Shows/hides the main series */ setVisible(visible: boolean): void; /** Places main series on top of all other chart objects */ bringToFront(): void; /** Places main series behind all other chart objects */ sendToBack(): void; /** Value that is returned when a study is created via API */ entityId(): EntityId; /** Returns properties for a specific chart style */ chartStyleProperties(chartStyle: T): SeriesPreferencesMap[T]; /** Sets properties for a specific chart style */ setChartStyleProperties(chartStyle: T, newPrefs: DeepPartial): void; } /** * Drawing Groups API. Refer to the [Drawings API](https://www.tradingview.com/charting-library-docs/latest/ui_elements/drawings/drawings-api#drawing-groups-api) article for more information. */ interface IShapesGroupControllerApi { /** * Create a group of drawings from the selection. * * @throws If selection is empty, or selection contains non-drawings, or selection contains drawings from more than one pane. * @return The ID of the created group. */ createGroupFromSelection(): ShapesGroupId; /** * Remove a group of drawings. * * @param groupId A group ID. */ removeGroup(groupId: ShapesGroupId): void; /** * Get an array of all drawing groups. * * @returns An array of group IDs. */ groups(): readonly ShapesGroupId[]; /** * Get an array of IDs for each drawing in a group. * * @param groupId A group ID. * @returns An array of drawing IDs. */ shapesInGroup(groupId: ShapesGroupId): readonly EntityId[]; /** * Remove a drawing from a group. If the drawing is the only drawing in the group then the group is also removed. * * @param groupId A group ID. * @param shapeId A drawing ID. */ excludeShapeFromGroup(groupId: ShapesGroupId, shapeId: EntityId): void; /** * Add a drawing to a group. * * @param groupId A group ID. * @param shapeId A drawing ID. */ addShapeToGroup(groupId: ShapesGroupId, shapeId: EntityId): void; /** * Get an object containing the available Z-order operations for a group. * * @param groupId A group ID. * @returns The available Z-order operations. */ availableZOrderOperations(groupId: ShapesGroupId): AvailableZOrderOperations; /** * Move the group to the top of the Z-order. * * @param groupId A group ID. */ bringToFront(groupId: ShapesGroupId): void; /** * Move the group to the bottom of the Z-order. * * @param groupId A group ID. */ sendToBack(groupId: ShapesGroupId): void; /** * Move the group one level up in the Z-order. * * @param groupId A group ID. */ bringForward(groupId: ShapesGroupId): void; /** * Move the group one level down in the Z-order. * * @param groupId A group ID. */ sendBackward(groupId: ShapesGroupId): void; /** * Move the group immediately below the target in the Z-order. * * @param groupId A group ID. * @param target A target ID. */ insertAfter(groupId: ShapesGroupId, target: ShapesGroupId | EntityId): void; /** * Move the group immediately above the target in the Z-order. * * @param groupId A group ID. * @param target A target ID. */ insertBefore(groupId: ShapesGroupId, target: ShapesGroupId | EntityId): void; /** * Show or hide all drawings in a group. * * @param groupId A group ID. * @param value A boolean flag. `true` to show, `false` to hide. */ setGroupVisibility(groupId: ShapesGroupId, value: boolean): void; /** * Get the visibility state of a group. * * @param groupId A group ID. * @returns The visibility state. */ groupVisibility(groupId: ShapesGroupId): GroupVisibilityState; /** * Lock or unlock a group. * * @param groupId A group ID. * @param value A boolean flag. `true` to lock, `false` to unlock. */ setGroupLock(groupId: ShapesGroupId, value: boolean): void; /** * Get locked state of a group. * * @param groupId A group ID. * @returns The locked state. */ groupLock(groupId: ShapesGroupId): GroupLockState; /** * Get the name of a group. * * @param groupId A group ID. * @returns The name of the group. */ getGroupName(groupId: ShapesGroupId): string; /** * Set the name of a group. Names do not need to be unique. * * @param groupId A group ID. * @param name The new name of the group. */ setGroupName(groupId: ShapesGroupId, name: string): void; /** * Check if some drawings can be grouped. * * @param shapes An array of drawing IDs. * @return `true` if the drawings can be grouped, `false` otherwise. */ canBeGroupped(shapes: readonly EntityId[]): boolean; } /** * API object for interacting with a study. * * You can retrieve this interface by using the {@link IChartWidgetApi.getStudyById} method */ interface IStudyApi { /** * Get if user editing is enabled for the study. * * @returns `true` if editing is enabled, `false` otherwise. */ isUserEditEnabled(): boolean; /** * Set if user editing is enabled for the study. * * @param enabled `true` if editing should be enabled, `false` otherwise. */ setUserEditEnabled(enabled: boolean): void; /** * Get descriptions of the study inputs. */ getInputsInfo(): StudyInputInformation[]; /** * Get current values of the study inputs. */ getInputValues(): StudyInputValueItem[]; /** * Set the value of one or more study inputs. * * @param values Study input values to set. */ setInputValues(values: StudyInputValueItem[]): void; /** * Get descriptions of study styles. */ getStyleInfo(): StudyStyleInfo; /** * Get current values of the study styles. */ getStyleValues(): StudyStyleValues; /** * Moves the indicator to the pane above. Note that this method works only if the pane exists. */ mergeUp(): void; /** * Moves the indicator to the pane below. Note that this method works only if the pane exists. */ mergeDown(): void; /** * Moves the indicator to a **new** pane above. Note that this method does not work if the indicator is the only series on the current pane. */ unmergeUp(): void; /** * Moves the indicator to a **new** pane below. Note that this method does not work if the indicator is the only series on the current pane. */ unmergeDown(): void; /** * Get the index of the pane that the study is attached to. * * @returns The pane index. */ paneIndex(): number; /** * Change the price scale that the study is attached to. * * @param newPriceScale Price scale identifier, or the ID of another study whose price scale the study should be moved to. */ changePriceScale(newPriceScale: StudyPriceScale | EntityId): void; /** * Get if the study is visible. * * @returns `true` if visible, `false` otherwise. */ isVisible(): boolean; /** * Set the study visibility. * * @param visible `true` if the study should be visible, `false` otherwise. */ setVisible(visible: boolean): void; /** * Move the study visually in front of all other chart objects. */ bringToFront(): void; /** * Move the study visually behind of all other chart objects. */ sendToBack(): void; /** * Override one or more of the indicator's properties. * Refer to [Indicator Overrides](https://www.tradingview.com/charting-library-docs/latest/customization/overrides/indicator-overrides#change-the-existing-indicator) for more information. * Overrides for built-in indicators are listed in {@link SingleIndicatorOverrides}. * * @param overrides Property values to override. */ applyOverrides>(overrides: TOverrides): void; /** * Copies the study to all charts in the layout. * Only applicable to multi-chart layouts (Trading Platform). */ applyToEntireLayout(): Promise; /** * Get a subscription that can be used to subscribe a callback when the study data has loaded. * * @returns A subscription. * * Example: * ```javascript * studyApi.onDataLoaded().subscribe( * null, * () => console.log('Study data is loaded'), * true * ); * ``` */ onDataLoaded(): ISubscription<() => void>; /** * Get a subscription that can be used to subscribe a callback when the study has an error. * * @returns A subscription. * * Example: * ```javascript * studyApi.studyApi.onStudyError().subscribe( * null, * () => console.log('Study error'), * true * ); * ``` */ onStudyError(): ISubscription<() => void>; } /** * A subscription. Used to subscribe callbacks to events. */ interface ISubscription { /** * Subscribe a callback function to this event. Subscribed callbacks are called when the event fires. * * @param obj Object used as the `this` value bound to the callback function. * @param member Function called when the event is fired. * @param singleshot `true` if the subscription should be automatically removed after the first time it is fired. * * @example * ``` * // Log 'Series data loaded!' to the console the next time the data loaded event fires and then unsubscribe automatically. * seriesApi.onDataLoaded().subscribe(null, () => { console.log('Series data loaded!'); }, true); * ``` * Subscribe to an event within a class. Manually unsubscribe when some condition is true. * ``` * class Example { * constructor(seriesApi) { * this._seriesApi = seriesApi; * this._seriesApi.onDataLoaded().subscribe(this, this._onDataLoaded); * } * * _onDataLoaded() { * // Do something in response to the event. * * if (someUnsubscribeCondition) { * this._seriesApi.onDataLoaded().unsubscribe(this, this._onDataLoaded); * } * } * } * ``` */ subscribe(obj: object | null, member: TFunc, singleshot?: boolean): void; /** * Unsubscribe a previously subscribed callback function. * It is important that the `obj` and `member` arguments are the same as the ones passed when the callback was subscribed. * * @param obj Object passed as the `this` value when the callback was subscribed. * @param member Function subscribed to the event. */ unsubscribe(obj: object | null, member: TFunc): void; /** * Unsubscribe all callbacks that were subscribed with the same `obj` value. * * @param obj `obj` value passed when the callbacks were subscribed. * @example * ``` * // Unsubscribe all three callback functions at once in the `destroy` method. * class Example { * constructor(seriesApi) { * this._seriesApi = seriesApi; * this._seriesApi.onDataLoaded().subscribe(this, this._callback1); * this._seriesApi.onDataLoaded().subscribe(this, this._callback2); * this._seriesApi.onDataLoaded().subscribe(this, this._callback3); * } * * destroy() { * this._seriesapi.onDataLoaded().unsubscribeAll(this); * } * * _callback1() { ... } * _callback2() { ... } * _callback3() { ... } * } * ``` */ unsubscribeAll(obj: object | null): void; } /** * PineJS execution context symbol information. */ interface ISymbolInstrument { /** Period Base */ periodBase: string; /** Ticker ID */ tickerid: string; /** Currency Code */ currencyCode?: string | null; /** Unit ID */ unitId?: string | null; /** Bar resolution */ period: ResolutionString; /** Index */ index: number; /** Time */ time: number; /** Open bar value */ open: number; /** High bar value */ high: number; /** Low bar value */ low: number; /** Close bar value */ close: number; /** Bar Volume value */ volume: number; /** Time of the update */ updatetime: number; /** Ticker */ ticker: string; /** Resolution */ resolution: string; /** Interval */ interval: number; /** Minimum tick amount */ minTick: number; /** Whether this is the first bar */ isFirstBar: boolean; /** Whether this is the last bar */ isLastBar: boolean; /** Whether this is a new bar */ isNewBar: boolean; /** Whether the bar is closed */ isBarClosed: boolean; /** Symbol information */ info?: LibrarySymbolInfo; /** * Time of the bar. * * @returns the timestamp in milliseconds */ bartime(): number; /** * @returns true if the bar resolution is day/week/month, false if it is intraday */ isdwm(): boolean; } /** * API object for interacting with the [time scale](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Time-Scale). * * You can retrieve this interface by using the {@link IChartWidgetApi.getTimeScale} method */ interface ITimeScaleApi { /** Returns the time associated to a given coordinate (distance in pixels from the leftmost visible bar) */ coordinateToTime(x: number): number | null; /** * Users will be notified every time `barSpacing` value is changed. This typically occurs when zooming in/out on the chart. * This is to detect when the chart has been zoomed in/out */ barSpacingChanged(): ISubscription<(newBarSpacing: number) => void>; /** * Users will be notified every time `rightOffset` value is changed. * This is to detect when the chart has been scrolled left/right. */ rightOffsetChanged(): ISubscription<(rightOffset: number) => void>; /** To set a new right offset */ setRightOffset(offset: number): void; /** Sets a new [bar spacing](https://www.tradingview.com/charting-library-docs/latest/getting_started/glossary#bar-spacing). You can call {@link barSpacing} to get the current value. */ setBarSpacing(newBarSpacing: number): void; /** Returns the current [bar spacing](https://www.tradingview.com/charting-library-docs/latest/getting_started/glossary#bar-spacing). */ barSpacing(): number; /** Returns the current right offset */ rightOffset(): number; /** Returns the current width of the chart in pixels */ width(): number; /** Object that can be used to read/set/watch the default right offset (margin) */ defaultRightOffset(): IWatchedValue; /** Object that can be used to read/set/watch the default right offset (in percent) (margin) */ defaultRightOffsetPercentage(): IWatchedValue; /** * Object that can be used to read/set/watch whether to use `defaultRightOffset` or `defaultRightOffsetPercentage` * option for the right offset (margin). * - `false`: use `defaultRightOffset` * - `true`: use `defaultRightOffsetPercentage` * * Default: `false` */ usePercentageRightOffset(): IWatchedValue; } interface ITimezoneApi { /** Array of supported TimezoneInfo */ availableTimezones(): readonly TimezoneInfo[]; /** Returns the current TimezoneInfo */ getTimezone(): TimezoneInfo; /** Sets the current timezone */ setTimezone(timezone: TimezoneId | CustomTimezoneId, options?: UndoOptions): void; /** * To be notified when the timezone is changed * * Example: * ```javascript * timezoneApi.onTimezoneChanged().subscribe( * null, * timezone => console.log(`New timezone: ${timezone}`), * true * ); * ``` */ onTimezoneChanged(): ISubscription<(timezone: TimezoneId) => void>; } /** * An API object for interacting with the [Watchlist](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Watch-List) widget. * The Watchlist is a widget that allows users to track price movements and volume of specific financial instruments in real-time. * Watchlists also allow users to quickly switch between the symbols. * The Watchlist widget is displayed on the widget panel on the right side of the chart. * * **Notes about watchlist contents** * * Watchlist items should be symbol names which your datafeed [`resolveSymbol`](https://www.tradingview.com/charting-library-docs/latest/connecting_data/datafeed-api/required-methods#resolvesymbol) method can resolve. This * means that generally shorter names such as `AAPL` can be used if your datafeed understands it. However, * it is recommend that you provide the symbol names as they appear within the `LibrarySymbolInfo` object, for * example, `NASDAQ:AAPL`. */ interface IWatchListApi { /** * Get a default list of symbols. * @returns default list of symbols */ defaultList(): string[]; /** * Get a list of symbols. * If the `id` parameter is not provided, the current list will be returned. If there is no watchList, `null` will be returned. * @param {string} [id] - Watchlist ID * @returns list of symbols for watchlist */ getList(id?: string): string[] | null; /** * Get all watchlists. If there is no WatchList then `null` will be returned. * @returns object of all watchlists */ getAllLists(): WatchListSymbolListMap | null; /** * Make the watchlist with the specified `id` active. * @param {string} id - watchlist ID */ setActiveList(id: string): void; /** * Get the ID of the current watchlist. If there is no WatchList then `null` will be returned. * @returns id of active watchlist */ getActiveListId(): string | null; /** * **Obsolete. Use `updateList` instead.** * * Set the list of symbols for the watchlist. It will replace the entire list. * @param {string[]} symbols - symbol IDs */ setList(symbols: string[]): void; /** * Edit the list of symbols for a watchlist. * @param {string} listId - ID of the watchlist * @param {string[]} symbols - Symbols to be set for the watchlist. Any list item that has the `###` prefix is considered a section divider in the watchlist. */ updateList(listId: string, symbols: string[]): void; /** * Rename the watchlist. * @param {string} listId - ID of the watchlist * @param {string} newName - New name to set for the watchlist */ renameList(listId: string, newName: string): void; /** * Create a list of symbols with `listName` name. If the `listName` parameter is not provided or there is no WatchList then `null` will be returned; * @param {string} [listName] - name for the watchlist * @param {string[]} [symbols] - Symbol IDs for the watchlist. Any list item that has the `###` prefix is considered a section divider in the watchlist. * @returns WatchListSymbolList */ createList(listName?: string, symbols?: string[]): WatchListSymbolList | null; /** * Save a list of symbols. * @param {WatchListSymbolList} list * @returns If there is no watchList or an equivalent list already exists, `false` will be returned. Otherwise, `true` will be returned. */ saveList(list: WatchListSymbolList): boolean; /** * Delete a watchlist of symbols * @param {string} listId - watchlist ID */ deleteList(listId: string): void; /** * Subscription for when the symbols of the active watchlist are changed. Use the `subscribe` method of the returned {@link ISubscription} object to subscribe to the notifications. */ onListChanged(): ISubscription; /** * Subscription for when the active watchlist is changed to a different list. Use the `subscribe` method of the returned {@link ISubscription} object to subscribe to the notifications. */ onActiveListChanged(): ISubscription; /** * Subscription for when a new list is added to the watchlist widget. Use the `subscribe` method of the returned {@link ISubscription} object to subscribe to the notifications. */ onListAdded(): ISubscription; /** * Subscription for when a list is removed from the watchlist widget. Use the `subscribe` method of the returned {@link ISubscription} object to subscribe to the notifications. */ onListRemoved(): ISubscription; /** * Subscription for when a list is renamed. Use the `subscribe` method of the returned {@link ISubscription} object to subscribe to the notifications. */ onListRenamed(): ISubscription; } interface IWatchedValue extends IWatchedValueReadonly, IObservableValue { /** * Set value for the watched value * @param {T} value - value to set * @param {boolean} [forceUpdate] - force an update */ setValue(value: T, forceUpdate?: boolean): void; /** @inheritDoc */ subscribe(callback: WatchedValueCallback, options?: WatchedValueSubscribeOptions): void; /** @inheritDoc */ unsubscribe(callback?: WatchedValueCallback | null): void; } interface IWatchedValueReadonly extends IObservableValueReadOnly { /** * Subscribe to watched value changes * @param {(value:T)=>void} callback - callback to be evoked when change occurs * @param {WatchedValueSubscribeOptions} [options] - watch subscriber options */ subscribe(callback: (value: T) => void, options?: WatchedValueSubscribeOptions): void; /** * Unsubscribe to watched value changes * @param {((value:T)=>void)|null} [callback] - callback to remove */ unsubscribe(callback?: ((value: T) => void) | null): void; /** * A simplified version of subscription, with promise-like interface, generally for using with boolean-valued watched values * @param {WatchedValueCallback} callback - a function to be called when the value became `true`. `once` and `callWithLast` are implicitly set to true. */ when(callback: WatchedValueCallback): void; } /** * An API object used to change the settings of the [watermark](https://www.tradingview.com/charting-library-docs/latest/ui_elements/watermarks). */ interface IWatermarkApi { /** * Object that can be used to read/set/watch the color of the watermark text. */ color(): IWatchedValue; /** * Object that can be used to read/set/watch the visibility of the watermark. * @deprecated use ticker/resolution/description visibility instead */ visibility(): IWatchedValue; /** * Object that can be used to read/set/watch the visibility of the watermark's ticker part. */ tickerVisibility(): IWatchedValue; /** * Object that can be used to read/set/watch the visibility of the watermark's interval part. */ intervalVisibility(): IWatchedValue; /** * Object that can be used to read/set/watch the visibility of the watermark's description part. */ descriptionVisibility(): IWatchedValue; /** * Object that can be used to read/set/watch the visibility of the watermark provider by WatermarkContentProvider. */ customVisibility(): IWatchedValue; /** * Set a custom content provider for the watermark content. * Set any part visible to turn custom watermark visibility on. * * @param provider - Custom watermark content provider, use `null` if you would like to revert back to the default content for the watermark. */ setContentProvider(provider: WatermarkContentProvider | null): void; /** * Returns the current watermark content provider. */ provider(): IWatchedValueReadonly; } /** * Widget Bar API */ interface IWidgetbarApi extends IDestroyable { /** * Show page * @param {PageName} pageName - name of page to show */ showPage(pageName: PageName): void; /** * Hide page * @param {PageName} pageName - name of page to hide */ hidePage(pageName: PageName): void; /** * Checks if page is visible * @param {PageName} pageName - page to check if visible * @returns true` when page is visible */ isPageVisible(pageName: PageName): boolean; /** * Open order panel widget */ openOrderPanel(): void; /** * Close order panel widget */ closeOrderPanel(): void; /** * Change the visibility of the right toolbar * @param {boolean} visible - true to display the toolbar, false to hide */ changeWidgetBarVisibility(visible: boolean): void; } /** * Overrides for the 'Ichimoku Cloud' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface IchimokuCloudIndicatorOverrides { /** Default value: `#000080` */ "plots background.color": string; /** Default value: `90` */ "plots background.transparency": number; /** Default value: `true` */ "plots background.visible": boolean; /** Default value: `15` */ "conversion line.display": number; /** Default value: `0` */ "conversion line.linestyle": number; /** Default value: `1` */ "conversion line.linewidth": number; /** Default value: `line` */ "conversion line.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "conversion line.trackprice": boolean; /** Default value: `0` */ "conversion line.transparency": number; /** Default value: `#2196F3` */ "conversion line.color": string; /** Default value: `15` */ "base line.display": number; /** Default value: `0` */ "base line.linestyle": number; /** Default value: `1` */ "base line.linewidth": number; /** Default value: `line` */ "base line.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "base line.trackprice": boolean; /** Default value: `0` */ "base line.transparency": number; /** Default value: `#801922` */ "base line.color": string; /** Default value: `15` */ "lagging span.display": number; /** Default value: `0` */ "lagging span.linestyle": number; /** Default value: `1` */ "lagging span.linewidth": number; /** Default value: `line` */ "lagging span.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "lagging span.trackprice": boolean; /** Default value: `0` */ "lagging span.transparency": number; /** Default value: `#43A047` */ "lagging span.color": string; /** Default value: `15` */ "leading span a.display": number; /** Default value: `0` */ "leading span a.linestyle": number; /** Default value: `1` */ "leading span a.linewidth": number; /** Default value: `line` */ "leading span a.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "leading span a.trackprice": boolean; /** Default value: `0` */ "leading span a.transparency": number; /** Default value: `#A5D6A7` */ "leading span a.color": string; /** Default value: `15` */ "leading span b.display": number; /** Default value: `0` */ "leading span b.linestyle": number; /** Default value: `1` */ "leading span b.linewidth": number; /** Default value: `line` */ "leading span b.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "leading span b.trackprice": boolean; /** Default value: `0` */ "leading span b.transparency": number; /** Default value: `#FAA1A4` */ "leading span b.color": string; [key: string]: StudyOverrideValueType; } interface IconOptions { /** Icon number */ icon: number; } interface KagiStylePreferences { /** Up line color */ upColor: string; /** Up down color */ downColor: string; /** Up projection line color */ upColorProjection: string; /** Down projection line color */ downColorProjection: string; } /** * Overrides for the 'Keltner Channels' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface KeltnerChannelsIndicatorOverrides { /** Default value: `#2196F3` */ "plots background.color": string; /** Default value: `95` */ "plots background.transparency": number; /** Default value: `true` */ "plots background.visible": boolean; /** Default value: `15` */ "upper.display": number; /** Default value: `0` */ "upper.linestyle": number; /** Default value: `1` */ "upper.linewidth": number; /** Default value: `line` */ "upper.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "upper.trackprice": boolean; /** Default value: `0` */ "upper.transparency": number; /** Default value: `#2196F3` */ "upper.color": string; /** Default value: `15` */ "middle.display": number; /** Default value: `0` */ "middle.linestyle": number; /** Default value: `1` */ "middle.linewidth": number; /** Default value: `line` */ "middle.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "middle.trackprice": boolean; /** Default value: `0` */ "middle.transparency": number; /** Default value: `#2196F3` */ "middle.color": string; /** Default value: `15` */ "lower.display": number; /** Default value: `0` */ "lower.linestyle": number; /** Default value: `1` */ "lower.linewidth": number; /** Default value: `line` */ "lower.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "lower.trackprice": boolean; /** Default value: `0` */ "lower.transparency": number; /** Default value: `#2196F3` */ "lower.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Klinger Oscillator' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface KlingerOscillatorIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; /** Default value: `15` */ "signal.display": number; /** Default value: `0` */ "signal.linestyle": number; /** Default value: `1` */ "signal.linewidth": number; /** Default value: `line` */ "signal.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "signal.trackprice": boolean; /** Default value: `0` */ "signal.transparency": number; /** Default value: `#43A047` */ "signal.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Know Sure Thing' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface KnowSureThingIndicatorOverrides { /** Default value: `#787B86` */ "zero.color": string; /** Default value: `2` */ "zero.linestyle": number; /** Default value: `1` */ "zero.linewidth": number; /** Default value: `true` */ "zero.visible": boolean; /** Default value: `0` */ "zero.value": number; /** Default value: `15` */ "kst.display": number; /** Default value: `0` */ "kst.linestyle": number; /** Default value: `1` */ "kst.linewidth": number; /** Default value: `line` */ "kst.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "kst.trackprice": boolean; /** Default value: `0` */ "kst.transparency": number; /** Default value: `#089981` */ "kst.color": string; /** Default value: `15` */ "signal.display": number; /** Default value: `0` */ "signal.linestyle": number; /** Default value: `1` */ "signal.linewidth": number; /** Default value: `line` */ "signal.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "signal.trackprice": boolean; /** Default value: `0` */ "signal.transparency": number; /** Default value: `#F23645` */ "signal.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Least Squares Moving Average' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface LeastSquaresMovingAverageIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } interface LibraryPineStudy { /** * The method is designed to get additional information for an indicator and allows you to initialize variables needed for your data calculations. * For example, you can reset a counter with this method. The library calls `init` when the indicator should be calculated from scratch. * For more information, refer to the [Constructor](https://www.tradingview.com/charting-library-docs/latest/custom_studies/custom-indicator-constructor#init) article. * * Example: * ``` * this.init = function(context, inputCallback) { * var symbol = '#EQUITY'; * var period = PineJS.Std.period(this._context); * context.new_sym(symbol, period); * }; * ``` * @param ctx - An object containing symbol info along with some useful methods to load/store symbol * @param {(index:number} inputs - The inputs callback is an array of input values, placed in order of inputs in Metainfo. */ init?(ctx: IContext, inputs: (index: number) => T): void; /** * Called every time the library wants to calculate the study. Also it's called for every bar of every symbol. * Thus, if you request several additional symbols inside your indicator it will increase the count of runs. * @param ctx - An object containing symbol info along with some useful methods to load/store symbol * @param {(index:number} inputs - The inputs callback is an array of input values, placed in order of inputs in Metainfo. */ main(ctx: IContext, inputs: (index: number) => T): TPineStudyResult | null; // Indicator defined properties // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: string]: any; } interface LibraryPineStudyConstructor { /** * Custom Study constructor */ new (): LibraryPineStudy; } interface LibrarySubsessionInfo { /** * Description of the subsession. * * @example "Regular Trading Hours" */ description: string; /** * Subsession ID. */ id: LibrarySessionId; /** * Session string. See {@link LibrarySymbolInfo.session}. */ session: string; /** * Session corrections string. See {@link LibrarySymbolInfo.corrections}. */ "session-correction"?: string; /** * Session to display. See {@link LibrarySymbolInfo.session_display}. */ "session-display"?: string; } interface LibrarySymbolInfo { /** * It is a symbol name within an exchange, such as `AAPL` or `9988` (Hong Kong). * Note that it should not contain the exchange name. * This symbol name is visible to users and can be repeated. * * By default, `name` is used to resolve symbols in the [Datafeed API](https://www.tradingview.com/charting-library-docs/latest/connecting_data/datafeed-api/). * If you use {@link LibrarySymbolInfo.ticker}, the library will use the ticker for Datafeed API requests. */ name: string; /** * Array of base symbols * Example: for `AAPL*MSFT` it is `['NASDAQ:AAPL', 'NASDAQ:MSFT']` */ base_name?: string[]; /** * It is an unique identifier for a particular symbol in your [symbology](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology). * If you specify this property, its value will be used for all data requests for this symbol. * `ticker` will be treated the same as {@link LibrarySymbolInfo.name} if not specified explicitly. * * You should avoid using colons (":") in ticker values unless you are following the TradingView format: "NYSE:IBM". Using colons may cause unexpected behaviour and display bugs. */ ticker?: string; /** * The description of the symbol. * Will be displayed in the chart legend for this symbol. */ description: string; /** * Symbol Long description * * Optional long(er) description for the symbol. */ long_description?: string; /** * Type of the instrument. * Possible values: {@link SymbolType} */ type: string; /** * Trading hours for the symbol. The time should be in the **exchange** time zone specified in the {@link LibrarySymbolInfo.timezone} property. Refer to the [Trading sessions](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/Trading-Sessions) article for more information. * @example "1700-0200" */ session: string; /** * The session value to display in the UI. If not specified, then `session` is used. */ session_display?: string; /** * A string that contains a list of non-trading holidays for the symbol. * Holiday dates should be in the `YYYYMMDD` format. * These dates are not displayed on the chart. * * You can specify a correction for a holiday using {@link LibrarySymbolInfo.corrections}. * @example "20181105,20181107,20181112" */ session_holidays?: string; /** * List of corrections for a symbol. The corrections are days when the trading session differs from the default one set in {@link LibrarySymbolInfo.session}. * The `corrections` value is a string in the following format: `SESSION:YYYYMMDD`. * For more information, refer to [corrections](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology#corrections). * * The string below specifies corrections for two trading days: * * - November 13, 2018. This trading day is split into two sessions. The first session starts at 19:00 four days before (November 9, 2018) and ends at 23:50 four days before. The second session starts at 10:00 and ends at 18:45. * - November 14, 2018. The session starts at 10:00 and ends at 14:00. * * @example "1900F4-2350F4,1000-1845:20181113;1000-1400:20181114" */ corrections?: string; /** * Traded exchange (current (proxy) exchange). * The name will be displayed in the chart legend for this symbol. * * @example "NYSE" */ exchange: string; /** * short name of the exchange where this symbol is traded (real listed exchange). * The name will be displayed in the chart legend for this symbol. * * @example "NYSE" */ listed_exchange: string; /** * The time zone of the **exchange** where the symbol is listed. The time zone value should be in the OlsonDB format. * Refer to [Time zones](https://www.tradingview.com/charting-library-docs/latest/ui_elements/timezones) for a full list of supported time zones. */ timezone: Timezone; /** * Format of displaying labels on the price scale: * * `price` - formats decimal or fractional numbers based on `minmov`, `pricescale`, `minmove2`, `fractional` and `variableMinTick` values. See [Price format](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology#price-format) for more details. * `volume` - formats decimal numbers in thousands, millions, billions or trillions */ format: SeriesFormat; /** * A number of decimal places or fractions that the price has. * * The `pricescale` value depends on the [price format](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology#price-format). * If you want to display the price in the decimal format, `pricescale` should be `10^n`, where `n` is the number of decimal places. * **Examples:** `1`, `10`, `10000000`. * * If you want to display the price in the fractional format, `pricescale` should be `2^n`. * This value represents the number of fractions. * **Examples:** `8`, `16`, `256`. */ pricescale: number; /** * The number of units that make up one tick. * For example, U.S. equities are quotes in decimals, and tick in decimals, and can go up +/- `.01`. * Therefore, the tick increment is 1 and `minmov = 1`. But the e-mini S&P futures contract, though quoted in decimals, goes up in `.25` increments, so the tick increment is 25 and `minmov = 25`. * Refer to [Price format](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology#price-format) for more information. */ minmov: number; /** * For common prices this can be skipped. * * Fractional prices are displayed 2 different forms: 1) `xx'yy` (for example, `133'21`) 2) `xx'yy'zz` (for example, `133'21'5`). * * - `xx` is an integer part. * - `minmov/pricescale` is a Fraction. * - `minmove2` is used in form 2. * - `fractional` is `true`. * - `variableMinTick` is skipped. * * Example: * * If `minmov = 1`, `pricescale = 128` and `minmove2 = 4`: * * - `119'16'0` represents `119 + 16/32` * - `119'16'2` represents `119 + 16.25/32` * - `119'16'5` represents `119 + 16.5/32` * - `119'16'7` represents `119 + 16.75/32` * * More examples: * * - `ZBM2014 (T-Bond)` with `1/32`: `minmov = 1`, `pricescale = 32`, `minmove2 = 0` * - `ZCM2014 (Corn)` with `2/8`: `minmov = 2`, `pricescale = 8`, `minmove2 = 0` * - `ZFM2014 (5 year t-note)` with `1/4 of 1/32`: `minmov = 1`, `pricescale = 128`, `minmove2 = 4` */ fractional?: boolean; /** * This property is used to display prices in the [fraction of a fraction](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology#fraction-of-a-fraction-format) format. * For example, the ZBM2023 tick size is 1/4 of a 32nd. To display this security, set `minmov = 1`, `pricescale = 128`, `minmove2 = 4`. * * For common prices, `minmove2` can be skipped or set to `0`. */ minmove2?: number; /** * Dynamic minimum price movement. It is used if the instrument's minimum price movement changes depending on the price range. * * For example, '0.01 10 0.02 25 0.05', where the tick size is 0.01 for a price less than 10, the tick size is 0.02 for a price less than 25, the tick size is 0.05 for a price greater than or equal to 25. */ variable_tick_size?: string; /** * A flag indicating whether your datafeed contains intraday (minutes) data for this symbol. * If `true`, the library requests this data when an intraday resolution is selected. If `false`, _No data here_ is displayed on the chart. * * This property is required to enable intraday resolutions. Refer to the [Configure resolutions in datafeed](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions#resolution-in-minutes-intraday) article for more information. * @default false */ has_intraday?: boolean; /** * An array of [resolutions](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions) which should be enabled in the _Resolution_ drop-down menu for this symbol. * Each item of the array is expected to be a string that has a specific [format](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Resolution#resolution-format). * * If one changes the symbol and the new symbol does not support the selected resolution, an error message will be shown on the chart. * * **Resolution availability logic (pseudocode):** * ``` * resolutionAvailable = * resolution.isIntraday * ? symbol.has_intraday && symbol.supported_resolutions(resolution) * : symbol.supported_resolutions(resolution); * ``` * * If `supported_resolutions` is `[]` (empty array), all resolutions are disabled in the _Resolution_ drop-down menu. * * If `supported_resolutions` is `undefined`, all resolutions that the chart support ({@link DatafeedConfiguration.supported_resolutions}) and custom resolutions are enabled. * * Note that the list of available time frames depends on supported resolutions. * Time frames that require resolutions that are unavailable for a particular symbol will be hidden. * Refer to [Time frame toolbar](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Time-Scale#time-frame-toolbar) for more information. */ supported_resolutions?: ResolutionString[]; /** * An array of intraday (minutes) resolutions that your datafeed supports. Items in the array should be listed in ascending order, for example: `["1", "2"]`. * * This property is required to enable intraday resolutions. Refer to the [Configure resolutions in datafeed](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions#resolution-in-minutes-intraday) article for more information. * Note that each resolution in `intraday_multipliers` should be handled in the {@link IDatafeedChartApi.getBars} implementation. * Consider the [example](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions#example). * * The library also uses resolutions listed in `intraday_multipliers` to display higher resolution that your datafeed does not explicitly support. If `intraday_multipliers` is not specified, the library cannot build additional resolutions. * * Note that the library **cannot** build daily, weekly, or monthly resolutions using intraday data. * @default [] — specifies that the datafeed can provide data for any requested resolution. */ intraday_multipliers?: string[]; /** * A flag indicating whether your datafeed contains seconds data for this symbol. * If `true`, the library requests this data when a seconds resolution is selected. If `false`, _No data here_ is displayed on the chart. * * You should set `has_seconds` to `true` to enable seconds resolutions. Refer to the [Configure resolutions in datafeed](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions#resolution-in-seconds) article for more information. * @default false */ has_seconds?: boolean; /** * A flag indicating whether your datafeed contains ticks data for this symbol. * If `true`, the library requests this data when a resolution in ticks is selected. If `false`, _No data here_ is displayed on the chart. * * You should set `has_ticks` to `true` to enable ticks resolutions. Refer to the [Configure resolutions in datafeed](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions#resolution-in-ticks) article for more information. * @default false */ has_ticks?: boolean; /** * An array of seconds resolutions that your datafeed supports. Items in the array should be listed in ascending order and **should not** include letters, for example: `["1", "2"]`. * This property is required to enable seconds resolutions. Refer to the [Configure resolutions in datafeed](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions#resolution-in-seconds) article for more information. * * The library also uses resolutions listed in `seconds_multipliers` to display higher resolution that your datafeed does not explicitly support. If `seconds_multipliers` is not specified, the library cannot build additional resolutions. * Consider the example. You need to enable one-second and five-second resolutions but your datafeed contains only one-second data. In this case, you should set `seconds_multipliers` to `["1"]`. * The library will build the five-second resolution from one-second data. */ seconds_multipliers?: string[]; /** * The boolean value showing whether or not seconds bars for this symbol can be built from ticks. Only available in Trading Platform. * * * {@link LibrarySymbolInfo.has_seconds} must also be `true` * * {@link LibrarySymbolInfo.has_ticks} must also be `true` * * {@link LibrarySymbolInfo.seconds_multipliers} must be an empty array or only contain multipliers that the datafeed provides itself * * The library builds resolutions from ticks only if there are no seconds resolutions from the datafeed or the provided resolutions are larger then the required one. For example, the datafeed provides `3S` resolution. In this case, the library can build only `1S` or `2S` resolutions from ticks. Resolutions such as `15S` will be build with seconds bars. * @default false */ build_seconds_from_ticks?: boolean; /** * A flag indicating whether your datafeed contains daily data for this symbol. * If `true`, the library requests this data when a daily resolution is selected. If `false`, _No data here_ is displayed on the chart. * * `has_daily` is set to `true` by default. However, you should also specify {@link daily_multipliers} to enable daily resolutions. Refer to the [Configure resolutions in datafeed](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions#resolution-in-days) article for more information. * @default true */ has_daily?: boolean; /** * An array of daily resolutions that your datafeed supports. Items in the array should be listed in ascending order and **should not** include letters, for example: `["1", "2"]`. * This property is required to enable daily resolutions. Refer to the [Configure resolutions in datafeed](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions#resolution-in-days) article for more information. * * The library also uses resolutions listed in `daily_multipliers` to display higher resolution that your datafeed does not explicitly support. If `daily_multipliers` is not specified, the library cannot build additional resolutions. * @default ["1"] */ daily_multipliers?: string[]; /** * A flag indicating whether your datafeed contains weekly or monthly data for this symbol. If `true`, the library requests this data when the corresponding resolution is selected. * To enable weekly or monthly resolutions, you should also specify the {@link weekly_multipliers} or {@link monthly_multipliers} properties. * Refer to the [Configure resolutions in datafeed](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions#resolution-in-weeks--months) article for more information. * * If `has_weekly_and_monthly` is set to `false`, the library attempts to build the resolutions using daily bars. Note that building bars requires a large number of requests to your datafeed. * If the library fails to build bars, _No data here_ is displayed on the chart. * @default false */ has_weekly_and_monthly?: boolean; /** * An array of weekly resolutions that your datafeed supports. Items in the array should be listed in ascending order and **should not** include letters, for example: `["1", "3"]`. * This property is required to enable weekly resolutions. Refer to the [Configure resolutions in datafeed](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions#resolution-in-weeks--months) article for more information. * * The library also uses resolutions listed in `weekly_multipliers` to display higher resolution that your datafeed does not explicitly support. If `weekly_multipliers` is not specified, the library cannot build additional resolutions. * @default ['1'] */ weekly_multipliers?: string[]; /** * An array of monthly resolutions that your datafeed supports. Items in the array should be listed in ascending order and **should not** include letters, for example: `["1", "3", "6", "12"]`. * This property is required to enable monthly resolutions. Refer to the [Configure resolutions in datafeed](https://www.tradingview.com/charting-library-docs/latest/connecting_data/time-and-sessions/configure-datafeed-resolutions#resolution-in-weeks--months) article for more information. * * The library also uses resolutions listed in `monthly_multipliers` to display higher resolution that your datafeed does not explicitly support. If `monthly_multipliers` is not specified, the library cannot build additional resolutions. * @default ['1'] */ monthly_multipliers?: string[]; /** * The boolean value showing whether the library should generate empty bars in the session when there is no data from the data feed for this particular time. * * I.e., if your session is `0900-1600` and your data has gaps between `11:00` and `12:00` and your `has_empty_bars` is `true`, then the Library will fill the gaps with bars for this time. * * Flag `has_empty_bars` = `true` cannot be used if featureset `disable_resolution_rebuild` is enabled. * @default false */ has_empty_bars?: boolean; /** * Represents what values are supported by the symbol. Possible values: * * - `ohlcv` — the symbol supports open, high, low, close prices and has volume. * - `ohlc` — the symbol supports open, high, low, close, prices but doesn't have volume. * - `c` — the symbol supports only close price. This makes the chart show the symbol data using only line-based styles. * @default 'ohlcv' */ visible_plots_set?: VisiblePlotsSet; /** * Integer showing typical volume value decimal places for a particular symbol. * 0 means volume is always an integer. * 1 means that there might be 1 numeric character after the comma. * @default '0' */ volume_precision?: number; /** * The status code of a series with this symbol. * For `delayed_streaming` and `endofday` type of data, the status is displayed as an icon and the *Data is delayed* section in the [_Legend_](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Legend#display-delayed-data-information), next to the market status icon. * Note that you should also enable the [`display_data_mode`](https://www.tradingview.com/charting-library-docs/latest/customization/Featuresets#display_data_mode) featureset. * * When declaring `delayed_streaming` you also have to specify its {@link LibrarySymbolInfo.delay} in seconds. */ data_status?: "streaming" | "endofday" | "delayed_streaming"; /** * Type of delay that is associated to the data or real delay for real time data. * - `0` for realtime * - `-1` for endofday * - or delay in seconds (for delayed realtime) */ delay?: number; /** * Boolean showing whether this symbol is expired futures contract or not. * @default false */ expired?: boolean; /** * Unix timestamp of the expiration date. One must set this value when `expired` = `true`. * The library will request data for this symbol starting from that time point. */ expiration_date?: number; /** Sector for stocks to be displayed in the Security Info. */ sector?: string; /** Industry for stocks to be displayed in the Security Info. */ industry?: string; /** * The currency in which the instrument is traded or some other currency if currency conversion is enabled. * It is displayed in the Security Info dialog and on the price axes. */ currency_code?: string; /** The currency in which the instrument is traded. */ original_currency_code?: string; /** * A unique identifier of a unit in which the instrument is traded or some other identifier if unit conversion is enabled. * It is displayed on the price axes. */ unit_id?: string; /** * A unique identifier of a unit in which the instrument is traded. */ original_unit_id?: string; /** * Allowed unit conversion group names. */ unit_conversion_types?: string[]; /** * An ID of a subsession specified in {@link subsessions}. The value must match the subsession that is currently displayed on the chart. * For more information, refer to the [Extended sessions](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology#extended-sessions) section. */ subsession_id?: string; /** * An array of objects that contain information about certain subsessions within the extended session. * For more information, refer to the [Extended sessions](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology#extended-sessions) section. */ subsessions?: LibrarySubsessionInfo[]; /** * Optional ID of a price source for a symbol. Should match one of the price sources from the {@link price_sources} array. * * Note that you should set the [`symbol_info_price_source`](https://www.tradingview.com/charting-library-docs/latest/customization/Featuresets#symbol_info_price_source) featureset to `true` to display the symbol price source in the main series legend. */ price_source_id?: string; /** * Supported price sources for the symbol. * Price sources appear in the series legend and indicate the origin of values represented by symbol bars. * Example price sources: "Spot Price", "Ask", "Bid", etc. * The price source information is valuable when viewing non-OHLC series types. * * Note that you should set the [`symbol_info_price_source`](https://www.tradingview.com/charting-library-docs/latest/customization/Featuresets#symbol_info_price_source) featureset to `true` to display the symbol price source in the main series legend. * @example [{ id: '1', name: 'Spot Price' }, { id: '321', name: 'Bid' }] */ price_sources?: SymbolInfoPriceSource[]; /** * URL of image/s to be displayed as the logo/s for the symbol. The `show_symbol_logos` featureset needs to be enabled for this to be visible in the UI. * * - If a single url is returned then that url will solely be used to display the symbol logo. * - If two urls are provided then the images will be displayed as two partially overlapping * circles with the first url appearing on top. This is typically used for FOREX where you would * like to display two country flags are the symbol logo. * * The image/s should ideally be square in dimension. You can use any image type which * the browser supports natively. * * Examples: * - `https://yourserver.com/apple.svg` * - `/images/myImage.png` * - `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3...` * - `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4...` */ logo_urls?: [ string ] | [ string, string ]; /** * URL of image to be displayed as the logo for the exchange. The `show_exchange_logos` featureset needs to be enabled for this to be visible in the UI. * * The image should ideally be square in dimension. You can use any image type which * the browser supports natively. Simple SVG images are recommended. * * Examples: * - `https://yourserver.com/exchangeLogo.svg` * - `/images/myImage.png` * - `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3...` * - `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4...` */ exchange_logo?: string; /** * Additional metadata to include with the symbol information. * These parameters will not affect existing properties such as 'ticker' or 'name' * and will not be processed by the library. However, they can be accessed later * through the {@link IChartWidgetApi.symbolExt} method, impacting existing * properties such as 'ticker' or 'name'. */ library_custom_fields?: Record; } interface LineBreakStylePreferences { /** Up bar color */ upColor: string; /** Down bar color */ downColor: string; /** Up bar border color */ borderUpColor: string; /** Down bar border color */ borderDownColor: string; /** Projection up bar color */ upColorProjection: string; /** Projection down bar color */ downColorProjection: string; /** Projection up bar border color */ borderUpColorProjection: string; /** Projection down bar border color */ borderDownColorProjection: string; } interface LineStylePreferences { /** Color type {@link ColorType} */ colorType?: ColorType; /** Line gradient start color */ gradientStartColor?: string; /** Line gradient end color */ gradientEndColor?: string; /** Line color */ color: string; /** Line Style {@link LineStyle} */ linestyle: number; /** Line width */ linewidth: number; } /** * Represents the state of a Drawing */ interface LineToolState { /** The entity ID of the drawing */ id: EntityId; /** The associated symbol ID for the drawing */ symbol?: string; /** The source ID of the object's owner */ ownerSource: string; /** The ID of the group to which drawing belongs */ groupId?: string; /** The associated symbol's currency ID */ currencyId?: string | null; /** The associated symbol's unit ID */ unitId?: string | null; /** The current state object of the drawing */ state: unknown; } /** * Represents the state of drawings and groups */ interface LineToolsAndGroupsState { /** A map of sources to drawing states */ sources: Map | null; /** A map of group IDs to drawings group states */ groups: Map; /** The symbol ID associated with the drawings and groups */ symbol?: string; } /** * Represents the state of a group of LineTools */ interface LineToolsGroupState { /** The ID of the drawings group */ id: string; /** The name of the drawings group */ name: string; /** The symbol associated with the drawings group */ symbol: string; /** The associated symbol's currency ID */ currencyId?: string | null; /** The associated symbol's unit ID */ unitId?: string | null; } /** * Overrides for the 'Linear Regression Curve' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface LinearRegressionCurveIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Linear Regression Slope' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface LinearRegressionSlopeIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#FF5252` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'MACD' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MACDIndicatorOverrides { /** Default value: `15` */ "histogram.display": number; /** Default value: `0` */ "histogram.linestyle": number; /** Default value: `1` */ "histogram.linewidth": number; /** Default value: `columns` */ "histogram.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "histogram.trackprice": boolean; /** Default value: `0` */ "histogram.transparency": number; /** Default value: `#FF5252` */ "histogram.color": string; /** Default value: `15` */ "macd.display": number; /** Default value: `0` */ "macd.linestyle": number; /** Default value: `1` */ "macd.linewidth": number; /** Default value: `line` */ "macd.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "macd.trackprice": boolean; /** Default value: `0` */ "macd.transparency": number; /** Default value: `#2196F3` */ "macd.color": string; /** Default value: `15` */ "signal.display": number; /** Default value: `0` */ "signal.linestyle": number; /** Default value: `1` */ "signal.linewidth": number; /** Default value: `line` */ "signal.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "signal.trackprice": boolean; /** Default value: `0` */ "signal.transparency": number; /** Default value: `#FF6D00` */ "signal.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'MA Cross' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MACrossIndicatorOverrides { /** Default value: `15` */ "short:plot.display": number; /** Default value: `0` */ "short:plot.linestyle": number; /** Default value: `1` */ "short:plot.linewidth": number; /** Default value: `line` */ "short:plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "short:plot.trackprice": boolean; /** Default value: `0` */ "short:plot.transparency": number; /** Default value: `#43A047` */ "short:plot.color": string; /** Default value: `15` */ "long:plot.display": number; /** Default value: `0` */ "long:plot.linestyle": number; /** Default value: `1` */ "long:plot.linewidth": number; /** Default value: `line` */ "long:plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "long:plot.trackprice": boolean; /** Default value: `0` */ "long:plot.transparency": number; /** Default value: `#FF6D00` */ "long:plot.color": string; /** Default value: `15` */ "crosses.display": number; /** Default value: `0` */ "crosses.linestyle": number; /** Default value: `4` */ "crosses.linewidth": number; /** Default value: `cross` */ "crosses.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "crosses.trackprice": boolean; /** Default value: `0` */ "crosses.transparency": number; /** Default value: `#2196F3` */ "crosses.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'MA with EMA Cross' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MAwithEMACrossIndicatorOverrides { /** Default value: `15` */ "ma.display": number; /** Default value: `0` */ "ma.linestyle": number; /** Default value: `1` */ "ma.linewidth": number; /** Default value: `line` */ "ma.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "ma.trackprice": boolean; /** Default value: `0` */ "ma.transparency": number; /** Default value: `#FF6D00` */ "ma.color": string; /** Default value: `15` */ "ema.display": number; /** Default value: `0` */ "ema.linestyle": number; /** Default value: `1` */ "ema.linewidth": number; /** Default value: `line` */ "ema.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "ema.trackprice": boolean; /** Default value: `0` */ "ema.transparency": number; /** Default value: `#43A047` */ "ema.color": string; /** Default value: `15` */ "crosses.display": number; /** Default value: `0` */ "crosses.linestyle": number; /** Default value: `4` */ "crosses.linewidth": number; /** Default value: `cross` */ "crosses.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "crosses.trackprice": boolean; /** Default value: `0` */ "crosses.transparency": number; /** Default value: `#2196F3` */ "crosses.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Majority Rule' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MajorityRuleIndicatorOverrides { /** Default value: `15` */ "majority rule.display": number; /** Default value: `0` */ "majority rule.linestyle": number; /** Default value: `1` */ "majority rule.linewidth": number; /** Default value: `line` */ "majority rule.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "majority rule.trackprice": boolean; /** Default value: `0` */ "majority rule.transparency": number; /** Default value: `#FF5252` */ "majority rule.color": string; [key: string]: StudyOverrideValueType; } interface MappedObject { [key: string]: TValue | undefined; } interface Mark { /** ID of the mark */ id: string | number; /** * Time for the mark. * Unix timestamp in seconds. */ time: number; /** Color for the mark */ color: MarkConstColors | MarkCustomColor; /** Text content for the mark */ text: string; /** Label for the mark */ label: string; /** Text color for the mark */ labelFontColor: string; /** Minimum size for the mark */ minSize: number; /** Border Width */ borderWidth?: number; /** Border Width when hovering over bar mark */ hoveredBorderWidth?: number; /** * Optional URL for an image to be displayed within the timescale mark. * * The image should ideally be square in dimension. You can use any image type which * the browser supports natively. * * Examples: * - `https://yourserver.com/adobe.svg` * - `/images/myImage.png` * - `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3...` * - `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4...` */ imageUrl?: string; /** * Continue to show text label even when an image has * been loaded for the timescale mark. * * Defaults to `false` if undefined. */ showLabelWhenImageLoaded?: boolean; } interface MarkCustomColor { /** Border color */ border: string; /** Background color */ background: string; } /** * Overrides for the 'Mass Index' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MassIndexIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'McGinley Dynamic' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface McGinleyDynamicIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Median Price' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MedianPriceIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#FF6D00` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Momentum' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MomentumIndicatorOverrides { /** Default value: `#787B86` */ "zero.color": string; /** Default value: `2` */ "zero.linestyle": number; /** Default value: `1` */ "zero.linewidth": number; /** Default value: `true` */ "zero.visible": boolean; /** Default value: `0` */ "zero.value": number; /** Default value: `15` */ "mom.display": number; /** Default value: `0` */ "mom.linestyle": number; /** Default value: `1` */ "mom.linewidth": number; /** Default value: `line` */ "mom.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "mom.trackprice": boolean; /** Default value: `0` */ "mom.transparency": number; /** Default value: `#2196F3` */ "mom.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Money Flow Index' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MoneyFlowIndexIndicatorOverrides { /** Default value: `#7E57C2` */ "hlines background.color": string; /** Default value: `90` */ "hlines background.transparency": number; /** Default value: `true` */ "hlines background.visible": boolean; /** Default value: `#787B86` */ "upperlimit.color": string; /** Default value: `2` */ "upperlimit.linestyle": number; /** Default value: `1` */ "upperlimit.linewidth": number; /** Default value: `true` */ "upperlimit.visible": boolean; /** Default value: `80` */ "upperlimit.value": number; /** Default value: `#787B86` */ "lowerlimit.color": string; /** Default value: `2` */ "lowerlimit.linestyle": number; /** Default value: `1` */ "lowerlimit.linewidth": number; /** Default value: `true` */ "lowerlimit.visible": boolean; /** Default value: `20` */ "lowerlimit.value": number; /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#7E57C2` */ "plot.color": string; [key: string]: StudyOverrideValueType; } interface MouseEventParams { /** X (horizontal) coordinate (in pixels) at which the mouse event occurred, relative to the left edge of the applications viewport. */ clientX: number; /** Y (vertical) coordinate (in pixels) at which the mouse event occurred, relative to the left edge of the applications viewport. */ clientY: number; /** X (horizontal) coordinate (in pixels) at which the mouse event occurred, relative to the left edge of the entire document. */ pageX: number; /** Y (vertical) coordinate (in pixels) at which the mouse event occurred, relative to the left edge of the entire document. */ pageY: number; /** X (horizontal) coordinate (in pixels) at which the mouse event occurred, in global screen coordinates. */ screenX: number; /** Y (vertical) coordinate (in pixels) at which the mouse event occurred, in global screen coordinates. */ screenY: number; } /** * Overrides for the 'Moving Average Adaptive' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MovingAverageAdaptiveIndicatorOverrides { /** Default value: `15` */ "plot 1.display": number; /** Default value: `0` */ "plot 1.linestyle": number; /** Default value: `1` */ "plot 1.linewidth": number; /** Default value: `line` */ "plot 1.plottype": LineStudyPlotStyleName; /** Default value: `0` */ "plot 1.transparency": number; /** Default value: `false` */ "plot 1.trackprice": boolean; /** Default value: `#AB47BC` */ "plot 1.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Moving Average Channel' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MovingAverageChannelIndicatorOverrides { /** Default value: `#2196F3` */ "plots background.color": string; /** Default value: `90` */ "plots background.transparency": number; /** Default value: `true` */ "plots background.visible": boolean; /** Default value: `15` */ "upper.display": number; /** Default value: `0` */ "upper.linestyle": number; /** Default value: `1` */ "upper.linewidth": number; /** Default value: `line` */ "upper.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "upper.trackprice": boolean; /** Default value: `0` */ "upper.transparency": number; /** Default value: `#2196F3` */ "upper.color": string; /** Default value: `15` */ "lower.display": number; /** Default value: `0` */ "lower.linestyle": number; /** Default value: `1` */ "lower.linewidth": number; /** Default value: `line` */ "lower.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "lower.trackprice": boolean; /** Default value: `0` */ "lower.transparency": number; /** Default value: `#FF6D00` */ "lower.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Moving Average Double' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MovingAverageDoubleIndicatorOverrides { /** Default value: `15` */ "plot 1.display": number; /** Default value: `0` */ "plot 1.linestyle": number; /** Default value: `1` */ "plot 1.linewidth": number; /** Default value: `line` */ "plot 1.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot 1.trackprice": boolean; /** Default value: `0` */ "plot 1.transparency": number; /** Default value: `#FF6D00` */ "plot 1.color": string; /** Default value: `15` */ "plot 2.display": number; /** Default value: `0` */ "plot 2.linestyle": number; /** Default value: `1` */ "plot 2.linewidth": number; /** Default value: `line` */ "plot 2.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot 2.trackprice": boolean; /** Default value: `0` */ "plot 2.transparency": number; /** Default value: `#2196F3` */ "plot 2.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Moving Average Exponential' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MovingAverageExponentialIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; /** Default value: `0` */ "smoothed ma.display": number; /** Default value: `0` */ "smoothed ma.linestyle": number; /** Default value: `1` */ "smoothed ma.linewidth": number; /** Default value: `line` */ "smoothed ma.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "smoothed ma.trackprice": boolean; /** Default value: `0` */ "smoothed ma.transparency": number; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Moving Average Hamming' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MovingAverageHammingIndicatorOverrides { /** Default value: `15` */ "plot 1.display": number; /** Default value: `0` */ "plot 1.linestyle": number; /** Default value: `1` */ "plot 1.linewidth": number; /** Default value: `line` */ "plot 1.plottype": LineStudyPlotStyleName; /** Default value: `0` */ "plot 1.transparency": number; /** Default value: `false` */ "plot 1.trackprice": boolean; /** Default value: `#4CAF50` */ "plot 1.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Moving Average' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MovingAverageIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; /** Default value: `0` */ "smoothed ma.display": number; /** Default value: `0` */ "smoothed ma.linestyle": number; /** Default value: `1` */ "smoothed ma.linewidth": number; /** Default value: `line` */ "smoothed ma.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "smoothed ma.trackprice": boolean; /** Default value: `0` */ "smoothed ma.transparency": number; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Moving Average Multiple' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MovingAverageMultipleIndicatorOverrides { /** Default value: `15` */ "plot 1.display": number; /** Default value: `0` */ "plot 1.linestyle": number; /** Default value: `1` */ "plot 1.linewidth": number; /** Default value: `line` */ "plot 1.plottype": LineStudyPlotStyleName; /** Default value: `0` */ "plot 1.transparency": number; /** Default value: `false` */ "plot 1.trackprice": boolean; /** Default value: `#9C27B0` */ "plot 1.color": string; /** Default value: `15` */ "plot 2.display": number; /** Default value: `0` */ "plot 2.linestyle": number; /** Default value: `1` */ "plot 2.linewidth": number; /** Default value: `0` */ "plot 2.transparency": number; /** Default value: `line` */ "plot 2.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot 2.trackprice": boolean; /** Default value: `#FF6D00` */ "plot 2.color": string; /** Default value: `15` */ "plot 3.display": number; /** Default value: `0` */ "plot 3.linestyle": number; /** Default value: `1` */ "plot 3.linewidth": number; /** Default value: `0` */ "plot 3.transparency": number; /** Default value: `line` */ "plot 3.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot 3.trackprice": boolean; /** Default value: `#43A047` */ "plot 3.color": string; /** Default value: `15` */ "plot 4.display": number; /** Default value: `0` */ "plot 4.linestyle": number; /** Default value: `1` */ "plot 4.linewidth": number; /** Default value: `0` */ "plot 4.transparency": number; /** Default value: `line` */ "plot 4.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot 4.trackprice": boolean; /** Default value: `#26C6DA` */ "plot 4.color": string; /** Default value: `15` */ "plot 5.display": number; /** Default value: `0` */ "plot 5.linestyle": number; /** Default value: `1` */ "plot 5.linewidth": number; /** Default value: `0` */ "plot 5.transparency": number; /** Default value: `line` */ "plot 5.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot 5.trackprice": boolean; /** Default value: `#F50057` */ "plot 5.color": string; /** Default value: `15` */ "plot 6.display": number; /** Default value: `0` */ "plot 6.linestyle": number; /** Default value: `1` */ "plot 6.linewidth": number; /** Default value: `0` */ "plot 6.transparency": number; /** Default value: `line` */ "plot 6.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot 6.trackprice": boolean; /** Default value: `#2196F3` */ "plot 6.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Moving Average Triple' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MovingAverageTripleIndicatorOverrides { /** Default value: `15` */ "plot 1.display": number; /** Default value: `0` */ "plot 1.linestyle": number; /** Default value: `1` */ "plot 1.linewidth": number; /** Default value: `line` */ "plot 1.plottype": LineStudyPlotStyleName; /** Default value: `0` */ "plot 1.transparency": number; /** Default value: `false` */ "plot 1.trackprice": boolean; /** Default value: `#FF6D00` */ "plot 1.color": string; /** Default value: `15` */ "plot 2.display": number; /** Default value: `0` */ "plot 2.linestyle": number; /** Default value: `1` */ "plot 2.linewidth": number; /** Default value: `0` */ "plot 2.transparency": number; /** Default value: `line` */ "plot 2.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot 2.trackprice": boolean; /** Default value: `#2196F3` */ "plot 2.color": string; /** Default value: `15` */ "plot 3.display": number; /** Default value: `0` */ "plot 3.linestyle": number; /** Default value: `1` */ "plot 3.linewidth": number; /** Default value: `0` */ "plot 3.transparency": number; /** Default value: `line` */ "plot 3.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot 3.trackprice": boolean; /** Default value: `#26C6DA` */ "plot 3.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Moving Average Weighted' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface MovingAverageWeightedIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Net Volume' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface NetVolumeIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Number format options */ interface NumberFormatterFormatOptions extends FormatterFormatOptions { /** * Disable exponential form */ noExponentialForm?: boolean; } /** * Overrides for the 'On Balance Volume' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface OnBalanceVolumeIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; /** Default value: `0` */ "smoothed ma.display": number; /** Default value: `0` */ "smoothed ma.linestyle": number; /** Default value: `1` */ "smoothed ma.linewidth": number; /** Default value: `line` */ "smoothed ma.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "smoothed ma.trackprice": boolean; /** Default value: `0` */ "smoothed ma.transparency": number; [key: string]: StudyOverrideValueType; } /** * Override properties for the Order drawing tool. */ interface OrderLineToolOverrides { /** Default value: `rgba(255, 255, 255, 0.25)` */ "linetoolorder.bodyBackgroundColor": string; /** Default value: `25` */ "linetoolorder.bodyBackgroundTransparency": number; /** Default value: `#4094e8` */ "linetoolorder.bodyBorderActiveBuyColor": string; /** Default value: `#e75656` */ "linetoolorder.bodyBorderActiveSellColor": string; /** Default value: `rgba(64, 148, 232, 0.5)` */ "linetoolorder.bodyBorderInactiveBuyColor": string; /** Default value: `rgba(231, 86, 86, 0.5)` */ "linetoolorder.bodyBorderInactiveSellColor": string; /** Default value: `true` */ "linetoolorder.bodyFontBold": boolean; /** Default value: `Verdana` */ "linetoolorder.bodyFontFamily": string; /** Default value: `false` */ "linetoolorder.bodyFontItalic": boolean; /** Default value: `9` */ "linetoolorder.bodyFontSize": number; /** Default value: `#4094e8` */ "linetoolorder.bodyTextActiveBuyColor": string; /** Default value: `#268c02` */ "linetoolorder.bodyTextActiveLimitColor": string; /** Default value: `#e75656` */ "linetoolorder.bodyTextActiveSellColor": string; /** Default value: `#e75656` */ "linetoolorder.bodyTextActiveStopColor": string; /** Default value: `rgba(64, 148, 232, 0.5)` */ "linetoolorder.bodyTextInactiveBuyColor": string; /** Default value: `rgba(38, 140, 2, 0.5)` */ "linetoolorder.bodyTextInactiveLimitColor": string; /** Default value: `rgba(231, 86, 86, 0.5)` */ "linetoolorder.bodyTextInactiveSellColor": string; /** Default value: `rgba(231, 86, 86, 0.5)` */ "linetoolorder.bodyTextInactiveStopColor": string; /** Default value: `rgba(255, 255, 255, 0.25)` */ "linetoolorder.cancelButtonBackgroundColor": string; /** Default value: `25` */ "linetoolorder.cancelButtonBackgroundTransparency": number; /** Default value: `#4094e8` */ "linetoolorder.cancelButtonBorderActiveBuyColor": string; /** Default value: `#e75656` */ "linetoolorder.cancelButtonBorderActiveSellColor": string; /** Default value: `rgba(64, 148, 232, 0.5)` */ "linetoolorder.cancelButtonBorderInactiveBuyColor": string; /** Default value: `rgba(231, 86, 86, 0.5)` */ "linetoolorder.cancelButtonBorderInactiveSellColor": string; /** Default value: `#4094e8` */ "linetoolorder.cancelButtonIconActiveBuyColor": string; /** Default value: `#e75656` */ "linetoolorder.cancelButtonIconActiveSellColor": string; /** Default value: `rgba(64, 148, 232, 0.5)` */ "linetoolorder.cancelButtonIconInactiveBuyColor": string; /** Default value: `rgba(231, 86, 86, 0.5)` */ "linetoolorder.cancelButtonIconInactiveSellColor": string; /** Default value: `undefined` */ "linetoolorder.cancelTooltip": string; /** Default value: `inherit` */ "linetoolorder.extendLeft": string; /** Default value: `#4094e8` */ "linetoolorder.lineActiveBuyColor": string; /** Default value: `#e75656` */ "linetoolorder.lineActiveSellColor": string; /** Default value: `#FF0000` */ "linetoolorder.lineColor": string; /** Default value: `rgba(64, 148, 232, 0.5)` */ "linetoolorder.lineInactiveBuyColor": string; /** Default value: `rgba(231, 86, 86, 0.5)` */ "linetoolorder.lineInactiveSellColor": string; /** Default value: `inherit` */ "linetoolorder.lineLength": string; /** Default value: `percentage` */ "linetoolorder.lineLengthUnit": string; /** Default value: `inherit` */ "linetoolorder.lineStyle": string; /** Default value: `inherit` */ "linetoolorder.lineWidth": string; /** Default value: `undefined` */ "linetoolorder.modifyTooltip": string; /** Default value: `#4094e8` */ "linetoolorder.quantityBackgroundActiveBuyColor": string; /** Default value: `#e75656` */ "linetoolorder.quantityBackgroundActiveSellColor": string; /** Default value: `rgba(64, 148, 232, 0.5)` */ "linetoolorder.quantityBackgroundInactiveBuyColor": string; /** Default value: `rgba(231, 86, 86, 0.5)` */ "linetoolorder.quantityBackgroundInactiveSellColor": string; /** Default value: `#4094e8` */ "linetoolorder.quantityBorderActiveBuyColor": string; /** Default value: `#e75656` */ "linetoolorder.quantityBorderActiveSellColor": string; /** Default value: `rgba(64, 148, 232, 0.5)` */ "linetoolorder.quantityBorderInactiveBuyColor": string; /** Default value: `rgba(231, 86, 86, 0.5)` */ "linetoolorder.quantityBorderInactiveSellColor": string; /** Default value: `true` */ "linetoolorder.quantityFontBold": boolean; /** Default value: `Verdana` */ "linetoolorder.quantityFontFamily": string; /** Default value: `false` */ "linetoolorder.quantityFontItalic": boolean; /** Default value: `9` */ "linetoolorder.quantityFontSize": number; /** Default value: `#ffffff` */ "linetoolorder.quantityTextColor": string; /** Default value: `0` */ "linetoolorder.quantityTextTransparency": number; /** Default value: `undefined` */ "linetoolorder.tooltip": string; } interface OverlayIndicatorOverrides { /** * The style type for _Overlay_ can be any of the following. * Default value: 2 (`line`) * * For each style, there are additional properties that you can customize. Refer to the links in the _OverlayIndicatorOverrides_ column to see the lists of properties. * * | ChartStyle name | ChartStyle # | OverlayIndicatorOverrides | * | :--------------- | :---------- | :------------------ | * | Bar | 0 | {@link OverlayIndicatorOverridesBar} | * | Candle | 1 | {@link OverlayIndicatorOverridesCandle} | * | Line | 2 | {@link OverlayIndicatorOverridesLine} | * | Area | 3 | {@link OverlayIndicatorOverridesArea} | * | HollowCandle | 4 | {@link OverlayIndicatorOverridesHollowCandle} | * | Baseline | 5 | {@link OverlayIndicatorOverridesBaseline} | * | HiLo | 6 | {@link OverlayIndicatorOverridesHiLo} | * | Column | 7 | {@link OverlayIndicatorOverridesColumn} | * | HLCArea | 8 | {@link OverlayIndicatorOverridesHLCArea} | * | LineWithMarkers | 14 | {@link OverlayIndicatorOverridesLineWithMarkers} | * | Stepline | 15 | {@link OverlayIndicatorOverridesStepline} | * */ style: Exclude; /** * Price line visibility. * Default value: `false` */ showPriceLine: boolean; /** * Enables the _Overlay_ to extend the time scale. * Default value: `false` */ allowExtendTimeScale: boolean; /** * [`minTick`](../../api/interfaces/Charting_Library.ChartPropertiesOverrides.md#mainseriespropertiesmintick) * Default value: `default` */ minTick: string; } interface OverlayIndicatorOverridesArea extends Partial { style: ChartStyle.Area; /** * Use the properties as follow: `areaStyle.color1`: `pink` */ [key: string]: StudyOverrideValueType | undefined; } interface OverlayIndicatorOverridesBar extends Partial { style: ChartStyle.Bar; /** * Use the properties as follow: `barStyle.downColor`: `pink` */ [key: string]: StudyOverrideValueType | undefined; } interface OverlayIndicatorOverridesBaseline extends Partial { style: ChartStyle.Baseline; /** * Use the properties as follow: `baselineStyle.baselineColor`: `pink` */ [key: string]: StudyOverrideValueType | undefined; } interface OverlayIndicatorOverridesCandle extends Partial { style: ChartStyle.Candle; /** * Use the properties as follow: `candleStyle.downColor`: `pink` */ [key: string]: StudyOverrideValueType | undefined; } interface OverlayIndicatorOverridesColumn extends Partial { style: ChartStyle.Column; /** * Use the properties as follow: `columnStyle.downColor`: `pink` */ [key: string]: StudyOverrideValueType | undefined; } interface OverlayIndicatorOverridesHLCArea extends Partial { style: ChartStyle.HLCArea; /** * Use the properties as follow: `hlcAreaStyle.highLineColor`: `pink` */ [key: string]: StudyOverrideValueType | undefined; } interface OverlayIndicatorOverridesHiLo extends Partial { style: ChartStyle.HiLo; /** * Use the properties as follow: `hiloStyle.color`: `pink` */ [key: string]: StudyOverrideValueType | undefined; } interface OverlayIndicatorOverridesHollowCandle extends Partial { style: ChartStyle.HollowCandle; /** * Use the properties as follow: `hollowCandleStyle.downColor`: `pink` */ [key: string]: StudyOverrideValueType | undefined; } interface OverlayIndicatorOverridesLine extends Partial { style: ChartStyle.Line; /** * Use the properties as follow: `lineStyle.color`: `pink` */ [key: string]: StudyOverrideValueType | undefined; } interface OverlayIndicatorOverridesLineWithMarkers extends Partial { style: ChartStyle.LineWithMarkers; /** * Use the properties as follow: `lineWithMarkerStyle.color`: `pink` */ [key: string]: StudyOverrideValueType | undefined; } interface OverlayIndicatorOverridesStepline extends Partial { style: ChartStyle.Stepline; /** * Use the properties as follow: `steplineStyle.color`: `pink` */ [key: string]: StudyOverrideValueType | undefined; } /** * Overrides for the 'Parabolic SAR' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface ParabolicSARIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `cross` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Parameters passed to getBars */ interface PeriodParams { /** * Unix timestamp (leftmost requested bar) */ from: number; /** * Unix timestamp (rightmost requested bar - not inclusive) */ to: number; /** * The exact amount of bars to load, should be considered a higher priority than `from` if your datafeed supports it */ countBack: number; /** * Used to identify if it's the first call of getBars */ firstDataRequest: boolean; } interface PineStudyResultComposite { /** Type is composite */ type: "composite"; /** Composite data */ data: TPineStudyResultSimple[]; } /** * Overrides for the 'Pivot Points Standard' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface PivotPointsStandardIndicatorOverrides { [key: string]: StudyOverrideValueType; } interface PlusClickParams extends MouseEventParams { /** Symbol identifier */ symbol: string | null; /** Price */ price: number; } interface PnFStylePreferences { /** Up mark color */ upColor: string; /** Down mark color */ downColor: string; /** Up projection mark color */ upColorProjection: string; /** Down projection mark color */ downColorProjection: string; } /** * Polygon Preferences */ interface PolygonPreferences { /** Transparency of the Polygon. Value between 0 and 100, where `100` -> fully transparent */ transparency: number; /** Color of the Polygon */ color: string; } /** * Override properties for the Position drawing tool. */ interface PositionLineToolOverrides { /** Default value: `rgba(255, 255, 255, 0.25)` */ "linetoolposition.bodyBackgroundColor": string; /** Default value: `25` */ "linetoolposition.bodyBackgroundTransparency": number; /** Default value: `#4094e8` */ "linetoolposition.bodyBorderBuyColor": string; /** Default value: `#e75656` */ "linetoolposition.bodyBorderSellColor": string; /** Default value: `true` */ "linetoolposition.bodyFontBold": boolean; /** Default value: `Verdana` */ "linetoolposition.bodyFontFamily": string; /** Default value: `false` */ "linetoolposition.bodyFontItalic": boolean; /** Default value: `9` */ "linetoolposition.bodyFontSize": number; /** Default value: `#e75656` */ "linetoolposition.bodyTextNegativeColor": string; /** Default value: `#646464` */ "linetoolposition.bodyTextNeutralColor": string; /** Default value: `#268c02` */ "linetoolposition.bodyTextPositiveColor": string; /** Default value: `rgba(255, 255, 255, 0.25)` */ "linetoolposition.closeButtonBackgroundColor": string; /** Default value: `25` */ "linetoolposition.closeButtonBackgroundTransparency": number; /** Default value: `#4094e8` */ "linetoolposition.closeButtonBorderBuyColor": string; /** Default value: `#e75656` */ "linetoolposition.closeButtonBorderSellColor": string; /** Default value: `#4094e8` */ "linetoolposition.closeButtonIconBuyColor": string; /** Default value: `#e75656` */ "linetoolposition.closeButtonIconSellColor": string; /** Default value: `undefined` */ "linetoolposition.closeTooltip": string; /** Default value: `inherit` */ "linetoolposition.extendLeft": string; /** Default value: `#4094e8` */ "linetoolposition.lineBuyColor": string; /** Default value: `inherit` */ "linetoolposition.lineLength": string; /** Default value: `percentage` */ "linetoolposition.lineLengthUnit": string; /** Default value: `#e75656` */ "linetoolposition.lineSellColor": string; /** Default value: `inherit` */ "linetoolposition.lineStyle": string; /** Default value: `inherit` */ "linetoolposition.lineWidth": string; /** Default value: `undefined` */ "linetoolposition.protectTooltip": string; /** Default value: `#4094e8` */ "linetoolposition.quantityBackgroundBuyColor": string; /** Default value: `#e75656` */ "linetoolposition.quantityBackgroundSellColor": string; /** Default value: `#4094e8` */ "linetoolposition.quantityBorderBuyColor": string; /** Default value: `#e75656` */ "linetoolposition.quantityBorderSellColor": string; /** Default value: `true` */ "linetoolposition.quantityFontBold": boolean; /** Default value: `Verdana` */ "linetoolposition.quantityFontFamily": string; /** Default value: `false` */ "linetoolposition.quantityFontItalic": boolean; /** Default value: `9` */ "linetoolposition.quantityFontSize": number; /** Default value: `#ffffff` */ "linetoolposition.quantityTextColor": string; /** Default value: `0` */ "linetoolposition.quantityTextTransparency": number; /** Default value: `rgba(255, 255, 255, 0.25)` */ "linetoolposition.reverseButtonBackgroundColor": string; /** Default value: `25` */ "linetoolposition.reverseButtonBackgroundTransparency": number; /** Default value: `#4094e8` */ "linetoolposition.reverseButtonBorderBuyColor": string; /** Default value: `#e75656` */ "linetoolposition.reverseButtonBorderSellColor": string; /** Default value: `#4094e8` */ "linetoolposition.reverseButtonIconBuyColor": string; /** Default value: `#e75656` */ "linetoolposition.reverseButtonIconSellColor": string; /** Default value: `undefined` */ "linetoolposition.reverseTooltip": string; /** Default value: `undefined` */ "linetoolposition.tooltip": string; } /** * Anchored (fixed) drawing point position as a percentage from the top left of a chart. * For example `{ x: 0.5, y: 0.5 }` for the centre of the chart. */ interface PositionPercents { /** * Position as a percentage from the left edge of the chart. */ x: number; /** * Position as a percentage from the top edge of the chart. */ y: number; } /** * Overrides for the 'Price Channel' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface PriceChannelIndicatorOverrides { /** Default value: `15` */ "highprice line.display": number; /** Default value: `0` */ "highprice line.linestyle": number; /** Default value: `1` */ "highprice line.linewidth": number; /** Default value: `line` */ "highprice line.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "highprice line.trackprice": boolean; /** Default value: `0` */ "highprice line.transparency": number; /** Default value: `#F50057` */ "highprice line.color": string; /** Default value: `15` */ "lowprice line.display": number; /** Default value: `0` */ "lowprice line.linestyle": number; /** Default value: `1` */ "lowprice line.linewidth": number; /** Default value: `line` */ "lowprice line.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "lowprice line.trackprice": boolean; /** Default value: `0` */ "lowprice line.transparency": number; /** Default value: `#F50057` */ "lowprice line.color": string; /** Default value: `15` */ "centerprice line.display": number; /** Default value: `0` */ "centerprice line.linestyle": number; /** Default value: `1` */ "centerprice line.linewidth": number; /** Default value: `line` */ "centerprice line.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "centerprice line.trackprice": boolean; /** Default value: `0` */ "centerprice line.transparency": number; /** Default value: `#2196F3` */ "centerprice line.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Price Oscillator' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface PriceOscillatorIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#089981` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Price Volume Trend' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface PriceVolumeTrendIndicatorOverrides { /** Default value: `15` */ "pvt.display": number; /** Default value: `0` */ "pvt.linestyle": number; /** Default value: `1` */ "pvt.linewidth": number; /** Default value: `line` */ "pvt.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "pvt.trackprice": boolean; /** Default value: `0` */ "pvt.transparency": number; /** Default value: `#2196F3` */ "pvt.color": string; [key: string]: StudyOverrideValueType; } /** * Position defined by a price and time. */ interface PricedPoint extends TimePoint { /** Price */ price: number; } /** * Options for specifying a Range which includes a resolution, and a time frame. */ interface RangeOptions { /** * Time frame for the range. */ val: TimeFrameValue; /** * Resolution for the range. */ res: ResolutionString; } /** * Overrides for the 'Rank Correlation Index' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface RankCorrelationIndexIndicatorOverrides { /** Default value: `#787B86` */ "zero line.color": string; /** Default value: `2` */ "zero line.linestyle": number; /** Default value: `1` */ "zero line.linewidth": number; /** Default value: `true` */ "zero line.visible": boolean; /** Default value: `0` */ "zero line.value": number; /** Default value: `15` */ "rci.display": number; /** Default value: `0` */ "rci.linestyle": number; /** Default value: `1` */ "rci.linewidth": number; /** Default value: `line` */ "rci.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "rci.trackprice": boolean; /** Default value: `0` */ "rci.transparency": number; /** Default value: `#2196F3` */ "rci.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Rate Of Change' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface RateOfChangeIndicatorOverrides { /** Default value: `#787B86` */ "zero line.color": string; /** Default value: `2` */ "zero line.linestyle": number; /** Default value: `1` */ "zero line.linewidth": number; /** Default value: `true` */ "zero line.visible": boolean; /** Default value: `0` */ "zero line.value": number; /** Default value: `15` */ "roc.display": number; /** Default value: `0` */ "roc.linestyle": number; /** Default value: `1` */ "roc.linewidth": number; /** Default value: `line` */ "roc.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "roc.trackprice": boolean; /** Default value: `0` */ "roc.transparency": number; /** Default value: `#2196F3` */ "roc.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Ratio' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface RatioIndicatorOverrides { /** Default value: `undefined` */ "negativefill.color": string; /** Default value: `0` */ "negativefill.transparency": number; /** Default value: `true` */ "negativefill.visible": boolean; /** Default value: `undefined` */ "positivefill.color": string; /** Default value: `0` */ "positivefill.transparency": number; /** Default value: `true` */ "positivefill.visible": boolean; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `2` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `35` */ "plot.transparency": number; /** Default value: `#800080` */ "plot.color": string; /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "baseline.linestyle": number; /** Default value: `2` */ "baseline.linewidth": number; /** Default value: `line` */ "baseline.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "baseline.trackprice": boolean; /** Default value: `0` */ "baseline.transparency": number; /** Default value: `rgba(0, 0, 0, 0)` */ "baseline.color": string; /** Default value: `0` */ "baseline.display": number; [key: string]: StudyOverrideValueType; } interface RawStudyMetaInfo extends RawStudyMetaInfoBase { /** Identifier for Study */ readonly id: RawStudyMetaInfoId; } interface RawStudyMetaInfoBase { /** * Description of the study. It will be displayed in the Indicators window and will be used as a name argument when calling the createStudy method */ readonly description: string; /** Short description of the study. Will be displayed on the chart */ readonly shortDescription: string; /** Name for the study */ readonly name?: string; /** Metainfo version of the study. The current version is 53, and the default one is 0. */ readonly _metainfoVersion?: number; /** Use {@link format} instead. * @deprecated */ readonly precision?: number | string; /** * A type of data that an indicator displays, such as `volume` or `price`. Values on the [Price Scale](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Price-Scale) depend on this data type. * Additionally, you can adjust a precision of indicator values. To do this, specify the `precision` property in {@link StudyPlotValuePrecisionFormat}. * * For more information about `format`, refer to the [Metainfo](https://www.tradingview.com/charting-library-docs/latest/custom_studies/metainfo/) article. */ readonly format: StudyPlotValueFormat; /** Whether the study should appear on the main series pane */ readonly is_price_study?: boolean; /** should be `true` in Custom Study */ readonly isCustomIndicator?: boolean; /** Whether the study price scale should be the same as the main series one. */ readonly linkedToSeries?: boolean; /** Price scale to use for the study */ readonly priceScale?: StudyTargetPriceScale; /** Whether the study should appear in Indicators list. */ readonly is_hidden_study?: boolean; /** an object containing settings that are applied when user clicks 'Apply Defaults'. See dedicated article: [Custom Studies Defaults](https://www.tradingview.com/charting-library-docs/latest/custom_studies/metainfo/Custom-Studies-Defaults) */ readonly defaults: Readonly>; /** Bands */ readonly bands?: readonly Readonly[]; /** Filled area is a special object, which allows coloring an area between two plots or hlines. Please note, that it is impossible to fill the area between a band and a hline. */ readonly filledAreas?: readonly Readonly[]; /** An array of objects that represent input parameters. For more information, refer to the [Inputs](https://www.tradingview.com/charting-library-docs/latest/custom_studies/metainfo/Custom-Studies-Inputs) article. */ readonly inputs?: StudyInputInfoList; /** Symbol source */ readonly symbolSource?: SymbolSource; /** * definitions of palettes that are used in plots and defaults. Palettes allows you use different styles (not only colors) for each line point. * * This object contains palette names as keys, and palette info as values: `[palette.name]: { colors, valToIndex, addDefaultColor }`, where * - `colors`* - an object `{ [color_id]: { name: 'name' }}`, where name is a string that will appear on Style tab of study properties dialog. * - `valToIndex` - an object, the mapping between the values that are returned by the script and palette colors. * - `addDefaultColor` - boolean, if true the defaults are used for colorer type plot, when its value is null or undefined. */ readonly palettes?: MappedObject>; /** array with study plots info. See dedicated article: [Custom Studies Plots](https://www.tradingview.com/charting-library-docs/latest/custom_studies/Custom-Studies-Plots) */ readonly plots?: readonly Readonly[]; /** an object with plot id as keys and style info as values. */ readonly styles?: MappedObject>; /** array with study plots info. See dedicated article: [Custom Studies OHLC Plots](https://www.tradingview.com/charting-library-docs/latest/custom_studies/Custom-Studies-OHLC-Plots) */ readonly ohlcPlots?: MappedObject>; /** Financial Period */ readonly financialPeriod?: FinancialPeriod; /** Key for grouping studies */ readonly groupingKey?: string; /** Define should be study on series level or not */ readonly behind_chart?: boolean; } /** * Overrides for the 'Regression Trend' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface RegressionTrendIndicatorOverrides { [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Relative Strength Index' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface RelativeStrengthIndexIndicatorOverrides { /** Default value: `#7E57C2` */ "hlines background.color": string; /** Default value: `90` */ "hlines background.transparency": number; /** Default value: `true` */ "hlines background.visible": boolean; /** Default value: `#787B86` */ "upperlimit.color": string; /** Default value: `2` */ "upperlimit.linestyle": number; /** Default value: `1` */ "upperlimit.linewidth": number; /** Default value: `true` */ "upperlimit.visible": boolean; /** Default value: `70` */ "upperlimit.value": number; /** Default value: `-1.1` */ "upperlimit.zorder": number; /** Default value: `#787B86` */ "middlelimit.color": string; /** Default value: `2` */ "middlelimit.linestyle": number; /** Default value: `1` */ "middlelimit.linewidth": number; /** Default value: `true` */ "middlelimit.visible": boolean; /** Default value: `50` */ "middlelimit.value": number; /** Default value: `-1.11` */ "middlelimit.zorder": number; /** Default value: `#787B86` */ "lowerlimit.color": string; /** Default value: `2` */ "lowerlimit.linestyle": number; /** Default value: `1` */ "lowerlimit.linewidth": number; /** Default value: `true` */ "lowerlimit.visible": boolean; /** Default value: `30` */ "lowerlimit.value": number; /** Default value: `-1.111` */ "lowerlimit.zorder": number; /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#7E57C2` */ "plot.color": string; /** Default value: `0` */ "smoothed ma.display": number; /** Default value: `0` */ "smoothed ma.linestyle": number; /** Default value: `1` */ "smoothed ma.linewidth": number; /** Default value: `line` */ "smoothed ma.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "smoothed ma.trackprice": boolean; /** Default value: `0` */ "smoothed ma.transparency": number; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Relative Vigor Index' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface RelativeVigorIndexIndicatorOverrides { /** Default value: `15` */ "rvgi.display": number; /** Default value: `0` */ "rvgi.linestyle": number; /** Default value: `1` */ "rvgi.linewidth": number; /** Default value: `line` */ "rvgi.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "rvgi.trackprice": boolean; /** Default value: `0` */ "rvgi.transparency": number; /** Default value: `#089981` */ "rvgi.color": string; /** Default value: `15` */ "signal.display": number; /** Default value: `0` */ "signal.linestyle": number; /** Default value: `1` */ "signal.linewidth": number; /** Default value: `line` */ "signal.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "signal.trackprice": boolean; /** Default value: `0` */ "signal.transparency": number; /** Default value: `#F23645` */ "signal.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Relative Volatility Index' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface RelativeVolatilityIndexIndicatorOverrides { /** Default value: `#7E57C2` */ "hlines background.color": string; /** Default value: `90` */ "hlines background.transparency": number; /** Default value: `true` */ "hlines background.visible": boolean; /** Default value: `#787B86` */ "upperlimit.color": string; /** Default value: `2` */ "upperlimit.linestyle": number; /** Default value: `1` */ "upperlimit.linewidth": number; /** Default value: `true` */ "upperlimit.visible": boolean; /** Default value: `80` */ "upperlimit.value": number; /** Default value: `#787B86` */ "lowerlimit.color": string; /** Default value: `2` */ "lowerlimit.linestyle": number; /** Default value: `1` */ "lowerlimit.linewidth": number; /** Default value: `true` */ "lowerlimit.visible": boolean; /** Default value: `20` */ "lowerlimit.value": number; /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#7E57C2` */ "plot.color": string; [key: string]: StudyOverrideValueType; } interface RenkoStylePreferences { /** Up bar color */ upColor: string; /** Down bar color */ downColor: string; /** Up bar border color */ borderUpColor: string; /** Down bar border color */ borderDownColor: string; /** Projection up bar color */ upColorProjection: string; /** Projection down bar color */ downColorProjection: string; /** Projection up bar border color */ borderUpColorProjection: string; /** Projection down bar border color */ borderDownColorProjection: string; /** Up bar wick color */ wickUpColor: string; /** Down bar wick color */ wickDownColor: string; } /** * Overrides for the 'SMI Ergodic Indicator/Oscillator' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface SMIErgodicIndicatorOscillatorIndicatorOverrides { /** Default value: `15` */ "indicator.display": number; /** Default value: `0` */ "indicator.linestyle": number; /** Default value: `1` */ "indicator.linewidth": number; /** Default value: `line` */ "indicator.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "indicator.trackprice": boolean; /** Default value: `0` */ "indicator.transparency": number; /** Default value: `#2196F3` */ "indicator.color": string; /** Default value: `15` */ "signal.display": number; /** Default value: `0` */ "signal.linestyle": number; /** Default value: `1` */ "signal.linewidth": number; /** Default value: `line` */ "signal.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "signal.trackprice": boolean; /** Default value: `0` */ "signal.transparency": number; /** Default value: `#FF6D00` */ "signal.color": string; /** Default value: `15` */ "oscillator.display": number; /** Default value: `0` */ "oscillator.linestyle": number; /** Default value: `1` */ "oscillator.linewidth": number; /** Default value: `histogram` */ "oscillator.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "oscillator.trackprice": boolean; /** Default value: `0` */ "oscillator.transparency": number; /** Default value: `#FF5252` */ "oscillator.color": string; [key: string]: StudyOverrideValueType; } /** * Save chart error information */ interface SaveChartErrorInfo { /** Error message */ message: string; } /** * Save Chart Options */ interface SaveChartOptions { /** * Whether drawings should be included in the saved data. * * @default true */ includeDrawings?: boolean; } /** * Options: Save Chart to Server */ interface SaveChartToServerOptions { /** Name of chart */ chartName?: string; /** Default chart name */ defaultChartName?: string; } interface SaveLoadChartRecord { /** Unique id for chart */ id: string | number; /** Name of chart */ name: string; /** URL of chart image */ image_url: string; /** Modified ISO number for chart */ modified_iso: number; /** Short symbol name */ short_symbol: string; /** Chart interval */ interval: ResolutionString; } interface SavedStateMetaInfo { /** Unique ID */ uid: number; /** Name of chart */ name: string; /** Chart description */ description: string; } /** * [Symbol Search](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Symbol-Search) result item. * Pass the resulting array to the callback for [`searchSymbols`](https://www.tradingview.com/charting-library-docs/latest/connecting_data/datafeed-api/required-methods#searchsymbols) or [`searchSymbolsPaginated`](https://www.tradingview.com/charting-library-docs/latest/connecting_data/datafeed-api/additional-methods#searchsymbolspaginated). * * @example * ``` * { * description: 'Apple Inc.', * exchange: 'NasdaqNM', * symbol: 'AAPL', * ticker: 'AAPL', * type: 'stock', * } * ``` */ interface SearchSymbolResultItem { /** Short symbol name */ symbol: string; /** Description */ description: string; /** Exchange name */ exchange: string; /** * It is a unique identifier for a particular symbol in your [symbology](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology). * * You should avoid using colons (":") in ticker values unless you are following the TradingView format: "NYSE:IBM". Using colons may cause unexpected behaviour and display bugs. * * Corresponds with {@link LibrarySymbolInfo.ticker}. */ ticker?: string; /** * Type of symbol * * 'stock' | 'futures' | 'forex' | 'index' */ type: string; /** * URL of image/s to be displayed as the logo/s for the symbol. The `show_symbol_logos` featureset needs to be enabled for this to be visible in the UI. * * - If a single url is returned then that url will solely be used to display the symbol logo. * - If two urls are provided then the images will be displayed as two partially overlapping * circles with the first url appearing on top. This is typically used for FOREX where you would * like to display two country flags as the symbol logo. * * The image/s should ideally be square in dimension. You can use any image type which * the browser supports natively. Simple SVG images are recommended. * * Examples: * - `https://yourserver.com/symbolName.svg` * - `/images/myImage.png` * - `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3...` * - `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4...` */ logo_urls?: [ string ] | [ string, string ]; /** * URL of image to be displayed as the logo for the exchange. The `show_exchange_logos` featureset needs to be enabled for this to be visible in the UI. * * The image should ideally be square in dimension. You can use any image type which * the browser supports natively. Simple SVG images are recommended. * * Examples: * - `https://yourserver.com/exchangeLogo.svg` * - `/images/myImage.png` * - `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3...` * - `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4...` */ exchange_logo?: string; } /** * Description of a series field. * This is used when `includeSeries: true` is defined in `exportData`. */ interface SeriesFieldDescriptor { /** Type is a `value` */ type: "value"; /** Source type is a `series` */ sourceType: "series"; /** The name of the plot (open, high, low, close) */ plotTitle: string; /** Title of the series */ sourceTitle: string; } /** * Style preferences map for the chart types */ interface SeriesPreferencesMap { /** Bar Style Preferences */ [ChartStyle.Bar]: BarStylePreferences; /** Candle Style Preferences */ [ChartStyle.Candle]: CandleStylePreferences; /** Line Style Preferences */ [ChartStyle.Line]: LineStylePreferences; /** Line With Markers Style Preferences */ [ChartStyle.LineWithMarkers]: LineStylePreferences; /** Step Line Style Preferences */ [ChartStyle.Stepline]: LineStylePreferences; /** Area Style Preferences */ [ChartStyle.Area]: AreaStylePreferences; /** HLC Area Style Preferences */ [ChartStyle.HLCArea]: HLCAreaStylePreferences; /** Renko Style Preferences */ [ChartStyle.Renko]: RenkoStylePreferences; /** Kagi Style Preferences */ [ChartStyle.Kagi]: KagiStylePreferences; /** Point and Figure Style Preferences */ [ChartStyle.PnF]: PnFStylePreferences; /** Line Break Style Preferences */ [ChartStyle.LineBreak]: LineBreakStylePreferences; /** Heikin Ashi Style Preferences */ [ChartStyle.HeikinAshi]: HeikinAshiStylePreferences; /** Hollow Candle Style Preferences */ [ChartStyle.HollowCandle]: HollowCandleStylePreferences; /** Baseline Style Preferences */ [ChartStyle.Baseline]: BaselineStylePreferences; /** High-Low Style Preferences */ [ChartStyle.HiLo]: HiLoStylePreferences; /** Columns Style Preferences */ [ChartStyle.Column]: ColumnStylePreferences; /** HLC bars Style Preferences */ [ChartStyle.HLCBars]: HLCBarsStylePreferences; /** Volume Candle Style Preferences */ [ChartStyle.VolCandle]: CandleStylePreferences; } /** * Overrides for the 'Sessions' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface SessionsIndicatorOverrides { [key: string]: StudyOverrideValueType; } /** * Options for setting a chart's resolution. */ interface SetResolutionOptions { /** * An optional callback function. Called when the data for the new resolution has loaded. */ dataReady?: () => void; /** * A boolean flag. Allows to disable making the current chart active in the layout. */ doNotActivateChart?: boolean; } /** * Options for setting a chart's symbol. */ interface SetSymbolOptions { /** * An optional callback function. Called when the data for the new symbol has loaded. */ dataReady?: () => void; /** * A boolean flag. Allows to disable making the current chart active in the layout. */ doNotActivateChart?: boolean; } /** * Options for setting the visible range. * * Setting `applyDefaultRightMargin` or `percentRightMargin` will result in the `to` value * of the range specified being ignored and the timestamp of the latest bar on the chart * being used instead. */ interface SetVisibleRangeOptions { /** * Apply the default right offset (margin) when setting the range. */ applyDefaultRightMargin?: boolean; /** * Apply a percentage right offset (margin) when setting the range. */ percentRightMargin?: number; /** * In the current implementation, we cannot capture all errors during the `SetVisibleRange` process, * which means we cannot guarantee that the process will always be resolved or rejected. * To address this issue, you can use the `rejectByTimeout` option to ensure rejection after a specified timeout. */ rejectByTimeout?: number; } /** * Overrides for the 'Smoothed Moving Average' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface SmoothedMovingAverageIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#673AB7` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Spread' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface SpreadIndicatorOverrides { /** Default value: `undefined` */ "negative fill.color": string; /** Default value: `0` */ "negative fill.transparency": number; /** Default value: `true` */ "negative fill.visible": boolean; /** Default value: `undefined` */ "positive fill.color": string; /** Default value: `0` */ "positive fill.transparency": number; /** Default value: `true` */ "positive fill.visible": boolean; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `2` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `35` */ "plot.transparency": number; /** Default value: `#800080` */ "plot.color": string; /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "baseline.linestyle": number; /** Default value: `2` */ "baseline.linewidth": number; /** Default value: `line` */ "baseline.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "baseline.trackprice": boolean; /** Default value: `0` */ "baseline.transparency": number; /** Default value: `rgba(0, 0, 0, 0)` */ "baseline.color": string; /** Default value: `0` */ "baseline.display": number; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Standard Deviation' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface StandardDeviationIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#089981` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Standard Error Bands' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface StandardErrorBandsIndicatorOverrides { /** Default value: `#2196F3` */ "background.color": string; /** Default value: `95` */ "background.transparency": number; /** Default value: `true` */ "background.visible": boolean; /** Default value: `15` */ "plot 1.display": number; /** Default value: `0` */ "plot 1.linestyle": number; /** Default value: `1` */ "plot 1.linewidth": number; /** Default value: `line` */ "plot 1.plottype": LineStudyPlotStyleName; /** Default value: `0` */ "plot 1.transparency": number; /** Default value: `false` */ "plot 1.trackprice": boolean; /** Default value: `#2196F3` */ "plot 1.color": string; /** Default value: `15` */ "plot 2.display": number; /** Default value: `0` */ "plot 2.linestyle": number; /** Default value: `1` */ "plot 2.linewidth": number; /** Default value: `0` */ "plot 2.transparency": number; /** Default value: `line` */ "plot 2.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot 2.trackprice": boolean; /** Default value: `#FF6D00` */ "plot 2.color": string; /** Default value: `15` */ "plot 3.display": number; /** Default value: `0` */ "plot 3.linestyle": number; /** Default value: `1` */ "plot 3.linewidth": number; /** Default value: `0` */ "plot 3.transparency": number; /** Default value: `line` */ "plot 3.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot 3.trackprice": boolean; /** Default value: `#2196F3` */ "plot 3.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Standard Error' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface StandardErrorIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#FF6D00` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /* eslint-enable jsdoc/require-jsdoc */ /** * Position defined by an OHLC price on a bar at a specified time. */ interface StickedPoint extends TimePoint { /** Candle stick value to 'stick' on */ channel: "open" | "high" | "low" | "close"; } /** * Overrides for the 'Stochastic' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface StochasticIndicatorOverrides { /** Default value: `#2196F3` */ "hlines background.color": string; /** Default value: `90` */ "hlines background.transparency": number; /** Default value: `true` */ "hlines background.visible": boolean; /** Default value: `#787B86` */ "upperlimit.color": string; /** Default value: `2` */ "upperlimit.linestyle": number; /** Default value: `1` */ "upperlimit.linewidth": number; /** Default value: `true` */ "upperlimit.visible": boolean; /** Default value: `80` */ "upperlimit.value": number; /** Default value: `#787B86` */ "lowerlimit.color": string; /** Default value: `2` */ "lowerlimit.linestyle": number; /** Default value: `1` */ "lowerlimit.linewidth": number; /** Default value: `true` */ "lowerlimit.visible": boolean; /** Default value: `20` */ "lowerlimit.value": number; /** Default value: `15` */ "%k.display": number; /** Default value: `0` */ "%k.linestyle": number; /** Default value: `1` */ "%k.linewidth": number; /** Default value: `line` */ "%k.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "%k.trackprice": boolean; /** Default value: `0` */ "%k.transparency": number; /** Default value: `#2196F3` */ "%k.color": string; /** Default value: `15` */ "%d.display": number; /** Default value: `0` */ "%d.linestyle": number; /** Default value: `1` */ "%d.linewidth": number; /** Default value: `line` */ "%d.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "%d.trackprice": boolean; /** Default value: `0` */ "%d.transparency": number; /** Default value: `#FF6D00` */ "%d.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Stochastic RSI' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface StochasticRSIIndicatorOverrides { /** Default value: `#2196F3` */ "hlines background.color": string; /** Default value: `90` */ "hlines background.transparency": number; /** Default value: `true` */ "hlines background.visible": boolean; /** Default value: `#787B86` */ "upperlimit.color": string; /** Default value: `2` */ "upperlimit.linestyle": number; /** Default value: `1` */ "upperlimit.linewidth": number; /** Default value: `true` */ "upperlimit.visible": boolean; /** Default value: `80` */ "upperlimit.value": number; /** Default value: `#787B86` */ "lowerlimit.color": string; /** Default value: `2` */ "lowerlimit.linestyle": number; /** Default value: `1` */ "lowerlimit.linewidth": number; /** Default value: `true` */ "lowerlimit.visible": boolean; /** Default value: `20` */ "lowerlimit.value": number; /** Default value: `15` */ "%k.display": number; /** Default value: `0` */ "%k.linestyle": number; /** Default value: `1` */ "%k.linewidth": number; /** Default value: `line` */ "%k.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "%k.trackprice": boolean; /** Default value: `0` */ "%k.transparency": number; /** Default value: `#2196F3` */ "%k.color": string; /** Default value: `15` */ "%d.display": number; /** Default value: `0` */ "%d.linestyle": number; /** Default value: `1` */ "%d.linewidth": number; /** Default value: `line` */ "%d.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "%d.trackprice": boolean; /** Default value: `0` */ "%d.transparency": number; /** Default value: `#FF6D00` */ "%d.color": string; [key: string]: StudyOverrideValueType; } /** * A description of a study arrows plot. */ interface StudyArrowsPlotInfo extends StudyPlotBaseInfo { /** @inheritDoc */ readonly type: StudyPlotType.Arrows; } /** * Study arrow plot style preferences. */ interface StudyArrowsPlotPreferences extends StudyPlotBasePreferences { /** * Up arrow color. */ colorup: string; /** * Down arrow color. */ colordown: string; /** * Minimum arrow height. */ minHeight?: number; /** * Maximum arrow height. */ maxHeight?: number; } /** * Preferences for adjusting the visual appearance of the background of a band area. */ interface StudyBandBackgroundPreferences { /** Background color for the Band area */ backgroundColor: string; /** Transparency of the band area */ transparency?: number; /** Whether the background area should be filled with the `backgroundColor` */ fillBackground: boolean; } /** * A description of a study band. */ interface StudyBandInfo { /** * Band ID. Used in {@link StudyFilledAreaInfo.objAId} and {@link StudyFilledAreaInfo.objBId}. * * @see StudyFilledAreaInfo */ readonly id?: string; /** * Band name. */ readonly name: string; /** * Band style inputs visibility flag. Used to hide the band from the style tab of study properties dialogs. */ readonly isHidden?: boolean; /** * Band z-order. */ readonly zorder?: number; } /** * Study band style preferences. */ interface StudyBandPreferences extends StudyBandStyle, StudyBandInfo { } /** * Study band style preferences. */ interface StudyBandStyle { /** * Color. * * @example '#ffffff'. */ color: string; /** * Line style. * * @example 2 // Dotted line. */ linestyle: number; /** * Line width. */ linewidth: number; /** * Value at which the band will be drawn. * * @example 75 // Drawn at price = 75. */ value: number; /** * Band visibility flag. */ visible: boolean; } /** * A description of a bar colorer plot. */ interface StudyBarColorerPlotInfo extends StudyPalettedPlotInfo { /** @inheritDoc */ readonly type: StudyPlotType.BarColorer; } interface StudyBarTimeInputInfo extends StudyInputBaseInfo { /** Input type is BarTime */ readonly type: StudyInputType.BarTime; /** Default value */ readonly defval: number; /** Maximum time */ readonly max: number; /** Minimum time */ readonly min: number; } /** * A description of a background colorer plot. */ interface StudyBgColorerPlotInfo extends StudyPalettedPlotInfo { /** @inheritDoc */ readonly type: StudyPlotType.BgColorer; } interface StudyBooleanInputInfo extends StudyInputBaseInfo { /** Input type is Boolean */ readonly type: StudyInputType.Bool; /** Default value for the input */ readonly defval: boolean; } /** * A description of a border colorer plot. */ interface StudyCandleBorderColorerPlotInfo extends StudyPalettedPlotInfo, StudyTargetedPlotInfo { /** @inheritDoc */ readonly type: StudyPlotType.CandleBorderColorer; } /** * A description of a wick colorer plot. */ interface StudyCandleWickColorerPlotInfo extends StudyPalettedPlotInfo, StudyTargetedPlotInfo { /** @inheritDoc */ readonly type: StudyPlotType.CandleWickColorer; } /** * A description of a study characters plot. */ interface StudyCharsPlotInfo extends StudyPlotBaseInfo { /** @inheritDoc */ readonly type: StudyPlotType.Chars; } interface StudyCharsPlotPreferences extends StudyPlotBasePreferences { /** Character */ char?: string; /** Location for the mark */ location: MarkLocation; /** Color */ color: string; /** Text color */ textColor: string; } interface StudyColorInputInfo extends StudyInputBaseInfo { /** Input type is Color */ readonly type: StudyInputType.Color; /** Default value for the input */ readonly defval: string; } /** * A description of a colorer plot. */ interface StudyColorerPlotInfo extends StudyPalettedPlotInfo, StudyTargetedPlotInfo { /** @inheritDoc */ readonly type: StudyPlotType.Colorer; } /** * A description of a study data offset plot. */ interface StudyDataOffsetPlotInfo extends StudyTargetedPlotInfo { /** @inheritDoc */ readonly type: StudyPlotType.DataOffset; } /** * A description of a study data plot. */ interface StudyDataPlotInfo extends StudyTargetedPlotInfo { /** @inheritDoc */ readonly type: StudyPlotType.Data; } interface StudyDefaults { /** Defaults for the area background */ areaBackground: StudyBandBackgroundPreferences; /** Defaults for the bands background */ bandsBackground: StudyBandBackgroundPreferences; /** Defaults for the bands */ bands: readonly Required[]; /** Defaults for the filled area styles */ filledAreasStyle: MappedObject; /** Defaults for the study inputs */ inputs: StudyInputsSimple; /** Defaults for the study palette styles */ palettes: MappedObject; /** Default for the study precision */ precision: number | string; /** Defaults for the study styles */ styles: MappedObject; /** Defaults for the OHLC plots */ ohlcPlots: MappedObject; /** Defaults for the study graphics */ graphics: StudyGraphicsDefaults; } /** * A description of a down colorer plot. */ interface StudyDownColorerPlotInfo extends StudyPalettedPlotInfo, StudyTargetedPlotInfo { /** @inheritDoc */ readonly type: StudyPlotType.DownColorer; } /** * Description of a study field. * This is used when `includedStudies: true` is defined in `exportData`. */ interface StudyFieldDescriptor { /** Type is a `value` */ type: "value"; /** Source type is a `study` */ sourceType: "study"; /** * The ID of the source study. */ sourceId: string; /** * The title of the source study. */ sourceTitle: string; /** * The title of the source plot. */ plotTitle: string; } /** * Study filled area gradient styles. */ interface StudyFilledAreaGradientColorStyle extends StudyFilledAreaStyleBase { /** Gradient fill type */ fillType: "gradient"; /** * Gradient top color. */ topColor?: string; /** * Gradient bottom color. */ bottomColor?: string; /** * Value at which the top of the gradient is drawn. * * @example 75 // Drawn at price = 75 */ topValue?: number; /** * Value at which the bottom of the gradient is drawn. * * @example 75 // Drawn at price = 75 */ bottomValue?: number; } /** * A description of a study filled area. */ interface StudyFilledAreaInfo { /** * Study ID. */ readonly id: string; /** * Study band ID. * * @see StudyBandInfo */ readonly objAId: string; /** * Study band ID. * * @see StudyBandInfo */ readonly objBId: string; /** * Title that will appear in the styles tab of the study settings dialog. */ readonly title: string; /** * Filled area type. */ readonly type: FilledAreaType; /** * Should gaps in the area be filled? */ readonly fillgaps?: boolean; /** * Filled area z-order. */ readonly zorder?: number; /** * Filled area's style inputs visibility flag. Used to hide the band from the style tab of study properties dialogs. */ readonly isHidden?: boolean; /** * Color palette ID. */ readonly palette?: string; /** * Value at which the top of the filled area is drawn. * * @example 75 // Drawn at price = 75 */ readonly topValue?: number; /** * Value at which the bottom of the filled area is drawn. * * @example 75 // Drawn at price = 75 */ readonly bottomValue?: number; /** * Color for the top of the filled area. */ readonly topColor?: string; /** * Color for the bottom of the filled area. */ readonly bottomColor?: string; /** * Should the area be filled up to the point that two plots intersect, instead of by plot index? * * Used for plot_plot filled area types. */ readonly fillToIntersection?: boolean; } /** * Study solid color filled area style preferences. */ interface StudyFilledAreaSolidColorStyle extends StudyFilledAreaStyleBase { /** Solid Fill type */ fillType: undefined; /** * Color. * * @example '#ffffff' */ color: string; } /** * Base study filled area style preferences. */ interface StudyFilledAreaStyleBase { /** * Filled area's visibility. */ visible: boolean; /** * Filled area's transparency. * * @min 0 * @max 100 */ transparency?: number; } interface StudyGraphicsDefaults { /** Defaults for the horizontal lines study graphics */ horizlines?: ValueByStyleId; /** Defaults for the polygon study graphics */ polygons?: ValueByStyleId; /** Defaults for the horizontal histogram study graphics */ hhists?: ValueByStyleId; /** Defaults for the vertical lines study graphics */ vertlines?: ValueByStyleId; } interface StudyInputBaseInfo { /** Id for the input */ readonly id: string; /** Title of the input */ readonly name: string; /** default value of the input variable. It has the specific type for a given input and can be optional. */ readonly defval?: StudyInputValue; /** Input type */ readonly type: StudyInputType; /** if true, then user will be asked to confirm input value before indicator is added to chart. Default value is false. */ readonly confirm?: boolean; /** Is the input hidden */ readonly isHidden?: boolean; /** Is the input visible */ readonly visible?: string; /** Is the input always visible in the legend, even when the user hides indicator inputs in the legend */ readonly isAlwaysShownInLegend?: boolean; /** An array of plot ids, upon the hiding of which, this input should also be hidden within the legend */ readonly hideWhenPlotsHidden?: string[]; /** Whether the input should be rendered based on user inputs */ readonly active?: boolean; } /** * A description of a study input. */ interface StudyInputInformation { /** * The input ID. */ id: StudyInputId; /** * The input name. */ name: string; /** * The input type. */ type: string; /** * The localized input name. */ localizedName: string; } interface StudyInputOptionsTitles { [option: string]: string; } /** * A description of a study input value. */ interface StudyInputValueItem { /** * The input ID. */ id: StudyInputId; /** * The input value. */ value: StudyInputValue; } interface StudyInputsSimple { [inputId: string]: StudyInputValue; } /** * A description of a study line plot. */ interface StudyLinePlotInfo extends StudyPlotBaseInfo { /** @inheritDoc */ readonly type: StudyPlotType.Line; } /** * Study line plot style preferences. */ interface StudyLinePlotPreferences extends StudyPlotBasePreferences { /** * Plot style. */ plottype: LineStudyPlotStyle; /** * Line color. */ color: string; /** * Line style. */ linestyle: LineStyle; /** * Line width. */ linewidth: number; /** * Price line visibility flag. */ trackPrice: boolean; /** * If defined, defines the number of bars to plot on chart. */ readonly showLast?: number; } interface StudyNumericInputInfo extends StudyInputBaseInfo { /** Input type is Numeric */ readonly type: StudyInputType.Integer | StudyInputType.Float | StudyInputType.Price; /** Default value */ readonly defval: number; /** Maximum value */ readonly max?: number; /** Minimum value */ readonly min?: number; /** Step size for value */ readonly step?: number; } /** * A description of an OHLC colorer plot. */ interface StudyOhlcColorerPlotInfo extends StudyPalettedPlotInfo, StudyTargetedPlotInfo { /** @inheritDoc */ readonly type: StudyPlotType.OhlcColorer; } interface StudyOhlcPlotBarsStylePreferences extends StudyOhlcPlotBaseStylePreferences { /** OHLC Plot type: Bars */ plottype: OhlcStudyPlotStyle.OhlcBars; } interface StudyOhlcPlotBaseStylePreferences { /** OHLC plot color */ color: string; /** Bitmask with values from StudyPlotDisplayTarget */ display: StudyPlotDisplayMode; /** Visibility */ visible?: boolean; } interface StudyOhlcPlotCandlesStylePreferences extends StudyOhlcPlotBaseStylePreferences { /** OHLC Plot Type: Candles */ plottype: OhlcStudyPlotStyle.OhlcCandles; /** Whether to draw candle wick */ drawWick: boolean; /** Whether to draw candle border */ drawBorder: boolean; /** Candle wick color */ wickColor: string; /** Candle border color */ borderColor: string; } /** * A description of an OHLC plot. */ interface StudyOhlcPlotInfo extends StudyTargetedPlotInfo { /** @inheritDoc */ readonly type: StudyPlotType.OhlcOpen | StudyPlotType.OhlcHigh | StudyPlotType.OhlcLow | StudyPlotType.OhlcClose; } interface StudyOhlcStylesInfo { /** Title */ readonly title: string; /** Is hidden */ readonly isHidden?: boolean; /** Draw border for OHLC candles */ readonly drawBorder?: boolean; /** Show last value */ readonly showLast?: number; /** * optional flag to indicate the plot should be drawn on main pane */ readonly forceOverlay?: boolean; /** * Info about the Price Scale formatting */ readonly format?: Partial; } /** * Parameter object passed to event callback. */ interface StudyOrDrawingAddedToChartEventParams { /** * Name of the added study or drawing. */ label: string; /** * Id of the added study or drawing. */ value: string; } /** * Study palette color. */ interface StudyPaletteColor { /** * Palette color. */ color: string; /** * Palette style. */ style: number; /** * Palette width. */ width: number; } /** * Study palette style preferences. */ interface StudyPaletteColorPreferences extends StudyPaletteColor, StudyPaletteInfo { } /** * A description of a study palette. */ interface StudyPaletteInfo { /** * Palette name. */ readonly name: string; } /** * Study palette style preferences. */ interface StudyPalettePreferences { /** * Palette colors. */ colors: Record; } /** * Study palette style. */ interface StudyPaletteStyle { /** * Palette colors. */ colors: MappedObject | StudyPaletteColor[]; } /** * A description of a study plot with a palette. */ interface StudyPalettedPlotInfo extends StudyPlotBaseInfo { /** * A color palette ID. */ readonly palette: string; } /** * A description of a study color palettes. */ interface StudyPalettesInfo { /** * Palette colors. */ readonly colors: MappedObject | StudyPaletteInfo[]; /** * Mapping from values returned by the study to palette color index. */ readonly valToIndex?: MappedObject; /** * Use default color for {@link StudyPlotType.Colorer} plots when the value is `NaN`. */ readonly addDefaultColor?: boolean; } /** * Base type for all study plot descriptions. */ interface StudyPlotBaseInfo { /** * Plot ID. */ readonly id: string; /** * Plot type. */ readonly type: string; } /** * Base type for all study plot style preferences. */ interface StudyPlotBasePreferences { /** * Transparency. A number between 1 and 100. * * @example 80 */ transparency?: number; /** * Display mode. See {@link StudyPlotDisplayMode}. * * @example StudyPlotDisplayTarget.None // Do not display the plot. */ display: StudyPlotDisplayMode; /** Visibility */ visible?: boolean; } interface StudyPlotValueInheritFormat { /** Plot value type */ type: "inherit"; } interface StudyPlotValuePrecisionFormat { /** Plot value type */ type: "price" | "volume" | "percent"; /** Plot Value Precision */ precision?: number; } interface StudyPriceInputInfo extends StudyInputBaseInfo { /** Input type is Price */ readonly type: StudyInputType.Price; /** Default value */ readonly defval: number; /** Maximum value */ readonly max?: number; /** Minimum value */ readonly min?: number; /** Step size for value */ readonly step?: number; } interface StudyResolutionInputInfo extends StudyInputBaseInfo { /** Input type is Resolution */ readonly type: StudyInputType.Resolution; /** Default value */ readonly defval: ResolutionString; /** Source Input Options */ readonly options?: string[]; /** Options for Input Titles */ readonly optionsTitles?: StudyInputOptionsTitles; /** Is Monday to Friday Resolution */ readonly isMTFResolution?: boolean; } interface StudyResultValueWithOffset { /** * Value which will be offset */ value: number; /** * Allows you to override the offset of every plot (note that offset of a certain plot should always be the same) */ offset: number; } /** * A description of a RGBA colorer plot. */ interface StudyRgbaColorerPlotInfo extends StudyTargetedPlotInfo { /** @inheritDoc */ readonly type: StudyPlotType.Colorer; } interface StudySessionInputInfo extends StudyInputBaseInfo { /** Input type is Session */ readonly type: StudyInputType.Session; /** Default value */ readonly defval: string; /** Source Input Options */ readonly options?: string[]; /** Options for Input Titles */ readonly optionsTitles?: StudyInputOptionsTitles; } /** * A description of a study shapes plot. */ interface StudyShapesPlotInfo extends StudyPlotBaseInfo { /** @inheritDoc */ readonly type: StudyPlotType.Shapes; } /** * Study shape plot style preferences. */ interface StudyShapesPlotPreferences extends StudyPlotBasePreferences { /** * Plot type. */ plottype: PlotShapeId; /** * Location relative to the bar. */ location: MarkLocation; /** * Color. */ color: string; /** * Text color. */ textColor: string; } interface StudySourceInputInfo extends StudyInputBaseInfo { /** Input type is Source */ readonly type: StudyInputType.Source; /** Default value */ readonly defval: StudyPriceSource | string; /** Source Input Options */ readonly options?: (StudyPriceSource | string)[]; /** Options for Input Titles */ readonly optionsTitles?: StudyInputOptionsTitles; } /** * Study style description. */ interface StudyStyleInfo { /** * Default study description values. */ defaults?: StudyStyleInfoDefaults; /** * Study plot descriptions. */ plots?: readonly Readonly[]; /** * Study plot style descriptions. An object with `plot id` as keys and style info as values */ styles?: Record | undefined>; /** * Study band descriptions. */ bands?: readonly Readonly[]; /** * Study filled area descriptions. Filled area is a special object, which allows coloring an area between two plots. */ filledAreas?: readonly Readonly[]; /** * Study color palettes descriptions. */ palettes?: Record | undefined>; } /** * Default study style preferences. */ interface StudyStyleInfoDefaults { /** * Default study bands style preferences. */ bands?: readonly StudyBandStyle[]; /** * Default study filled areas style preferences. */ filledAreasStyle?: Record; /** * Default study paletes style preferences. */ palettes?: Record; /** * Default study styles. */ styles?: Record; /** * Default study OHLC plot style preferences. */ ohlcPlots?: Record; /** * Default study graphics style preferences. */ graphics?: { /** Horizontal line style preferences */ horizlines?: Record; /** Polygon style preferences */ polygons?: Record; /** Histogram style preferences */ hhists?: Record; /** Vertical line style preferences */ vertlines?: Record; }; } /** * Study style values. */ interface StudyStyleValues { /** * OHLC plot styles. */ ohlcPlots: Record; /** * Band styles. */ bands: StudyBandPreferences[]; /** * Palette styles. */ palettes: Record; /** * Plot styles. */ styles: Record; /** * Filled area descriptions. */ filledAreas: StudyFilledAreaInfo[]; /** * Filled area styles. */ filledAreasStyle: Record; /** * Graphics styles. */ graphics: { /** Horizontal line style preferences */ horizlines?: Record; /** Polygon style preferences */ polygons?: Record; /** Histogram style preferences */ hhists?: Record; /** Vertical line style preferences */ vertlines?: Record; }; } /** * Study styles description. */ interface StudyStylesInfo { /** * Histogram base. A price value which will be considered as a start base point when rendering plot with histogram, columns or area style. */ readonly histogramBase?: number; /** * If `true` then plot points will be joined with line, applicable only to `Circles` and `Cross` type plots. Default is false. */ readonly joinPoints?: boolean; /** * Title used in the study dialog styles tab. */ readonly title: string; /** * If `true` then the styles tab will be hidden in the study dialog. */ readonly isHidden?: boolean; /** * Minimum possible plot arrow size. Applicable only to arrow plot types. */ readonly minHeight?: number; /** * Maximum possible plot arrow size. Applicable only to arrow plot types. */ readonly maxHeight?: number; /** * Size of characters on the chart. Possible values are: `auto`, `tiny`, `small`, `normal`, `large`,`huge`. Applicable to `chars` and `shapes` plot types. */ readonly size?: PlotSymbolSize | number; /** * Char to display with the plot. Applicable only to chars plot types. */ readonly char?: string; /** * Text to display with the plot. Applicable to `chars` and `shapes` plot types. */ readonly text?: string; /** * If defined, defines the number of bars to plot on chart. */ readonly showLast?: number; /** * Used to control the zorder of the plot. Control if a plot is visually behind or in front of another. */ readonly zorder?: number; /** * Info about the Price Scale formatting */ readonly format?: Partial; /** * optional flag to indicate the plot should be drawn on main page */ readonly forceOverlay?: boolean; } interface StudySymbolInputInfo extends StudyInputBaseInfo { /** Input type is Symbol */ readonly type: StudyInputType.Symbol; /** Default value for the input */ readonly defval?: string; /** Is the input optional */ readonly optional?: boolean; } /** * A description of a study plot with a target. */ interface StudyTargetedPlotInfo extends StudyPlotBaseInfo { /** * ID of another target plot. */ readonly target: string; /** * Target field. */ readonly targetField?: "topColor" | "bottomColor" | "topValue" | "bottomValue"; } /** * A description of a text colorer plot. */ interface StudyTextColorerPlotInfo extends StudyPalettedPlotInfo, StudyTargetedPlotInfo { /** @inheritDoc */ readonly type: StudyPlotType.TextColorer; } interface StudyTextInputInfo extends StudyInputBaseInfo { /** Input type is Text */ readonly type: StudyInputType.Text; /** Default value for the input */ readonly defval: string; /** Options for the text input */ readonly options?: string[]; /** Options for the titles of the text input */ readonly optionsTitles?: StudyInputOptionsTitles; } interface StudyTextareaInputInfo extends StudyInputBaseInfo { /** Input type is TextArea */ readonly type: StudyInputType.Textarea; /** Default value for the input */ readonly defval: string; } interface StudyTimeInputInfo extends StudyInputBaseInfo { /** Input type is Time */ readonly type: StudyInputType.Time; /** Default value for the input */ readonly defval: number; /** Maximum time */ readonly max: number; /** Minimum time */ readonly min: number; } /** * A description of a up colorer plot. */ interface StudyUpColorerPlotInfo extends StudyPalettedPlotInfo, StudyTargetedPlotInfo { /** @inheritDoc */ readonly type: StudyPlotType.UpColorer; } interface SubLayoutSizesState { percent: number; substate?: SubLayoutSizesState[]; } interface SubscribeEventsMap { /** * Drawing toolbar is shown/hidden * @param {boolean} isHidden - is the drawing toolbar currently hidden */ toggle_sidebar: (isHidden: boolean) => void; /** * Indicators dialog is shown */ indicators_dialog: EmptyCallback; /** * Chart header is shown/hidden * @param {boolean} isHidden - is the chart header currently hidden */ toggle_header: (isHidden: boolean) => void; /** * Chart / Study Properties dialog is shown * @param {EditObjectDialogEventParams} params - meta information about the dialog type and the title of the chart or study */ edit_object_dialog: (params: EditObjectDialogEventParams) => void; /** * New chart is about to be loaded * @param {object} savedData - chart data about to be loaded */ chart_load_requested: (savedData: object) => void; /** * Chart has finished loading */ chart_loaded: EmptyCallback; /** * Mouse button has been pressed * @param {MouseEventParams} params */ mouse_down: (params: MouseEventParams) => void; /** * Mouse button has been released * @param {MouseEventParams} params */ mouse_up: (params: MouseEventParams) => void; /** * A drawing has been added to a chart. * @param {StudyOrDrawingAddedToChartEventParams} params - The arguments contain an object with the `value` field that corresponds with the name of the drawing. */ drawing: (params: StudyOrDrawingAddedToChartEventParams) => void; /** * An indicator has been added to a chart. * @param {StudyOrDrawingAddedToChartEventParams} params - The arguments contain an object with the `value` field that corresponds with the name of the indicator. */ study: (params: StudyOrDrawingAddedToChartEventParams) => void; /** Undo action occurred */ undo: EmptyCallback; /** Redo action occurred */ redo: EmptyCallback; /** * The Undo / Redo state has been changed. * @param {UndoRedoState} state - state of the Undo/Redo stack */ undo_redo_state_changed: (state: UndoRedoState) => void; /** * Reset scales button has been clicked */ reset_scales: EmptyCallback; /** * A compare dialog has been shown */ compare_add: EmptyCallback; /** * A compare instrument has been added */ add_compare: EmptyCallback; /** * A study template has been loaded */ load_study_template: EmptyCallback; /** * Last bar has been updated * @param {Bar} tick - data for last bar */ onTick: (tick: Bar) => void; /** * User has changed the chart. `Chart change` means any user action that can be undone. * The callback function will not be called more than once every 5 seconds. See also `auto_save_delay` within the Widget constructor options ({@link ChartingLibraryWidgetOptions.auto_save_delay}). */ onAutoSaveNeeded: EmptyCallback; /** * A screenshot URL has been returned by the server * @param {string} url - url of the screenshot */ onScreenshotReady: (url: string) => void; /** * User has clicked on a 'mark on a bar'. * @param {Mark['id']} markId - ID of the clicked mark */ onMarkClick: (markId: Mark["id"]) => void; /** * User clicked the _Plus_ button on the [price scale](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Price-Scale#quick-trading). * @param {PlusClickParams} params - coordinates, price, and symbol information */ onPlusClick: (params: PlusClickParams) => void; /** * User clicked a 'timescale mark'. * @param {TimescaleMark['id']} markId - ID of the clicked timescale mark */ onTimescaleMarkClick: (markId: TimescaleMark["id"]) => void; /** Selected drawing tool has changed */ onSelectedLineToolChanged: EmptyCallback; /** * Amount or placement of the charts is about to be changed. * **Note:** this event is only applicable to Trading Platform. * @param {LayoutType} newLayoutType - whether the layout is single or multi-chart */ layout_about_to_be_changed: (newLayoutType: LayoutType) => void; /** * Amount or placement of the charts is changed. * **Note:** this event is only applicable to Trading Platform. */ layout_changed: EmptyCallback; /** * Active chart has changed. * **Note:** this event is only applicable to Trading Platform. * @param {number} chartIndex - index of the active chart */ activeChartChanged: (chartIndex: number) => void; /** * An event related to the series has occurred. * @param {SeriesEventType} seriesEventType - series event type */ series_event: (seriesEventType: SeriesEventType) => void; /** * An event related to the study has occurred. * @param {EntityId} entityId - study ID * @param {StudyEventType} studyEventType - study event type */ study_event: (entityId: EntityId, studyEventType: StudyEventType) => void; /** * Drawing was hidden, shown, moved, removed, clicked, or created * @param {EntityId} sourceId - drawing ID * @param {DrawingEventType} drawingEventType - drawing event type */ drawing_event: (sourceId: EntityId, drawingEventType: DrawingEventType) => void; /** * Study properties have changed. * @param {EntityId} id - entity ID */ study_properties_changed: (id: EntityId) => void; /** * Main series properties have changed. * @param {EntityId} id - entity ID */ series_properties_changed: (id: EntityId) => void; /** * Panes' size has changed. */ panes_height_changed: EmptyCallback; /** * Panes' order has changed. */ panes_order_changed: EmptyCallback; /** * Chart's widget bar is shown/hidden. * @param {boolean} isVisible - if the widget bar is currently hidden */ widgetbar_visibility_changed: (isVisible: boolean) => void; /** * The _Save as default_ option is selected in the drop-down menu of the indicator settings. * @param {EntityId} id - entity ID */ study_dialog_save_defaults: (id: EntityId) => void; /** * Time interval has been changed. * Can come from either the bottom toolbar or the {@link setTimeFrame} API. * @param {RangeOptions} range - Object that represents a selected time frame. */ timeframe_interval: (range: RangeOptions) => void; /** * Drag start * @param {boolean} enabled - if drag export is currently enabled */ dragstart: (params: DragStartParams) => void; /** * Drag end */ dragend: EmptyCallback; /** * Fired when the chart theme is updated. This event can be triggered in several ways: * - When a user applies a saved [chart template](https://www.tradingview.com/charting-library-docs/latest/saving_loading/#chart-templates). * - When the chart theme is reset to the default settings. (`isStandardTheme` parameter will be true) * - When the {@link IChartingLibraryWidget.changeTheme} method is called. * - When the {@link IChartWidgetApi.loadChartTemplate} method is called. * * @param {string} themeName - The name of the chart theme or template that was applied. * @param {boolean} isStandardTheme - `true` if the default built-in theme was restored; `false`, if a custom chart template was applied. * @param {boolean} onlyActiveChart - `false`, when applied to all charts */ chart_theme_changed: (themeName: string, isStandardTheme: boolean, onlyActiveChart: boolean) => void; } interface SuccessFormatterParseResult extends FormatterParseResult { /** @inheritDoc */ res: true; /** Returned value once parsing is done */ value: T; /** Optional value returned by the default formatter */ suggest?: string; } /** * Overrides for the 'SuperTrend' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface SuperTrendIndicatorOverrides { /** Default value: `15` */ "supertrend.display": number; /** Default value: `0` */ "supertrend.linestyle": number; /** Default value: `3` */ "supertrend.linewidth": number; /** Default value: `line` */ "supertrend.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "supertrend.trackprice": boolean; /** Default value: `35` */ "supertrend.transparency": number; /** Default value: `#000080` */ "supertrend.color": string; /** Default value: `15` */ "up arrow.display": number; /** Default value: `0` */ "up arrow.linestyle": number; /** Default value: `3` */ "up arrow.linewidth": number; /** Default value: `shape_arrow_up` */ "up arrow.plottype": string; /** Default value: `false` */ "up arrow.trackprice": boolean; /** Default value: `BelowBar` */ "up arrow.location": string; /** Default value: `35` */ "up arrow.transparency": number; /** Default value: `#00FF00` */ "up arrow.color": string; /** Default value: `15` */ "down arrow.display": number; /** Default value: `0` */ "down arrow.linestyle": number; /** Default value: `3` */ "down arrow.linewidth": number; /** Default value: `shape_arrow_down` */ "down arrow.plottype": string; /** Default value: `false` */ "down arrow.trackprice": boolean; /** Default value: `AboveBar` */ "down arrow.location": string; /** Default value: `35` */ "down arrow.transparency": number; /** Default value: `#FF0000` */ "down arrow.color": string; [key: string]: StudyOverrideValueType; } interface SymbolExt extends LibrarySymbolInfo { } interface SymbolInfoPriceSource { /** Unique ID */ id: string; /** Short name */ name: string; } interface SymbolInputSymbolSource { /** Input type is Symbol Source */ type: "symbolInputSymbolSource"; /** Input ID */ inputId: string; } /** * The time interval for a specific symbol. */ interface SymbolIntervalResult { /** Symbol name */ symbol: string; /** Time interval */ interval: ResolutionString; } /** Additional information about the Symbol's currency or unit */ interface SymbolResolveExtension { /** * Indicates the currency for conversions if `currency_codes` configuration field is set, * and `currency_code` is provided in the original symbol information ({@link LibrarySymbolInfo}). * Read more about [currency conversion](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Price-Scale#enable-currency-conversion). */ currencyCode?: string; /** * Indicates the unit for conversion if `units` configuration * field is set and `unit_id` is provided in the original symbol information ({@link LibrarySymbolInfo}). */ unitId?: string; /** * Trading session type, such as `"regular"` or `"extended"`, that the chart should currently display. */ session?: string; } /** * Options that define paginated [Symbol Search](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Symbol-Search) requests. */ interface SymbolSearchPaginatedOptions { /** * The requested exchange. An empty value means no filter is specified. */ exchange: string; /** * Text entered by the user in the Symbol Search field. */ userInput: string; /** * The number of results to skip, representing how many have already been returned for the same input. */ start?: number; /** * Type of symbol. An empty value means no filter is specified. */ symbolType: string; /** * The source of the search ({@link SearchInitiationPoint}). */ searchSource?: SearchInitiationPoint; } /** * Overrides for the 'TRIX' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface TRIXIndicatorOverrides { /** Default value: `#787B86` */ "zero.color": string; /** Default value: `2` */ "zero.linestyle": number; /** Default value: `1` */ "zero.linewidth": number; /** Default value: `true` */ "zero.visible": boolean; /** Default value: `0` */ "zero.value": number; /** Default value: `15` */ "trix.display": number; /** Default value: `0` */ "trix.linestyle": number; /** Default value: `1` */ "trix.linewidth": number; /** Default value: `line` */ "trix.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "trix.trackprice": boolean; /** Default value: `0` */ "trix.transparency": number; /** Default value: `#F23645` */ "trix.color": string; [key: string]: StudyOverrideValueType; } /** * Used in the schema defined in exportData API to describe the time field. * This is used when `includeTime: true` is defined in `exportData` to add time to exported data. */ interface TimeFieldDescriptor { /** time field descriptor */ type: "time"; } /** Defines a time frame at a specific date */ interface TimeFramePeriodBack { /** Time frame period is `period-back` */ type: TimeFrameType.PeriodBack; /** Time frame string. For example `'1D'` or `'6M'`. */ value: string; } /** Defines a time frame between 2 dates */ interface TimeFrameTimeRange { /** Time frame period is `time-range` */ type: TimeFrameType.TimeRange; /** * A UNIX timestamp. The start of the range */ from: number; /** * A UNIX timestamp. The end of the range */ to: number; } /** Position defined by time. */ interface TimePoint { /** A UNIX timestamp */ time: number; } interface TimescaleMark { /** ID of the timescale mark */ id: string | number; /** * Time for the mark. * Unix timestamp in seconds. */ time: number; /** Color for the timescale mark */ color: MarkConstColors | string; /** * Color for the timescale mark text label. * If undefined then the value provided for `color` will be used. */ labelFontColor?: MarkConstColors | string; /** Label for the timescale mark */ label: string; /** Tooltip content */ tooltip: string[]; /** Shape of the timescale mark */ shape?: TimeScaleMarkShape; /** * Optional URL for an image to be displayed within the timescale mark. * * The image should ideally be square in dimension. You can use any image type which * the browser supports natively. * * Examples: * - `https://s3-symbol-logo.tradingview.com/crypto/XTVCBTC.svg` * - `/images/myImage.png` * - `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3...` * - `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4...` */ imageUrl?: string; /** * Continue to show text label even when an image has * been loaded for the timescale mark. * * Defaults to `false` if undefined. */ showLabelWhenImageLoaded?: boolean; } /** * Supported timezone identifier are {@link LibrarySymbolInfo.timezones} and {@link LibrarySymbolInfo.exchange}. * `exchange` is a special "timezone" that means the timezone of a currently active symbol. * Thus the actual timezone will be calculated every time a symbol changes. */ interface TimezoneInfo { /** Timezone identifier {@link TimezoneId} */ id: TimezoneId | CustomTimezoneId; /** Name of the timezone */ get title(): string; /** Optional number to indicate an offset */ offset?: number; /** * Id of supported default timezone to use for the actual timezone calculations, see {@link TimezoneId} */ alias?: TimezoneId | GmtTimezoneId; } /** * Represents the structure of {@link TradingTerminalWidgetOptions.trading_customization}. */ interface TradingCustomization { /** Overrides for position lines created using the {@link IChartWidgetApi.createPositionLine} method. */ position?: Partial; /** Overrides for order lines created using the {@link IChartWidgetApi.createOrderLine} method. */ order?: Partial; /** Overrides for order lines created using the [Broker API](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/#broker-api). */ brokerOrder?: Partial; /** Overrides for position lines created using the [Broker API](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/#broker-api). */ brokerPosition?: Partial; } /** * Overrides for the 'Trend Strength Index' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface TrendStrengthIndexIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#FF5252` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Triple EMA' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface TripleEMAIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'True Strength Index' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface TrueStrengthIndexIndicatorOverrides { /** Default value: `#787B86` */ "zero.color": string; /** Default value: `2` */ "zero.linestyle": number; /** Default value: `1` */ "zero.linewidth": number; /** Default value: `true` */ "zero.visible": boolean; /** Default value: `0` */ "zero.value": number; /** Default value: `15` */ "true strength index.display": number; /** Default value: `0` */ "true strength index.linestyle": number; /** Default value: `1` */ "true strength index.linewidth": number; /** Default value: `line` */ "true strength index.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "true strength index.trackprice": boolean; /** Default value: `0` */ "true strength index.transparency": number; /** Default value: `#2196F3` */ "true strength index.color": string; /** Default value: `15` */ "signal.display": number; /** Default value: `0` */ "signal.linestyle": number; /** Default value: `1` */ "signal.linewidth": number; /** Default value: `line` */ "signal.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "signal.trackprice": boolean; /** Default value: `0` */ "signal.transparency": number; /** Default value: `#E91E63` */ "signal.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Typical Price' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface TypicalPriceIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#FF6D00` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Ultimate Oscillator' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface UltimateOscillatorIndicatorOverrides { /** Default value: `15` */ "uo.display": number; /** Default value: `0` */ "uo.linestyle": number; /** Default value: `1` */ "uo.linewidth": number; /** Default value: `line` */ "uo.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "uo.trackprice": boolean; /** Default value: `0` */ "uo.transparency": number; /** Default value: `#F23645` */ "uo.color": string; [key: string]: StudyOverrideValueType; } /** * Undo options. */ interface UndoOptions { /** * A boolean flag. Controls if undo should be disabled. */ disableUndo?: boolean; } /** State of the Undo/Redo stack. This object has the same structure as the result of {@link IChartingLibraryWidget.undoRedoState} method */ interface UndoRedoState { /** Undo is enabled */ readonly enableUndo: boolean; /** Undo text */ readonly undoText: string | undefined; /** Redo is enabled */ readonly enableRedo: boolean; /** Redo text */ readonly redoText: string | undefined; /** Original text for undo action - without being translated */ readonly originalUndoText: string | undefined; /** Original text for redo action - without being translated */ readonly originalRedoText: string | undefined; } interface Unit { /** Unique ID */ id: string; /** Short name */ name: string; /** Description */ description: string; } interface UnitInfo { /** Unit displayed on the price scale if any is specified */ selectedUnit: string | null; /** Original units for price scale */ originalUnits: string[]; /** Groups of units (for example weight, energy, ...) */ availableGroups: string[]; /** * Symbols on the price scale */ symbols: string[]; } /** * Used in the schema defined in exportData API to describe the user time field. * This is used when `includeUserTime: true` is defined in `exportData` to add user time (aka time that is displayed to the user on the chart) to exported data. */ interface UserTimeFieldDescriptor { /** user time field descriptor */ type: "userTime"; } /** * Overrides for the 'VWAP' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface VWAPIndicatorOverrides { /** Default value: `15` */ "vwap.display": number; /** Default value: `0` */ "vwap.linestyle": number; /** Default value: `1` */ "vwap.linewidth": number; /** Default value: `line` */ "vwap.plottype": LineStudyPlotStyleName; /** Default value: `0` */ "vwap.trackprice": number; /** Default value: `0` */ "vwap.transparency": number; /** Default value: `#2196F3` */ "vwap.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'VWMA' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface VWMAIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } interface ValueByStyleId { [styleId: string]: TValue | undefined; } /** * Vertical Line Preferences */ interface VertLinePreferences { /** Is visible if set to `true` */ visible: boolean; /** Width of the vertical line */ width: number; /** Color of the horizontal line */ color: string; /** Line style */ style: LineStyle; } /** * A time range of bars. */ interface VisibleBarsTimeRange { /** * UNIX timestamp of the first visible bar in the range. */ from: number; /** * UNIX timestamp of the last visible bar in the range. */ to: number; } /** * Boundaries of the price scale visible range in main series area */ interface VisiblePriceRange { /** * The start of the range. */ from: number; /** * The end of the range. */ to: number; } /** * A time range. */ interface VisibleTimeRange { /** * A UNIX timestamp. The start of the range. */ from: number; /** * A UNIX timestamp. The end of the range. */ to: number; } /** * Overrides for the 'Volatility Close-to-Close' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface VolatilityClosetoCloseIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Volatility Index' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface VolatilityIndexIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#FF5252` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Volatility O-H-L-C' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface VolatilityOHLCIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#FF5252` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Volatility Zero Trend Close-to-Close' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface VolatilityZeroTrendClosetoCloseIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Volume' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface VolumeIndicatorOverrides { /** Default value: `15` */ "volume.display": number; /** Default value: `0` */ "volume.linestyle": number; /** Default value: `1` */ "volume.linewidth": number; /** Default value: `columns` */ "volume.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "volume.trackprice": boolean; /** Default value: `50` */ "volume.transparency": number; /** Default value: `#000080` */ "volume.color": string; /** Default value: `0` */ "volume ma:plot.display": number; /** Default value: `0` */ "volume ma:plot.linestyle": number; /** Default value: `1` */ "volume ma:plot.linewidth": number; /** Default value: `line` */ "volume ma:plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "volume ma:plot.trackprice": boolean; /** Default value: `0` */ "volume ma:plot.transparency": number; /** Default value: `#2196F3` */ "volume ma:plot.color": string; /** Default value: `0` */ "smoothed ma.display": number; /** Default value: `0` */ "smoothed ma.linestyle": number; /** Default value: `1` */ "smoothed ma.linewidth": number; /** Default value: `line` */ "smoothed ma.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "smoothed ma.trackprice": boolean; /** Default value: `0` */ "smoothed ma.transparency": number; /** Default value: `#2196F3` */ "smoothed ma.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Volume Oscillator' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface VolumeOscillatorIndicatorOverrides { /** Default value: `#787B86` */ "zero.color": string; /** Default value: `2` */ "zero.linestyle": number; /** Default value: `1` */ "zero.linewidth": number; /** Default value: `true` */ "zero.visible": boolean; /** Default value: `0` */ "zero.value": number; /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Volume Profile Fixed Range' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface VolumeProfileFixedRangeIndicatorOverrides { /** Default value: `undefined` */ "developing poc.color": string; /** Default value: `0` */ "developing poc.linestyle": number; /** Default value: `1` */ "developing poc.linewidth": number; /** Default value: `step_line` */ "developing poc.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "developing poc.trackprice": boolean; /** Default value: `0` */ "developing poc.transparency": number; /** Default value: `0` */ "developing poc.display": number; /** Default value: `undefined` */ "developing va high.color": string; /** Default value: `0` */ "developing va high.linestyle": number; /** Default value: `1` */ "developing va high.linewidth": number; /** Default value: `step_line` */ "developing va high.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "developing va high.trackprice": boolean; /** Default value: `0` */ "developing va high.transparency": number; /** Default value: `0` */ "developing va high.display": number; /** Default value: `undefined` */ "developing va low.color": string; /** Default value: `0` */ "developing va low.linestyle": number; /** Default value: `1` */ "developing va low.linewidth": number; /** Default value: `step_line` */ "developing va low.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "developing va low.trackprice": boolean; /** Default value: `0` */ "developing va low.transparency": number; /** Default value: `0` */ "developing va low.display": number; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Volume Profile Visible Range' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface VolumeProfileVisibleRangeIndicatorOverrides { /** Default value: `undefined` */ "developing poc.color": string; /** Default value: `0` */ "developing poc.linestyle": number; /** Default value: `1` */ "developing poc.linewidth": number; /** Default value: `step_line` */ "developing poc.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "developing poc.trackprice": boolean; /** Default value: `0` */ "developing poc.transparency": number; /** Default value: `0` */ "developing poc.display": number; /** Default value: `undefined` */ "developing va high.color": string; /** Default value: `0` */ "developing va high.linestyle": number; /** Default value: `1` */ "developing va high.linewidth": number; /** Default value: `step_line` */ "developing va high.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "developing va high.trackprice": boolean; /** Default value: `0` */ "developing va high.transparency": number; /** Default value: `0` */ "developing va high.display": number; /** Default value: `undefined` */ "developing va low.color": string; /** Default value: `0` */ "developing va low.linestyle": number; /** Default value: `1` */ "developing va low.linewidth": number; /** Default value: `step_line` */ "developing va low.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "developing va low.trackprice": boolean; /** Default value: `0` */ "developing va low.transparency": number; /** Default value: `0` */ "developing va low.display": number; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Vortex Indicator' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface VortexIndicatorIndicatorOverrides { /** Default value: `15` */ "vi +.display": number; /** Default value: `0` */ "vi +.linestyle": number; /** Default value: `1` */ "vi +.linewidth": number; /** Default value: `line` */ "vi +.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "vi +.trackprice": boolean; /** Default value: `0` */ "vi +.transparency": number; /** Default value: `#2196F3` */ "vi +.color": string; /** Default value: `15` */ "vi -.display": number; /** Default value: `0` */ "vi -.linestyle": number; /** Default value: `1` */ "vi -.linewidth": number; /** Default value: `line` */ "vi -.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "vi -.trackprice": boolean; /** Default value: `0` */ "vi -.transparency": number; /** Default value: `#E91E63` */ "vi -.color": string; [key: string]: StudyOverrideValueType; } interface WatchListSymbolList extends WatchListSymbolListData { /** Symbol ID */ id: string; } interface WatchListSymbolListData { /** Symbol IDs in watchlist */ symbols: string[]; /** Title for the watchlist */ title: string; } interface WatchListSymbolListMap { /** Symbol watchlist */ [listId: string]: WatchListSymbolList; } interface WatchedValueSubscribeOptions { /** Subscribe for only one update, and remove subscription afterwards. (the callback will be executed only once) */ once?: boolean; /** if it is set to true then the callback will be executed with the previous value (if available) */ callWithLast?: boolean; } /** * Data provided to the {@link WatermarkContentProvider}. */ interface WatermarkContentData { /** * Symbol Information. */ symbolInfo: LibrarySymbolInfo; /** * Current interval string. */ interval: string; } /** * Defines the text and font properties for a line of the watermark. */ interface WatermarkLine { /** * Text to be displayed. */ text: string; /** * Font size to be used (defined in pixels). */ fontSize: number; /** * Line height (defined in pixels). */ lineHeight: number; /** * Vertical offset distance (defined in pixels). */ vertOffset: number; } /** * Overrides for the 'Williams Alligator' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface WilliamsAlligatorIndicatorOverrides { /** Default value: `15` */ "jaw.display": number; /** Default value: `0` */ "jaw.linestyle": number; /** Default value: `1` */ "jaw.linewidth": number; /** Default value: `line` */ "jaw.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "jaw.trackprice": boolean; /** Default value: `0` */ "jaw.transparency": number; /** Default value: `#2196F3` */ "jaw.color": string; /** Default value: `15` */ "teeth.display": number; /** Default value: `0` */ "teeth.linestyle": number; /** Default value: `1` */ "teeth.linewidth": number; /** Default value: `line` */ "teeth.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "teeth.trackprice": boolean; /** Default value: `0` */ "teeth.transparency": number; /** Default value: `#E91E63` */ "teeth.color": string; /** Default value: `15` */ "lips.display": number; /** Default value: `0` */ "lips.linestyle": number; /** Default value: `1` */ "lips.linewidth": number; /** Default value: `line` */ "lips.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "lips.trackprice": boolean; /** Default value: `0` */ "lips.transparency": number; /** Default value: `#66BB6A` */ "lips.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Williams Fractal' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface WilliamsFractalIndicatorOverrides { /** Default value: `15` */ "down fractals.display": number; /** Default value: `shape_triangle_down` */ "down fractals.plottype": string; /** Default value: `BelowBar` */ "down fractals.location": string; /** Default value: `0` */ "down fractals.transparency": number; /** Default value: `#F23645` */ "down fractals.color": string; /** Default value: `15` */ "up fractals.display": number; /** Default value: `shape_triangle_up` */ "up fractals.plottype": string; /** Default value: `AboveBar` */ "up fractals.location": string; /** Default value: `0` */ "up fractals.transparency": number; /** Default value: `#089981` */ "up fractals.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Williams %R' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface WilliamsRIndicatorOverrides { /** Default value: `#7E57C2` */ "hlines background.color": string; /** Default value: `90` */ "hlines background.transparency": number; /** Default value: `true` */ "hlines background.visible": boolean; /** Default value: `#787B86` */ "upperlimit.color": string; /** Default value: `2` */ "upperlimit.linestyle": number; /** Default value: `1` */ "upperlimit.linewidth": number; /** Default value: `true` */ "upperlimit.visible": boolean; /** Default value: `-20` */ "upperlimit.value": number; /** Default value: `#787B86` */ "lowerlimit.color": string; /** Default value: `2` */ "lowerlimit.linestyle": number; /** Default value: `1` */ "lowerlimit.linewidth": number; /** Default value: `true` */ "lowerlimit.visible": boolean; /** Default value: `-80` */ "lowerlimit.value": number; /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `1` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#7E57C2` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * Overrides for the 'Zig Zag' indicator. * * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}. */ interface ZigZagIndicatorOverrides { /** Default value: `15` */ "plot.display": number; /** Default value: `0` */ "plot.linestyle": number; /** Default value: `2` */ "plot.linewidth": number; /** Default value: `line` */ "plot.plottype": LineStudyPlotStyleName; /** Default value: `false` */ "plot.trackprice": boolean; /** Default value: `0` */ "plot.transparency": number; /** Default value: `#2196F3` */ "plot.color": string; [key: string]: StudyOverrideValueType; } /** * A chart action ID. */ type ChartActionId = "addPlusButton" | "chartProperties" | "compareOrAdd" | "scalesProperties" | "paneObjectTree" | "insertIndicator" | "symbolSearch" | "changeInterval" | "timeScaleReset" | "chartReset" | "seriesHide" | "studyHide" | "lineToggleLock" | "lineHide" | "scaleSeriesOnly" | "drawingToolbarAction" | "stayInDrawingModeAction" | "hideAllMarks" | "showCountdown" | "showSeriesLastValue" | "showSymbolLabelsAction" | "showStudyLastValue" | "showStudyPlotNamesAction" | "undo" | "redo" | "paneRemoveAllStudiesDrawingTools" | "showSymbolInfoDialog"; /** * A color gradient from lightest to darkest to override one of the default color theme colors. */ type ColorGradient = [ lightness50: string, lightness100: string, lightness150: string, lightness200: string, lightness250: string, lightness300: string, lightness350: string, lightness400: string, lightness450: string, lightness500: string, lightness550: string, lightness600: string, lightness650: string, lightness700: string, lightness750: string, lightness800: string, lightness850: string, lightness900: string, lightness950: string ]; /** These are defining the types for a background */ type ColorTypes = "solid" | "gradient"; /** * Determines the baseline position for column series, either at the bottom of the pane or aligned with the price scale's zero value. */ type ColumnStyleBaselinePosition = "bottom" | "zero"; type CreateButtonOptions = CreateHTMLButtonOptions | CreateTradingViewStyledButtonOptions; /** * Identifier for a custom timezone (string). */ type CustomTimezoneId = Nominal<"CustomTimezoneId", string>; type CustomTimezones = "Africa/Cairo" | "Africa/Casablanca" | "Africa/Johannesburg" | "Africa/Lagos" | "Africa/Nairobi" | "Africa/Tunis" | "America/Anchorage" | "America/Argentina/Buenos_Aires" | "America/Bogota" | "America/Caracas" | "America/Chicago" | "America/El_Salvador" | "America/Juneau" | "America/Lima" | "America/Los_Angeles" | "America/Mexico_City" | "America/New_York" | "America/Phoenix" | "America/Santiago" | "America/Sao_Paulo" | "America/Toronto" | "America/Vancouver" | "Asia/Almaty" | "Asia/Ashkhabad" | "Asia/Bahrain" | "Asia/Bangkok" | "Asia/Chongqing" | "Asia/Colombo" | "Asia/Dhaka" | "Asia/Dubai" | "Asia/Ho_Chi_Minh" | "Asia/Hong_Kong" | "Asia/Jakarta" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Karachi" | "Asia/Kathmandu" | "Asia/Kolkata" | "Asia/Kuala_Lumpur" | "Asia/Kuwait" | "Asia/Manila" | "Asia/Muscat" | "Asia/Nicosia" | "Asia/Qatar" | "Asia/Riyadh" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Taipei" | "Asia/Tehran" | "Asia/Tokyo" | "Asia/Yangon" | "Atlantic/Azores" | "Atlantic/Reykjavik" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Perth" | "Australia/Sydney" | "Europe/Amsterdam" | "Europe/Athens" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Bratislava" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Helsinki" | "Europe/Istanbul" | "Europe/Lisbon" | "Europe/London" | "Europe/Luxembourg" | "Europe/Madrid" | "Europe/Malta" | "Europe/Moscow" | "Europe/Oslo" | "Europe/Paris" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Warsaw" | "Europe/Zurich" | "Pacific/Auckland" | "Pacific/Chatham" | "Pacific/Fakaofo" | "Pacific/Honolulu" | "Pacific/Norfolk" | "US/Mountain"; type DOMCallback = (data: DOMData) => void; type DatafeedErrorCallback = (reason: string) => void; type DateFormat = keyof typeof dateFormatFunctions; type DeepWriteable = { -readonly [P in keyof T]: DeepWriteable; }; /** * The direction of an execution line. Either buy or sell. */ type Direction = "buy" | "sell"; /** * A event related to a drawing. * * - Note that the `properties_changed` event can be emitted before `create` event, and that the * event isn't debounced (for example dragging a slider for a property will result in this event * firing for each movement on the slider), you may want to debounce this within your code. * - The `move` event is emitted when a drawing is moved as a whole, whilst the `points_changed` * event is emitted when a single point of the drawing is moved. `points_changed` will always fire * when `move` fires but not vice-versa. */ type DrawingEventType = "click" | "move" | "remove" | "hide" | "show" | "create" | "properties_changed" | "points_changed"; /** Dropdown options which can be adjusted on an existing menu. */ type DropdownUpdateParams = Partial>; type EditObjectDialogObjectType = "mainSeries" | "drawing" | "study" | "other"; type EmptyCallback = () => void; type EntityId = Nominal; /** * Description of each field of exported data from the chart */ type FieldDescriptor = TimeFieldDescriptor | UserTimeFieldDescriptor | SeriesFieldDescriptor | StudyFieldDescriptor; type FinancialPeriod = "FY" | "FQ" | "FH" | "TTM"; type GetMarksCallback = (marks: T[]) => void; /** * GMT timezone ID. * * In order to conform with the POSIX style, those zone names * beginning with "Etc/GMT" have their sign reversed from the * standard ISO 8601 convention. In the "Etc" area, zones west * of GMT have a positive sign and those east have a negative * sign in their name (e.g "Etc/GMT-14" is 14 hours ahead of GMT). */ type GmtTimezoneId = `Etc/GMT${"+" | "-"}${number}${`:${number}` | ""}`; type GridLinesMode = "both" | "vert" | "horz" | "none"; type GroupLockState = "Locked" | "Unlocked" | "Partial"; type GroupVisibilityState = "Visible" | "Invisible" | "Partial"; type HistoryCallback = (bars: Bar[], meta?: HistoryMetadata) => void; type IBarArray = [ number, number, number, number, number, number ]; type IBasicDataFeed = IDatafeedChartApi & IExternalDatafeed; type IPineStudyResult = IPineStudyResultTypes; type IPineStudyResultSimple = StudyPrimitiveResult | ISeriesStudyResult | INonSeriesStudyBarsResult | IProjectionStudyResult | INonSeriesStudyResult; type IPineStudyResultTypes = TPineStudyResultSimple | PineStudyResultComposite; type IProjectionBar = [ number, number, number, number, number, number ] | [ number, number, number, number, number, number, number ]; /** * An array of bar values. * * [time, open, high, low, close, volume, updatetime, isBarClosed, emptyBars, emptyBarsPrice] */ type ISeriesStudyResult = [ time: number, open: number, high: number, low: number, close: number, volume: number, updatetime: number | undefined, isBarClosed: boolean | undefined, emptyBars: number[] | undefined, emptyBarsPrice: number | undefined ]; type LanguageCode = "ar" | "zh" | "ca_ES" | "en" | "fr" | "de" | "he_IL" | "id_ID" | "it" | "ja" | "ko" | "pl" | "pt" | "ru" | "es" | "sv" | "th" | "tr" | "vi" | "ms_MY" | "zh_TW"; type LayoutSizes = Record; type LayoutSizesState = SubLayoutSizesState[]; type LayoutType = SingleChartLayoutType | MultipleChartsLayoutType; type LegendMode = "horizontal" | "vertical"; type LibrarySessionId = "regular" | "extended" | "premarket" | "postmarket"; /** * Plot Style. Used for `plottype` properties within [Indicator overrides](https://www.tradingview.com/charting-library-docs/latest/customization/overrides/indicator-overrides). */ type LineStudyPlotStyleName = "line" | "histogram" | "cross" | "area" | "columns" | "circles" | "line_with_breaks" | "area_with_breaks" | "step_line" | "step_line_with_breaks" | "step_line_with_diamonds"; type MarkConstColors = "red" | "green" | "blue" | "yellow"; type MultipleChartsLayoutType = "2h" | "2v" | "3h" | "3v" | "3s" | "3r" | "2-1" | "1-2" | "4" | "4v" | "4h" | "4s" | "4s-l" | "1-3" | "3-1" | "2-2-l" | "2-2-r" | "2-2" | "1-4" | "5h" | "5v" | "5s" | "5s-l" | "2-3" | "3-2" | "4-1" | "2-3-l" | "2-3-r" | "6" | "6h" | "6v" | "6c" | "2-4" | "4-2" | "4-3" | "7h" | "7s" | "8" | "8c" | "8h" | "8v"; type ObservableCallback = (value: T) => void; type OnReadyCallback = (configuration: DatafeedConfiguration) => void; type OrderLineLengthUnit = "pixel" | "percentage"; type OverlayIndicatorOverridesAll = OverlayIndicatorOverridesBar | OverlayIndicatorOverridesCandle | OverlayIndicatorOverridesLine | OverlayIndicatorOverridesArea | OverlayIndicatorOverridesHollowCandle | OverlayIndicatorOverridesBaseline | OverlayIndicatorOverridesHiLo | OverlayIndicatorOverridesColumn | OverlayIndicatorOverridesHLCArea | OverlayIndicatorOverridesLineWithMarkers | OverlayIndicatorOverridesStepline; type OverlayIndicatorStyleExclusions = ChartStyle.Renko | ChartStyle.Kagi | ChartStyle.PnF | ChartStyle.LineBreak | ChartStyle.HeikinAshi | ChartStyle.VolCandle; type PageName = "watchlist_details_news" | "data_window" | "object_tree"; /** * Plot shape ID. */ type PlotShapeId = "shape_arrow_down" | "shape_arrow_up" | "shape_circle" | "shape_cross" | "shape_xcross" | "shape_diamond" | "shape_flag" | "shape_square" | "shape_label_down" | "shape_label_up" | "shape_triangle_down" | "shape_triangle_up"; type PositionLineLengthUnit = "pixel" | "percentage"; type PriceSource = "open" | "high" | "low" | "close"; type RawStudyMetaInfoId = Nominal; type RawStudyMetaInformation = Omit & { /** array with study plots info. See dedicated article: [Custom Studies Plots](https://www.tradingview.com/charting-library-docs/latest/custom_studies/Custom-Studies-Plots) */ readonly plots?: readonly Readonly[]; /** an object containing settings that are applied when user clicks 'Apply Defaults'. See dedicated article: [Custom Studies Defaults](https://www.tradingview.com/charting-library-docs/latest/custom_studies/metainfo/Custom-Studies-Defaults) */ readonly defaults?: Readonly>; }; /** * Resolution or time interval is a time period of one bar. Advanced Charts supports tick, intraday (seconds, minutes, hours), and DWM (daily, weekly, monthly) resolutions. The table below describes how to specify different types of resolutions: * * Resolution | Format | Example * ---------|----------|--------- * Ticks | `xT` | `1T` — one tick, `5T` — five ticks, `100T` — one hundred ticks * Seconds | `xS` | `1S` — one second * Minutes | `x` | `1` — one minute * Hours | `x` minutes | `60` — one hour * Days | `xD` | `1D` — one day * Weeks | `xW` | `1W` — one week * Months | `xM` | `1M` — one month * Years | `xM` months | `12M` — one year * * Refer to [Resolution](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Resolution) for more information. */ type ResolutionString = Nominal; type ResolveCallback = (symbolInfo: LibrarySymbolInfo) => void; type SearchSymbolsCallback = (items: SearchSymbolResultItem[]) => void; type SearchSymbolsPaginatedCallback = (items: SearchSymbolResultItem[], symbolsRemaining: number) => void; /** An event related to the series. Currently the only possible value for this argument is `price_scale_changed` */ type SeriesEventType = "price_scale_changed"; type SeriesFormat = "price" | "volume"; /** * Where to attach the price scale. * Options are either to the `left`, `right`, next to an already existing price axis using a reference or `no scale` if there are no other scales on the main pane. */ type SeriesPriceScale = "new-left" | "new-right" | "no-scale" | EntityId; type SeriesStatusViewSymbolTextSource = "ticker" | "description" | "ticker-and-description" | "long-description"; type ServerTimeCallback = (serverTime: number) => void; /** * A time range to set. The end `to` value is optional. * * When the optional `to` value is omitted then the value will * fallback to the timestamp of the latest bar on the chart. */ type SetVisibleTimeRange = Omit & Partial>; /** Drawing point */ type ShapePoint = StickedPoint | PricedPoint | TimePoint; type ShapesGroupId = Nominal; type SingleChartLayoutType = "s"; type SingleIndicatorOverrides = FiftyTwoWeekHighLowIndicatorOverrides | AcceleratorOscillatorIndicatorOverrides | AccumulationDistributionIndicatorOverrides | AccumulativeSwingIndexIndicatorOverrides | AdvanceDeclineIndicatorOverrides | AnchoredVWAPIndicatorOverrides | ArnaudLegouxMovingAverageIndicatorOverrides | AroonIndicatorOverrides | AverageDirectionalIndexIndicatorOverrides | AveragePriceIndicatorOverrides | AverageTrueRangeIndicatorOverrides | AwesomeOscillatorIndicatorOverrides | BalanceofPowerIndicatorOverrides | BollingerBandsIndicatorOverrides | BollingerBandsBIndicatorOverrides | BollingerBandsWidthIndicatorOverrides | ChaikinMoneyFlowIndicatorOverrides | ChaikinOscillatorIndicatorOverrides | ChaikinVolatilityIndicatorOverrides | ChandeKrollStopIndicatorOverrides | ChandeMomentumOscillatorIndicatorOverrides | ChopZoneIndicatorOverrides | ChoppinessIndexIndicatorOverrides | CommodityChannelIndexIndicatorOverrides | CompareIndicatorOverrides | ConnorsRSIIndicatorOverrides | CoppockCurveIndicatorOverrides | CorrelationLogIndicatorOverrides | CorrelationCoefficientIndicatorOverrides | DetrendedPriceOscillatorIndicatorOverrides | DirectionalMovementIndicatorOverrides | DonchianChannelsIndicatorOverrides | DoubleEMAIndicatorOverrides | EMACrossIndicatorOverrides | EaseOfMovementIndicatorOverrides | EldersForceIndexIndicatorOverrides | EnvelopesIndicatorOverrides | FisherTransformIndicatorOverrides | FixedRangeIndicatorOverrides | GuppyMultipleMovingAverageIndicatorOverrides | HistoricalVolatilityIndicatorOverrides | HullMovingAverageIndicatorOverrides | IchimokuCloudIndicatorOverrides | KeltnerChannelsIndicatorOverrides | KlingerOscillatorIndicatorOverrides | KnowSureThingIndicatorOverrides | LeastSquaresMovingAverageIndicatorOverrides | LinearRegressionCurveIndicatorOverrides | LinearRegressionSlopeIndicatorOverrides | MACrossIndicatorOverrides | MAwithEMACrossIndicatorOverrides | MACDIndicatorOverrides | MajorityRuleIndicatorOverrides | MassIndexIndicatorOverrides | McGinleyDynamicIndicatorOverrides | MedianPriceIndicatorOverrides | MomentumIndicatorOverrides | MoneyFlowIndexIndicatorOverrides | MovingAverageIndicatorOverrides | MovingAverageAdaptiveIndicatorOverrides | MovingAverageChannelIndicatorOverrides | MovingAverageDoubleIndicatorOverrides | MovingAverageExponentialIndicatorOverrides | MovingAverageHammingIndicatorOverrides | MovingAverageMultipleIndicatorOverrides | MovingAverageTripleIndicatorOverrides | MovingAverageWeightedIndicatorOverrides | NetVolumeIndicatorOverrides | OnBalanceVolumeIndicatorOverrides | OverlayIndicatorOverrides | ParabolicSARIndicatorOverrides | PivotPointsStandardIndicatorOverrides | PriceChannelIndicatorOverrides | PriceOscillatorIndicatorOverrides | PriceVolumeTrendIndicatorOverrides | RankCorrelationIndexIndicatorOverrides | RateOfChangeIndicatorOverrides | RatioIndicatorOverrides | RegressionTrendIndicatorOverrides | RelativeStrengthIndexIndicatorOverrides | RelativeVigorIndexIndicatorOverrides | RelativeVolatilityIndexIndicatorOverrides | SMIErgodicIndicatorOscillatorIndicatorOverrides | SessionsIndicatorOverrides | SmoothedMovingAverageIndicatorOverrides | SpreadIndicatorOverrides | StandardDeviationIndicatorOverrides | StandardErrorIndicatorOverrides | StandardErrorBandsIndicatorOverrides | StochasticIndicatorOverrides | StochasticRSIIndicatorOverrides | SuperTrendIndicatorOverrides | TRIXIndicatorOverrides | TrendStrengthIndexIndicatorOverrides | TripleEMAIndicatorOverrides | TrueStrengthIndexIndicatorOverrides | TypicalPriceIndicatorOverrides | UltimateOscillatorIndicatorOverrides | VWAPIndicatorOverrides | VWMAIndicatorOverrides | VolatilityClosetoCloseIndicatorOverrides | VolatilityIndexIndicatorOverrides | VolatilityOHLCIndicatorOverrides | VolatilityZeroTrendClosetoCloseIndicatorOverrides | VolumeIndicatorOverrides | VolumeOscillatorIndicatorOverrides | VolumeProfileFixedRangeIndicatorOverrides | VolumeProfileVisibleRangeIndicatorOverrides | VortexIndicatorIndicatorOverrides | WilliamsRIndicatorOverrides | WilliamsAlligatorIndicatorOverrides | WilliamsFractalIndicatorOverrides | ZigZagIndicatorOverrides | OverlayIndicatorOverridesAll; /** An event related to a study. */ type StudyEventType = "create" | "remove" | "price_scale_changed" | "paste_study"; type StudyFilledAreaStyle = StudyFilledAreaSolidColorStyle | StudyFilledAreaGradientColorStyle; type StudyInputId = Nominal; type StudyInputInfo = StudyBooleanInputInfo | StudyTextInputInfo | StudySymbolInputInfo | StudyResolutionInputInfo | StudySessionInputInfo | StudySourceInputInfo | StudyNumericInputInfo | StudyPriceInputInfo | StudyColorInputInfo | StudyTimeInputInfo | StudyBarTimeInputInfo | StudyTextareaInputInfo; type StudyInputInfoList = readonly Readonly[]; /** * The value of a study input. */ type StudyInputValue = string | number | boolean; type StudyMetaInfo = DeepWriteable & { /** Identifier for the Study */ id: string; }; type StudyOhlcPlotPreferences = StudyOhlcPlotBarsStylePreferences | StudyOhlcPlotCandlesStylePreferences; type StudyOverrideValueType = string | number | boolean; type StudyPlotDisplayMode = Nominal | StudyPlotDisplayTarget; type StudyPlotInfo = StudyPlotInformation; /** * A description of a study plot. */ type StudyPlotInformation = StudyArrowsPlotInfo | StudyCharsPlotInfo | StudyColorerPlotInfo | StudyRgbaColorerPlotInfo | StudyDataPlotInfo | StudyDataOffsetPlotInfo | StudyLinePlotInfo | StudyOhlcPlotInfo | StudyShapesPlotInfo | StudyBarColorerPlotInfo | StudyBgColorerPlotInfo | StudyTextColorerPlotInfo | StudyOhlcColorerPlotInfo | StudyCandleWickColorerPlotInfo | StudyCandleBorderColorerPlotInfo | StudyUpColorerPlotInfo | StudyDownColorerPlotInfo; /** * Study plot style preferences. */ type StudyPlotPreferences = StudyLinePlotPreferences | StudyShapesPlotPreferences | StudyCharsPlotPreferences | StudyArrowsPlotPreferences; type StudyPlotValueFormat = StudyPlotValueInheritFormat | StudyPlotValuePrecisionFormat; /** * Price scale to display a study on. * * Possible values are: * * `new-left` - attach the study to a new left price scale * * `new-right` - attach the study to a new right price scale * * `no-scale` - do not attach the study to any price scale. The study will be added in 'No Scale' mode * * `as-series` - attach the study to the price scale where the main series is attached (it is only applicable the study is added to the pane with the main series) */ type StudyPriceScale = "new-left" | "new-right" | "no-scale" | "as-series"; type StudyPriceSource = "open" | "high" | "low" | "close" | "hl2" | "hlc3" | "ohlc4" | "hlcc4"; type StudyPrimitiveResult = (number | StudyResultValueWithOffset)[]; type SubscribeBarsCallback = (bar: Bar) => void; type SupportedLineTools = "text" | "anchored_text" | "note" | "anchored_note" | "signpost" | "double_curve" | "arc" | "icon" | "emoji" | "sticker" | "arrow_up" | "arrow_down" | "arrow_left" | "arrow_right" | "price_label" | "price_note" | "arrow_marker" | "flag" | "vertical_line" | "horizontal_line" | "cross_line" | "horizontal_ray" | "trend_line" | "info_line" | "trend_angle" | "arrow" | "ray" | "extended" | "parallel_channel" | "disjoint_angle" | "flat_bottom" | "anchored_vwap" | "pitchfork" | "schiff_pitchfork_modified" | "schiff_pitchfork" | "balloon" | "comment" | "inside_pitchfork" | "pitchfan" | "gannbox" | "gannbox_square" | "gannbox_fixed" | "gannbox_fan" | "fib_retracement" | "fib_trend_ext" | "fib_speed_resist_fan" | "fib_timezone" | "fib_trend_time" | "fib_circles" | "fib_spiral" | "fib_speed_resist_arcs" | "fib_channel" | "xabcd_pattern" | "cypher_pattern" | "abcd_pattern" | "callout" | "text_note" | "triangle_pattern" | "3divers_pattern" | "head_and_shoulders" | "fib_wedge" | "elliott_impulse_wave" | "elliott_triangle_wave" | "elliott_triple_combo" | "elliott_correction" | "elliott_double_combo" | "cyclic_lines" | "time_cycles" | "sine_line" | "long_position" | "short_position" | "forecast" | "date_range" | "price_range" | "date_and_price_range" | "bars_pattern" | "ghost_feed" | "projection" | "rectangle" | "rotated_rectangle" | "circle" | "ellipse" | "triangle" | "polyline" | "path" | "curve" | "cursor" | "dot" | "arrow_cursor" | "eraser" | "measure" | "zoom" | "brush" | "highlighter" | "regression_trend" | "fixed_range_volume_profile" | "table"; type SymbolSource = SymbolInputSymbolSource; type ThemeName = "light" | "dark"; /** * Type of timeframe defined in the UI. * Can either be a single one {@link TimeFramePeriodBack} or a range {@link TimeFrameTimeRange} * * Examples: * 1. a timeframe object, `{type, value}`: * * `type`: `period-back`. * * `value`: valid timeframe is a number with letter D for days and M for months. * 2. a range object, `{type, from, to}` * * `type`: `time-range`. * * `from`, `to`: UNIX timestamps, UTC. */ type TimeFrameValue = TimeFramePeriodBack | TimeFrameTimeRange; type TimeScaleMarkShape = "circle" | "earningUp" | "earningDown" | "earning"; type Timezone = "Etc/UTC" | CustomTimezones; type TimezoneId = CustomTimezones | "Etc/UTC" | "exchange"; type VisiblePlotsSet = "ohlcv" | "ohlc" | "c" | "hlc"; type WatchListSymbolListAddedCallback = (listId: string, symbols: string[]) => void; type WatchListSymbolListChangedCallback = (listId: string) => void; type WatchListSymbolListRemovedCallback = (listId: string) => void; type WatchListSymbolListRenamedCallback = (listId: string, oldName: string, newName: string) => void; type WatchedValueCallback = (value: T) => void; /** * Custom watermark content provider which should return an array of watermark lines to be displayed. * Return `null` if you would like to use the default content. */ type WatermarkContentProvider = (data: WatermarkContentData) => WatermarkLine[] | null; declare type DeepPartial = { [P in keyof T]?: T[P] extends (infer U)[] ? DeepPartial[] : T[P] extends readonly (infer X)[] ? readonly DeepPartial[] : DeepPartial; }; type WidgetIccandleChartRefs = { highlightBarsRef: RefObject; generatedCandlesBackgroundStudyIdRef: RefObject; generatedCandlesStudyIdRef: RefObject; }; declare const WidgetIccandle: ({ chartWidget, children, theme, chartMaskColors, apiKey, language, submitCallback, onCloseResult, iframeLoaded, resultIframeRef, isShowScanButton, isShowTrackerButton, isShowScannerPopup, availableIntervals, onScanClick, }: WidgetIccandleProps) => react_jsx_runtime.JSX.Element; type WidgetChartMaskColors = { light?: string; dark?: string; }; type WidgetIccandleProps = { chartWidget: IChartingLibraryWidget | null; children: ReactNode | ((chartRefs: WidgetIccandleChartRefs) => ReactNode); submitCallback: (iframeSrc: string) => void; theme?: "light" | "dark" | "system"; /** Simulate-candle mask colors per theme. Defaults: light `#ffffff`, dark `#0F0F0F`. */ chartMaskColors?: WidgetChartMaskColors; /** * Publishable Plugin Portal API key (`pk_live_…`). When set, the widget loads * the client's portal style (colors, font, default theme) and forwards the * key to the results iframe as `&apiKey=`. An explicit `theme` prop takes * priority over the portal's default theme. Any failure falls * back to the bundled defaults. */ apiKey?: string; language?: WidgetLanguage$1; onCloseResult?: () => void; iframeLoaded?: boolean; /** Results iframe beside the chart; receives `open-pricing` postMessages. */ resultIframeRef?: RefObject; /** Show the Scan action inside the popup. Defaults to `true`. */ isShowScanButton?: boolean; /** Show the Pattern Tracker action inside the popup. Defaults to `true`. */ isShowTrackerButton?: boolean; /** Show the scanner popup at all. Defaults to `true`. */ isShowScannerPopup?: boolean; /** * Chart resolutions where the scanner popup is shown. * If set, the popup is hidden when the chart interval is outside this list. * Also used to gate pattern date-range drawing. * Ignored in pattern mode (`isShowScanButton={false}`), which always uses * `PATTERN_SCANNER_INTERVALS` (`1`…`1D`, no `1W`/`1M`). */ availableIntervals?: string[]; /** Called when the user clicks Scan in the scanner popup. */ onScanClick?: () => void; }; declare const handleResultIframeLoad: (iframe: HTMLIFrameElement | null) => void; type ICCandleAuth = { /** Live embed session mirrored on the host via `iccandle_token`. */ isAuthenticated: boolean; idToken: string | null; }; /** * Host-side view of whether the results iframe is already signed in. * * The embed posts `auth.signIn` / `auth.signOut` after its NextAuth session * changes. Use this to skip minting a new easy-auth user when a session * already exists. */ declare function useICCandleAuth(): ICCandleAuth; declare const WIDGET_LANGUAGES: readonly ["en", "zh", "vi", "th", "ko", "ja", "mn", "ru"]; type WidgetLanguage = (typeof WIDGET_LANGUAGES)[number]; declare function withPlayChart(datafeed: T): T; declare function withPlayChart(factory: (...args: A) => IBasicDataFeed, ...args: A): IBasicDataFeed; type GeneratedCandlesTheme = "light" | "dark"; declare const getCustomIndicators: (theme?: GeneratedCandlesTheme) => Promise; declare const WIDGET_RESULT_URL = "https://embed-iccandle-app.iccandle.ai"; /** Host-side copy of the embed session id token. Set by `auth.signIn`. */ declare const ICCANDLE_TOKEN_KEY = "iccandle_token"; export { ICCANDLE_TOKEN_KEY, WIDGET_RESULT_URL, WidgetIccandle, getCustomIndicators, handleResultIframeLoad, useICCandleAuth, withPlayChart }; export type { GeneratedCandlesTheme, ICCandleAuth, WidgetChartMaskColors, WidgetIccandleProps, WidgetLanguage };