diff --git a/tsconfig.json b/tsconfig.json
index f55e7ae..dcd0f73 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -7,7 +7,8 @@
"module": "ESNext",
"moduleResolution": "bundler",
"paths": {
- "@/*": ["./src/*"]
+ "@/*": ["./src/*"],
+ "#/*": ["./types/*"]
},
"resolveJsonModule": true,
"types": ["./components"],
diff --git a/types/charting_library.d.ts b/types/charting_library.d.ts
new file mode 100644
index 0000000..cad7505
--- /dev/null
+++ b/types/charting_library.d.ts
@@ -0,0 +1,29674 @@
+/**
+ * TradingView Advanced Charts
+ * @packageDocumentation
+ * @module Charting Library
+ */
+// Generated by dts-bundle-generator v9.5.1
+
+/* 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 DisconnectType {
+ LogOut = 0,
+ FailedRestoring = 1,
+ Offline = 2,
+ APIError = 3,
+ TwoFactorRequired = 4,
+ CancelAuthorization = 5,
+ TimeOutForAuthorization = 6,
+ OauthError = 7,
+ BrokenConnection = 8,
+ Reconnect = 9,
+ FailedSignIn = 10
+}
+declare enum PlotSymbolSize {
+ Auto = "auto",
+ Tiny = "tiny",
+ Small = "small",
+ Normal = "normal",
+ Large = "large",
+ Huge = "huge"
+}
+declare enum StopType {
+ StopLoss = 0,
+ TrailingStop = 1,
+ GuaranteedStop = 2
+}
+export declare const enum BottomWidgetBarMode {
+ Minimized = "minimized",
+ Normal = "normal",
+ Maximized = "maximized"
+}
+export declare const enum PaneSize {
+ Tiny = "tiny",
+ Small = "small",
+ Medium = "medium",
+ Large = "large"
+}
+export declare const enum SearchInitiationPoint {
+ SymbolSearch = "symbolSearch",
+ Watchlist = "watchlist",
+ Compare = "compare",
+ IndicatorInputs = "indicatorInputs"
+}
+export declare const widget: ChartingLibraryWidgetConstructor;
+export declare enum ActionId {
+ ChartAddIndicatorToAllCharts = "Chart.AddIndicatorToAllCharts",
+ ChartAddSymbolToWatchList = "Chart.AddSymbolToWatchList",
+ ChartApplyIndicatorsToAllCharts = "Chart.ApplyIndicatorsToAllCharts",
+ ChartIndicatorAddFavorites = "Chart.Indicator.AddFavorites",
+ ChartChangeTimeZone = "Chart.ChangeTimeZone",
+ ChartClipboardCopyPrice = "Chart.Clipboard.CopyPrice",
+ ChartClipboardCopyLineTools = "Chart.Clipboard.CopyLineTools",
+ ChartClipboardCopySource = "Chart.Clipboard.CopySource",
+ ChartClipboardPasteSource = "Chart.Clipboard.PasteSource",
+ ChartCrosshairLockVerticalCursor = "Chart.Crosshair.LockVerticalCursor",
+ ChartCrosshairPlusButtonDrawHorizontalLine = "Chart.Crosshair.PlusButton.DrawHorizontalLine",
+ ChartCustomActionId = "Chart.CustomActionId",
+ ChartDialogsShowChangeInterval = "Chart.Dialogs.ShowChangeInterval",
+ ChartDialogsShowChangeSymbol = "Chart.Dialogs.ShowChangeSymbol",
+ ChartDialogsShowCompareOrAddSymbol = "Chart.Dialogs.ShowCompareOrAddSymbol",
+ ChartDialogsShowGeneralSettings = "Chart.Dialogs.ShowGeneralSettings",
+ ChartDialogsShowGeneralSettingsLegendTab = "Chart.Dialogs.ShowGeneralSettings.LegendTab",
+ ChartDialogsShowGeneralSettingsSymbolTab = "Chart.Dialogs.ShowGeneralSettings.SymbolTab",
+ ChartDialogsShowGeneralScalesTab = "Chart.Dialogs.ShowGeneralSettings.ScalesTab",
+ ChartDialogsShowGoToDate = "Chart.Dialogs.ShowGoToDate",
+ ChartDialogsShowInsertIndicators = "Chart.Dialogs.ShowInsertIndicators",
+ ChartDialogsShowSymbolInfo = "Chart.Dialogs.ShowSymbolInfo",
+ ChartDrawingToolbarToggleVisibility = "Chart.DrawingToolbar.ToggleVisibility",
+ ChartExternalActionId = "Chart.ExternalActionId",
+ ChartFavoriteDrawingToolsToolbarHide = "Chart.FavoriteDrawingToolsToolbar.Hide",
+ ChartIndicatorShowSettingsDialog = "Chart.Indicator.ShowSettingsDialog",
+ ChartLegendToggleLastDayChangeValuesVisibility = "Chart.Legend.ToggleLastDayChangeValuesVisibility",
+ ChartLegendToggleBarChangeValuesVisibility = "Chart.Legend.ToggleBarChangeValuesVisibility",
+ ChartLegendTogglePriceSourceVisibility = "Chart.Legend.TogglePriceSourceVisibility",
+ ChartLegendToggleIndicatorArgumentsVisibility = "Chart.Legend.ToggleIndicatorArgumentsVisibility",
+ ChartLegendToggleIndicatorTitlesVisibility = "Chart.Legend.ToggleIndicatorTitlesVisibility",
+ ChartLegendToggleIndicatorValuesVisibility = "Chart.Legend.ToggleIndicatorValuesVisibility",
+ ChartLegendToggleOhlcValuesVisibility = "Chart.Legend.ToggleOhlcValuesVisibility",
+ ChartLegendToggleOpenMarketStatusVisibility = "Chart.Legend.ToggleOpenMarketStatusVisibility",
+ ChartLegendToggleSymbolVisibility = "Chart.Legend.ToggleSymbolVisibility",
+ ChartLegendToggleVolumeVisibility = "Chart.Legend.ToggleVolumeVisibility",
+ ChartLines = "Chart.Lines",
+ ChartLinesToggleBidAskLinesVisibility = "Chart.Lines.ToggleBidAskLinesVisibility",
+ ChartLinesToggleHighLowLinesVisibility = "Chart.Lines.ToggleHighLowLinesVisibility",
+ ChartLinesToggleAverageLineVisibility = "Chart.Lines.ToggleAverageLineVisibility",
+ ChartLinesTogglePrePostMarketPriceLineVisibility = "Chart.Lines.TogglePrePostMarketPriceLineVisibility",
+ ChartLinesToggleSeriesPrevCloseLineVisibility = "Chart.Lines.ToggleSeriesPrevCloseLineVisibility",
+ ChartLinesToggleSeriesPriceLineVisibility = "Chart.Lines.ToggleSeriesPriceLineVisibility",
+ ChartLineToolBarsPatternToggleFlipped = "Chart.LineTool.BarsPattern.ToggleFlipped",
+ ChartLineToolBarsPatternToggleMirrored = "Chart.LineTool.BarsPattern.ToggleMirrored",
+ ChartLineToolRiskRewardReverse = "Chart.LineTool.RiskReward.Reverse",
+ ChartLineToolClone = "Chart.LineTool.Clone",
+ ChartLineToolCreateLimitOrderFromState = "Chart.LineTool.CreateLimitOrderFromState",
+ ChartLineToolElliotChangeDegreeProperty = "Chart.LineTool.Elliot.ChangeDegreeProperty",
+ ChartLineToolNoSync = "Chart.LineTool.NoSync",
+ ChartLineToolPitchforkChangeTypeToInside = "Chart.LineTool.Pitchfork.ChangeTypeToInside",
+ ChartLineToolPitchforkChangeTypeToModifiedSchiff = "Chart.LineTool.Pitchfork.ChangeTypeToModifiedSchiff",
+ ChartLineToolPitchforkChangeTypeToOriginal = "Chart.LineTool.Pitchfork.ChangeTypeToOriginal",
+ ChartLineToolPitchforkChangeTypeToSchiff = "Chart.LineTool.Pitchfork.ChangeTypeToSchiff",
+ ChartLineToolSyncInLayout = "Chart.LineTool.SyncInLayout",
+ ChartLineToolTemplates = "Chart.LineTool.Templates",
+ ChartLineToolTemplatesApply = "Chart.LineTool.Templates.Apply",
+ ChartLineToolTemplatesApplyDefaults = "Chart.LineTool.Templates.ApplyDefaults",
+ ChartLineToolTemplatesSaveAs = "Chart.LineTool.Templates.SaveAs",
+ ChartLineToolToolbarChangeFontSizeProperty = "Chart.LineTool.Toolbar.ChangeFontSizeProperty",
+ ChartLineToolToolbarChangeLineStyleToDashed = "Chart.LineTool.Toolbar.ChangeLineStyleToDashed",
+ ChartLineToolToolbarChangeLineStyleToDotted = "Chart.LineTool.Toolbar.ChangeLineStyleToDotted",
+ ChartLineToolToolbarChangeLineStyleToSolid = "Chart.LineTool.Toolbar.ChangeLineStyleToSolid",
+ ChartMarksToggleVisibility = "Chart.Marks.ToggleVisibility",
+ ChartMoveChartInLayout = "Chart.MoveChartInLayout",
+ ChartMoveChartInLayoutBack = "Chart.MoveChartInLayout.Back",
+ ChartMoveChartInLayoutForward = "Chart.MoveChartInLayout.Forward",
+ ChartObjectTreeShow = "Chart.ObjectTree.Show",
+ ChartDataWindowShow = "Chart.DataWindow.Show",
+ ChartPaneControlsDeletePane = "Chart.PaneControls.DeletePane",
+ ChartPaneControlsMaximizePane = "Chart.PaneControls.MaximizePane",
+ ChartPaneControlsMinimizePane = "Chart.PaneControls.MinimizePane",
+ ChartPaneControlsMovePaneDown = "Chart.PaneControls.MovePaneDown",
+ ChartPaneControlsMovePaneUp = "Chart.PaneControls.MovePaneUp",
+ ChartPaneControlsCollapsePane = "Chart.PaneControls.CollapsePane",
+ ChartPaneControlsRestorePane = "Chart.PaneControls.RestorePane",
+ ChartPriceScaleLabels = "Chart.PriceScale.Labels",
+ ChartPriceScaleLabelsToggleBidAskLabelsVisibility = "Chart.PriceScale.Labels.ToggleBidAskLabelsVisibility",
+ ChartPriceScaleLabelsToggleHighLowPriceLabelsVisibility = "Chart.PriceScale.Labels.ToggleHighLowPriceLabelsVisibility",
+ ChartPriceScaleLabelsToggleAveragePriceLabelVisibility = "Chart.PriceScale.Labels.ToggleAveragePriceLabelVisibility",
+ ChartPriceScaleLabelsToggleIndicatorsNameLabelsVisibility = "Chart.PriceScale.Labels.ToggleIndicatorsNameLabelsVisibility",
+ ChartPriceScaleLabelsToggleIndicatorsValueLabelsVisibility = "Chart.PriceScale.Labels.ToggleIndicatorsValueLabelsVisibility",
+ ChartPriceScaleLabelsToggleNoOverlappingLabelsVisibility = "Chart.PriceScale.Labels.ToggleNoOverlappingLabelsVisibility",
+ ChartPriceScaleLabelsToggleSeriesLastValueVisibility = "Chart.PriceScale.Labels.ToggleSeriesLastValueVisibility",
+ ChartPriceScaleLabelsToggleSymbolNameLabelsVisibility = "Chart.PriceScale.Labels.ToggleSymbolNameLabelsVisibility",
+ ChartPriceScaleLabelsToggleSymbolPrevCloseValueVisibility = "Chart.PriceScale.Labels.ToggleSymbolPrevCloseValueVisibility",
+ ChartPriceScaleMergeAllScales = "Chart.PriceScale.MergeAllScales",
+ ChartPriceScaleMergeAllScalesToLeft = "Chart.PriceScale.MergeAllScalesToLeft",
+ ChartPriceScaleMergeAllScalesToRight = "Chart.PriceScale.MergeAllScalesToRight",
+ ChartPriceScaleMoveToLeft = "Chart.PriceScale.MoveToLeft",
+ ChartPriceScaleMoveToRight = "Chart.PriceScale.MoveToRight",
+ ChartPriceScaleReset = "Chart.PriceScale.Reset",
+ ChartPriceScaleToggleAddOrderPlusButtonVisibility = "Chart.PriceScale.ToggleAddOrderPlusButtonVisibility",
+ ChartPriceScaleToggleAutoScale = "Chart.PriceScale.ToggleAutoScale",
+ ChartPriceScaleToggleAutoScaleSeriesOnly = "Chart.PriceScale.ToggleAutoScaleSeriesOnly",
+ ChartPriceScaleToggleCountdownToBarCloseVisibility = "Chart.PriceScale.ToggleCountdownToBarCloseVisibility",
+ ChartPriceScaleToggleIndexedTo100 = "Chart.PriceScale.ToggleIndexedTo100",
+ ChartPriceScaleToggleInvertScale = "Chart.PriceScale.ToggleInvertScale",
+ ChartPriceScaleToggleLogarithmic = "Chart.PriceScale.ToggleLogarithmic",
+ ChartPriceScaleTogglePercentage = "Chart.PriceScale.TogglePercentage",
+ ChartPriceScaleToggleRegular = "Chart.PriceScale.ToggleRegular",
+ ChartRedo = "Chart.Redo",
+ ChartRemoveAllIndicators = "Chart.RemoveAllIndicators",
+ ChartRemoveAllIndicatorsAndLineTools = "Chart.RemoveAllIndicatorsAndLineTools",
+ ChartRemoveAllLineTools = "Chart.RemoveAllLineTools",
+ ChartScalesReset = "Chart.Scales.Reset",
+ ChartScalesToggleLockPriceToBarRatio = "Chart.Scales.ToggleLockPriceToBarRatio",
+ ChartScrollToLineTool = "Chart.ScrollToLineTool",
+ ChartSelectedObjectHide = "Chart.SelectedObject.Hide",
+ ChartSelectedObjectRemove = "Chart.SelectedObject.Remove",
+ ChartSelectedObjectShow = "Chart.SelectedObject.Show",
+ ChartSelectedObjectShowSettingsDialog = "Chart.SelectedObject.ShowSettingsDialog",
+ ChartSelectedObjectInsertRowTable = "Chart.SelectedObject.InsertRowTable",
+ ChartSelectedObjectInsertColumnTable = "Chart.SelectedObject.InsertColumnTable",
+ ChartSelectedObjectRemoveRowTable = "Chart.SelectedObject.RemoveRowTable",
+ ChartSelectedObjectRemoveColumnTable = "Chart.SelectedObject.RemoveColumnTable",
+ ChartSelectedObjectToggleLocked = "Chart.SelectedObject.ToggleLocked",
+ ChartSelectedObjectToggleAnchored = "Chart.SelectedObject.ToggleAnchored",
+ ChartSeriesPriceScaleToggleAutoScale = "Chart.Series.PriceScale.ToggleAutoScale",
+ ChartSeriesPriceScaleToggleIndexedTo100 = "Chart.Series.PriceScale.ToggleIndexedTo100",
+ ChartSeriesPriceScaleToggleInvertPriceScale = "Chart.Series.PriceScale.ToggleInvertPriceScale",
+ ChartSeriesPriceScaleToggleLogarithmic = "Chart.Series.PriceScale.ToggleLogarithmic",
+ ChartSeriesPriceScaleTogglePercentage = "Chart.Series.PriceScale.TogglePercentage",
+ ChartSeriesPriceScaleToggleRegular = "Chart.Series.PriceScale.ToggleRegular",
+ ChartSessionBreaksToggleVisibility = "Chart.SessionBreaks.ToggleVisibility",
+ ChartSetSession = "Chart.SetSession",
+ ChartSourceChangePriceScale = "Chart.Source.ChangePriceScale",
+ ChartSourceMergeDown = "Chart.Source.MergeDown",
+ ChartSourceMergeUp = "Chart.Source.MergeUp",
+ ChartSourceMoveToNoScale = "Chart.Source.MoveToNoScale",
+ ChartSourceMoveToOtherScale = "Chart.Source.MoveToOtherScale",
+ ChartSourceMoveToPane = "Chart.Source.MoveToPane",
+ ChartSourceUnmergeDown = "Chart.Source.UnmergeDown",
+ ChartSourceUnmergeUp = "Chart.Source.UnmergeUp",
+ ChartSourceVisualOrder = "Chart.Source.VisualOrder",
+ ChartSourceVisualOrderBringForward = "Chart.Source.VisualOrder.BringForward",
+ ChartSourceVisualOrderBringToFront = "Chart.Source.VisualOrder.BringToFront",
+ ChartSourceVisualOrderSendBackward = "Chart.Source.VisualOrder.SendBackward",
+ ChartSourceVisualOrderSendToBack = "Chart.Source.VisualOrder.SendToBack",
+ ChartSourceResetInputPoints = "Chart.Source.ResetInputPoints",
+ ChartTimeScaleReset = "Chart.TimeScale.Reset",
+ ChartUndo = "Chart.Undo",
+ ChartSourceIntervalsVisibility = "Chart.Source.IntervalsVisibility",
+ ChartSourceIntervalsVisibilityCurrentAndAbove = "Chart.Source.IntervalsVisibility.CurrentAndAbove",
+ ChartSourceIntervalsVisibilityCurrentAndBelow = "Chart.Source.IntervalsVisibility.CurrentAndBelow",
+ ChartSourceIntervalsVisibilityOnlyCurrent = "Chart.Source.IntervalsVisibility.Current",
+ ChartSourceIntervalsVisibilityAll = "Chart.Source.IntervalsVisibility.All",
+ ObjectsTreeCreateGroup = "ObjectsTree.CreateGroup",
+ ObjectsTreeRemoveItem = "ObjectsTree.RemoveItem",
+ ObjectsTreeRenameItem = "ObjectsTree.RenameItem",
+ ObjectsTreeToggleItemLocked = "ObjectsTree.ToggleItemLocked",
+ ObjectsTreeToggleItemVisibility = "ObjectsTree.ToggleItemVisibility",
+ TradingCancelOrder = "Trading.CancelOrder",
+ TradingClosePosition = "Trading.ClosePosition",
+ TradingCustomActionId = "Trading.CustomActionId",
+ TradingDOMPlaceLimitOrder = "Trading.DOMPlaceLimitOrder",
+ TradingDOMPlaceMarketOrder = "Trading.DOMPlaceMarketOrder",
+ TradingDOMPlaceStopLimitOrder = "Trading.DOMPlaceStopLimitOrder",
+ TradingDOMPlaceStopOrder = "Trading.DOMPlaceStopOrder",
+ TradingEditOrder = "Trading.EditOrder",
+ TradingModifyPosition = "Trading.ModifyPosition",
+ TradingReversePosition = "Trading.ReversePosition",
+ TradingSellBuyButtonsToggleVisibility = "Trading.SellBuyButtonsToggleVisibility",
+ TradingTradeFromChart = "Trading.TradeFromChart",
+ TradingNoOverlapMode = "Trading.NoOverlapMode",
+ WatchlistAddSelectedSymbolsToCompare = "Watchlist.AddSelectedSymbolsToCompare ",
+ WatchlistAddSymbolToCompare = "Watchlist.AddSymbolToCompare",
+ WatchlistAddSymbolToSection = "Watchlist.AddSymbolToSection",
+ WatchlistAddSymbol = "Watchlist.AddSymbol",
+ WatchlistRemoveSection = "Watchlist.RemoveSection",
+ WatchlistRenameSection = "Watchlist.RenameSection"
+}
+export 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.
+ */
+export 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
+}
+export declare enum ConnectionStatus {
+ Connected = 1,
+ Connecting = 2,
+ Disconnected = 3,
+ Error = 4
+}
+/**
+ * Filled area type.
+ */
+export 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.
+ */
+export declare enum HHistDirection {
+ LeftToRight = "left_to_right",
+ RightToLeft = "right_to_left"
+}
+/**
+ * An enum describing a plot style.
+ */
+export 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.
+ */
+export declare enum LineStyle {
+ /**
+ * Solid line style.
+ */
+ Solid = 0,
+ /**
+ * Dotted line style.
+ */
+ Dotted = 1,
+ /**
+ * Dashed line style.
+ */
+ Dashed = 2
+}
+export 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.
+ */
+export declare enum MarketStatus {
+ Open = "market",
+ Pre = "pre_market",
+ Post = "post_market",
+ Close = "out_of_session",
+ Holiday = "holiday"
+}
+export declare enum MenuItemType {
+ Separator = "separator",
+ Action = "action"
+}
+export declare enum NotificationType {
+ Error = 0,
+ Success = 1
+}
+export declare enum OhlcStudyPlotStyle {
+ OhlcBars = "ohlc_bars",
+ OhlcCandles = "ohlc_candles"
+}
+export declare enum OrderOrPositionMessageType {
+ Information = "information",
+ Warning = "warning",
+ Error = "error"
+}
+export declare enum OrderStatus {
+ Canceled = 1,
+ Filled = 2,
+ Inactive = 3,
+ Placing = 4,
+ Rejected = 5,
+ Working = 6
+}
+export declare enum OrderStatusFilter {
+ All = 0,
+ Canceled = 1,
+ Filled = 2,
+ Inactive = 3,
+ Rejected = 5,
+ Working = 6
+}
+export declare enum OrderTicketFocusControl {
+ LimitPrice = 1,
+ StopPrice = 2,
+ TakeProfit = 3,
+ StopLoss = 4,
+ Quantity = 5
+}
+export declare enum OrderType {
+ Limit = 1,
+ Market = 2,
+ Stop = 3,
+ StopLimit = 4
+}
+/**
+ * Plot line style
+ */
+export declare enum OverrideLineStyle {
+ /**
+ * Solid line style.
+ */
+ Solid = 0,
+ /**
+ * Dotted line style.
+ */
+ Dotted = 1,
+ /**
+ * Dashed line style.
+ */
+ Dashed = 2
+}
+/**
+ * Last value label mode.
+ */
+export declare enum OverridePriceAxisLastValueMode {
+ /**
+ * Price and % value.
+ */
+ LastPriceAndPercentageValue = 0,
+ /**
+ * Value according to scale.
+ */
+ LastValueAccordingToScale = 1
+}
+export declare enum ParentType {
+ Order = 1,
+ Position = 2,
+ IndividualPosition = 3
+}
+export declare enum PlDisplay {
+ Money = 0,
+ Pips = 1,
+ Percentage = 2
+}
+export 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
+}
+export 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
+}
+export declare enum Side {
+ Buy = 1,
+ Sell = -1
+}
+/**
+ * Enumeration of the built-in formatters for the Account Manager columns.
+ * Refer to the [Value formatters](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/value-formatters) section for more information.
+ */
+export declare enum StandardFormatterName {
+ Date = "date",
+ DateOrDateTime = "dateOrDateTime",
+ Default = "default",
+ Fixed = "fixed",
+ FixedInCurrency = "fixedInCurrency",
+ VariablePrecision = "variablePrecision",
+ FormatQuantity = "formatQuantity",
+ FormatPrice = "formatPrice",
+ FormatPriceForexSup = "formatPriceForexSup",
+ FormatPriceInCurrency = "formatPriceInCurrency",
+ IntegerSeparated = "integerSeparated",
+ LocalDate = "localDate",
+ LocalDateOrDateTime = "localDateOrDateTime",
+ Percentage = "percentage",
+ Pips = "pips",
+ Profit = "profit",
+ ProfitInInstrumentCurrency = "profitInInstrumentCurrency",
+ Side = "side",
+ PositionSide = "positionSide",
+ Status = "status",
+ Symbol = "symbol",
+ Text = "text",
+ Type = "type",
+ MarginPercent = "marginPercent",
+ Empty = "empty"
+}
+export 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"
+}
+export declare enum StudyPlotDisplayTarget {
+ None = 0,
+ Pane = 1,
+ DataWindow = 2,
+ PriceScale = 4,
+ StatusLine = 8,
+ All = 15
+}
+export 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"
+}
+export declare enum StudyTargetPriceScale {
+ Right = 0,
+ Left = 1,
+ NoScale = 2
+}
+export declare enum TimeFrameType {
+ PeriodBack = "period-back",
+ TimeRange = "time-range"
+}
+export declare enum TimeHoursFormat {
+ TwentyFourHours = "24-hours",
+ TwelveHours = "12-hours"
+}
+export declare enum TradedGroupHorizontalAlignment {
+ Left = 0,
+ Center = 1,
+ Right = 2
+}
+export declare enum VisibilityType {
+ AlwaysOn = "alwaysOn",
+ VisibleOnMouseOver = "visibleOnMouseOver",
+ AlwaysOff = "alwaysOff"
+}
+/**
+ * Returns a build version string. For example "CL v23.012 (internal id e0d59dc3 @ 2022-08-23T06:07:00.808Z)".
+ *
+ * @returns The build version string.
+ */
+export declare function version(): string;
+/**
+ * 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;
+ */
+export declare type Nominal = T & { /* eslint-disable-next-line jsdoc/require-jsdoc */
+ [Symbol.species]: Name;
+};
+/**
+ * Override properties for the Abcd drawing tool.
+ */
+export interface AbcdLineToolOverrides {
+ /** Default value: `false` */
+ "linetoolabcd.bold": boolean;
+ /** Default value: `#089981` */
+ "linetoolabcd.color": string;
+ /** Default value: `12` */
+ "linetoolabcd.fontsize": number;
+ /** Default value: `false` */
+ "linetoolabcd.italic": boolean;
+ /** Default value: `2` */
+ "linetoolabcd.linewidth": number;
+ /** Default value: `#ffffff` */
+ "linetoolabcd.textcolor": string;
+}
+/**
+ * Overrides for the 'Accelerator Oscillator' indicator.
+ *
+ * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}.
+ */
+export 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;
+}
+/**
+ * Defines a whitelist / blacklist of studies or drawing tools.
+ */
+export interface AccessList {
+ /**
+ * List type.
+ * Supported values are:
+ * `black` (all listed items should be disabled),
+ * `white` (only the listed items should be enabled).
+ */
+ type: "black" | "white";
+ /** Array of items which should be considered part of the access list */
+ tools: AccessListItem[];
+}
+export interface AccessListItem {
+ /**
+ * Name of the study / drawing tool.
+ * Use the same name as seen in the UI for drawings,
+ * and use the same names as in the pop-ups for indicators.
+ */
+ name: string;
+ /**
+ * Whether this study should be visible but look as if it's disabled.
+ * If the study is grayed out and user clicks it, then the `onGrayedObjectClicked` function is called.
+ */
+ grayed?: boolean;
+}
+/** Column properties for the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/) pages. */
+export interface AccountManagerColumnBase {
+ /** Column title. It will be displayed in the table's header row. */
+ label: string;
+ /**
+ * Horizontal alignment of the cell value. The default value is `left`.
+ *
+ * | Alignment | Description |
+ * |--------------|----------------|
+ * | left | It aligns the cell value to the left. |
+ * | right | It aligns the cell value to the right. |
+ */
+ alignment?: CellAlignment;
+ /** Unique column identifier. */
+ id: string;
+ /**
+ * Defines a formatter to be applied for data formatting, which can either belong to the `StandardFormatterName` or `FormatterName` type.
+ * If no specific formatter is set, the value is displayed as is.
+ *
+ * Default formatter names are enumerated in {@link StandardFormatterName}.
+ * Refer to the [Built-in formatters](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/value-formatters#built-in-formatters) section to see the full list of formatters.
+ *
+ * You can also create custom formatters using the {@link AccountManagerInfo.customFormatters} property.
+ */
+ formatter?: TFormatterName;
+ /**
+ * The `dataFields` array contains fields from an order/position data object.
+ * `dataFields` is used to generate the values displayed in a column.
+ * The displayed value in the column updates only when the corresponding values in the data object change.
+ *
+ * If no {@link formatter} is specified, the displayed values will be space-separated in the column.
+ * When a `formatter` is defined, it processes only the specified values.
+ * If an empty array is assigned to `dataFields`, the `formatter` will receive the entire data object.
+ *
+ * **Example**
+ *
+ * - For a column with `dataFields` set as `['avgPrice', 'qty']`, the displayed value updates only when the `avgPrice` or `qty` values in the data object change.
+ * - For a column with an empty `dataFields` array, the displayed value updates if any values in the data object change.
+ */
+ dataFields: TFormatterName extends StandardFormatterName ? StandardFormattersDependenciesMapping[TFormatterName] : string[];
+ /**
+ * Data object key that is used for data sorting.
+ *
+ * If `sortProp` is not provided, the first element of the `dataFields` array will be used.
+ * If the `dataFields` array is empty, the column sorting will be unavailable.
+ */
+ sortProp?: string;
+ /** When set to `true` will prevent column sorting. */
+ notSortable?: boolean;
+ /** Tooltip string for the column. */
+ help?: string;
+ /**
+ * `highlightDiff` can be set with [`StandardFormatterName.FormatPrice`](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/value-formatters#formatPrice)
+ * and [`StandardFormatterName.FormatPriceForexSup`](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/value-formatters#formatPriceForexSup) formatters to highlight the changes of the field.
+ * If `highlightDiff is `true`, the custom formatters will also get previous values.
+ */
+ highlightDiff?: boolean;
+ /** Setting `notHideable` to `true` prevents the column from being hidden. */
+ notHideable?: boolean;
+ /** Setting `hideByDefault` to `true` hides the column by default. */
+ hideByDefault?: boolean;
+ /** Key of the row object that is used to get the tooltip to display when hovering over a cell.
+ * The tooltip property refers to an object whose keys are property names and
+ * values are the corresponding tooltips.
+ */
+ tooltipProperty?: string;
+ /** If set to `true`, the first character of every word in the sentence in the column
+ * will be capitalized. The default value is `true`.
+ */
+ isCapitalize?: boolean;
+ /** Setting `showZeroValues` to `true` hides any zero values. The default value is `true`. */
+ showZeroValues?: boolean;
+}
+/**
+ * The information object that is used to build the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/).
+ */
+export interface AccountManagerInfo {
+ /** Name of the broker */
+ accountTitle: string;
+ /**
+ * Custom fields that are always displayed at the top-right corner of the Account Manager.
+ * Refer to the [Account Summary row](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/#account-summary-row) section for more information.
+ */
+ summary: AccountManagerSummaryField[];
+ /**
+ * An optional array for defining [custom formatters](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/value-formatters#custom-formatters).
+ * Each formatter description is an object with the following fields:
+ *
+ * - `name` ({@link FormatterName}): Unique formatter name.
+ *
+ * - `formatText` ({@link TableFormatTextFunction}):
+ * Function that is used for formatting a cell value to a string.
+ * The `formatText` field is required because it is used to generate exported data.
+ * You can return an empty string if you do not need this function.
+ *
+ * - `formatElement` ({@link CustomTableFormatElementFunction} | `undefined`):
+ * Optional function that is used for formatting a cell value to a string or an HTML element.
+ *
+ * If the `formatElement` function is provided, it only handles the formatting of displayed values.
+ * Otherwise the `formatText` function is used.
+ * For optimal performance, it is recommended to only use `formatText` if you intend to display only string values.
+ *
+ * **Example**
+ * ```ts
+ * {
+ * name: 'closeButton' as FormatterName, // Typecast to FormatterName. Use constant in real code
+ * formatText: () => '', // Returns an empty string because we don't need to display this in the exported data
+ * formatElement: ({ values: [id] }: TableFormatterInputs<[id: string]>) => {
+ * const button = document.createElement('button');
+ *
+ * button.innerText = 'Close';
+ *
+ * button.addEventListener('click', () => {
+ * event.stopPropagation();
+ *
+ * closePosition(id);
+ * });
+ *
+ * return button;
+ * },
+ * }
+ * ```
+ */
+ customFormatters?: CustomTableElementFormatter[];
+ /** An array of data objects that create columns for the [Orders](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/#orders-and-positions) page.
+ * You can display any field of an {@link Order}
+ * or add your own fields to an order object and display them.
+ */
+ orderColumns: OrderTableColumn[];
+ /** Optional sorting of the orders table. */
+ orderColumnsSorting?: SortingParameters;
+ /**
+ * An array of data objects that create columns for the [History](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/#history) page where all orders from previous sessions are shown.
+ * Note that this page is only shown
+ * if you set the {@link BrokerConfigFlags.supportOrdersHistory} to `true`
+ * and implement the [`ordersHistory`](https://www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.IBrokerTerminal#ordershistory) method.
+ */
+ historyColumns?: AccountManagerColumn[];
+ /** Optional sorting of the table on the [History](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/#history) page. */
+ historyColumnsSorting?: SortingParameters;
+ /**
+ * An array of data objects that create columns for the [Positions](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/#orders-and-positions) page.
+ * You can display any field of a {@link Position}
+ * or add your own fields to a position object and display them.
+ */
+ positionColumns?: AccountManagerColumn[];
+ /**
+ * You can display any field of an {@link IndividualPosition}
+ * or add your own fields to an individualPosition object and display them.
+ */
+ individualPositionColumns?: AccountManagerColumn[];
+ /** Adds [custom pages](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/#custom-pages) to the Account Manager. Each page is a set of tables. */
+ pages: AccountManagerPage[];
+ /** Optional list of statuses to be used in the orders filter. Default list is used if it hasn't been set. */
+ possibleOrderStatuses?: OrderStatus[];
+ /** Margin used */
+ marginUsed?: IWatchedValue;
+ /**
+ * A function for creating a custom [context menu](https://www.tradingview.com/charting-library-docs/latest/ui_elements/context-menu) for positions and orders in the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/).
+ * @param contextMenuEvent - MouseEvent or TouchEvent object passed by a browser
+ * @param activePageActions - array of `ActionMetaInfo` items for the current page
+ * @returns `Promise` that is resolved with an array of `ActionMetaInfo`
+ */
+ contextMenuActions?(contextMenuEvent: MouseEvent | TouchEvent, activePageActions: ActionMetaInfo[]): Promise;
+}
+/** A description of an additional Account Manager tab. */
+export interface AccountManagerPage {
+ /** Unique identifier of a page */
+ id: string;
+ /** Page title. It is the tab name. */
+ title: string;
+ /** It is possible to display one or more tables in this tab. */
+ tables: AccountManagerTable[];
+ /** Controls whether the number of items is displayed on a custom page. Set to `true` to display the count, or `false` to hide it. */
+ displayCounterInTab?: boolean;
+}
+/** Custom field that will always be shown above the pages of the Account manager */
+export interface AccountManagerSummaryField {
+ /** Text to display for the summary field */
+ text: string;
+ /** A WatchedValue object that can be used to read the state of field. */
+ wValue: IWatchedValueReadonly;
+ /**
+ * Name of the formatter to be used for data formatting. If `formatter` is not
+ * set the value is displayed as is. Formatter can be a default or a custom one.
+ */
+ formatter?: StandardFormatterName;
+ /** Optional parameter which can be set to display the field by default. */
+ isDefault?: boolean;
+ /** An optional parameter with text explaining the contents of this field. */
+ informerMessage?: string;
+}
+/**
+ * Account Summary table meta-info
+ * **NOTE**: make sure that you have a unique string `id` field in each row to identify it.
+ */
+export interface AccountManagerTable {
+ /** Unique identifier of a table. */
+ id: string;
+ /** Optional title of a table. */
+ title?: string;
+ /** Table columns */
+ columns: AccountManagerColumn[];
+ /** Optional sorting of the table. If set, then the table will be sorted by these parameters, if the user has not enabled sorting by a specific column. */
+ initialSorting?: SortingParameters;
+ /** This delegate is used to watch the data changes and update the table.
+ * Pass new account manager data row by row to the `fire` method of the delegate.
+ */
+ changeDelegate: ISubscription<(data: {}) => void>;
+ /** This delegate is used to watch the data deletions and update the table.
+ * Pass the id of the row that needs to be deleted to the `fire` method of the delegate.
+ */
+ deleteDelegate?: ISubscription<(id: string) => void>;
+ /** Option flags for the table. */
+ flags?: AccountManagerTableFlags;
+ /**
+ * This function is used to request table data. It should return Promise (or Deferred) and resolve it with an array of data rows.
+ *
+ * Each row is an object. Keys of this object are column names with the corresponding values.
+ *
+ * There is a predefined field `isTotalRow` which can be used to mark a row that should be at the bottom of the table.
+ * @param paginationLastId - Last pagination id
+ */
+ getData(paginationLastId?: string | number): Promise<{}[]>;
+}
+/** Boolean options for the account manager table */
+export interface AccountManagerTableFlags {
+ /** Does the table support pagination */
+ supportPagination?: boolean;
+}
+export interface AccountMetainfo {
+ /**
+ * Account ID
+ */
+ id: AccountId;
+ /**
+ * Account Name
+ */
+ name: string;
+ /**
+ * Currency
+ */
+ currency?: string;
+ /**
+ * Currency Sign (Prefix)
+ */
+ currencySign?: string;
+}
+/**
+ * Overrides for the 'Accumulation/Distribution' indicator.
+ *
+ * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}.
+ */
+export 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}.
+ */
+export 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;
+}
+export interface ActionDescription {
+ /** Displayed text for action */
+ text?: "-" | string;
+ /** Is a menu separator */
+ separator?: boolean;
+ /** Keyboard shortcut for the action. Displayed as hint text. */
+ shortcut?: string;
+ /** Tooltip text to be displayed when hovering over the action item. */
+ tooltip?: string;
+ /** Value of the checkbox. */
+ checked?: boolean;
+ /** Getter to retrieve the current checkbox value. */
+ checkedStateSource?: () => boolean;
+ /** Whether menu action represents a checkbox state. Set it to true if you need a checkbox. */
+ checkable?: boolean;
+ /** Whether the action is enabled. Set to false to disabled the action. */
+ enabled?: boolean;
+ /** External link (url) which will be opened upon clicking the menu item. */
+ externalLink?: boolean;
+ /**
+ * A string of SVG icon for an action. A string should be a string representation of SVG (not a path/URL).
+ */
+ icon?: string;
+}
+/** Menu action which provides a callback function to be executed. Action is executed when user clicks the item. */
+export interface ActionDescriptionWithCallback extends ActionDescription {
+ /** Action to be executed when user clicks the menu item. */
+ action: (a?: ActionDescription) => void;
+}
+export interface ActionOptions extends Partial>, Pick {
+ /**
+ * A function which will be called when an action should be executed (e.g. when a user clicks on the item).
+ */
+ onExecute?: OnActionExecuteHandler;
+}
+export interface ActionState {
+ /**
+ * Human-readable, non-unique ID of an action item. Similar to {@link label}, but language-agnostic.
+ */
+ actionId: ActionId;
+ /** Is active */
+ active: boolean;
+ /**
+ * Text title of an action
+ */
+ label: string;
+ /**
+ * Text title of an action consisting of several styled sections. If not defined then {@link label} is used instead.
+ */
+ styledLabel?: StyledText[];
+ /**
+ * Whether an action is disabled or not (disabled actions are usually cannot be executed and displayed grayed out)
+ */
+ disabled: boolean;
+ /**
+ * Sub-items of an action
+ */
+ subItems: IActionVariant[];
+ /**
+ * Whether an action should have a checkbox next to it.
+ */
+ checkable: boolean;
+ /**
+ * If {@link checkable} is `true` then whether current state is checked or not.
+ */
+ checked: boolean;
+ /**
+ * A hint of an action.
+ */
+ hint?: string;
+ /**
+ * A string of SVG icon for an action. A string should be a string representation of SVG (not a path/URL).
+ */
+ icon?: string;
+ /**
+ * If {@link checkable} is `true` then an icon to be used when {@link checked} is `true`.
+ */
+ iconChecked?: string;
+ /**
+ * Whether an action is still in loading state (it means that it's data is not ready yet).
+ * Usually in this case a spinner/loader will be displayed instead of this action.
+ */
+ loading: boolean;
+ /**
+ * A string that represents a shortcut hint for this action.
+ */
+ shortcutHint?: string;
+ /**
+ * A flag indicating whether the menu should remain open after clicking on the item.
+ * When `true` the menu will remain open.
+ */
+ doNotCloseOnClick: boolean;
+ /**
+ * This flag indicates that this action is static content only and is not interactive.
+ */
+ noInteractive?: boolean;
+}
+export interface ActionsFactory {
+ /**
+ * Creates an action with provided options.
+ */
+ createAction: (options: ActionOptions) => IAction;
+ /**
+ * Creates an action that will wait for a promise to get its options.
+ * In terms of GUI until a promise is resolved the loader/spinner will be displayed.
+ */
+ createAsyncAction: (loader: () => Promise) => IAction;
+ /**
+ * Creates a separator item.
+ */
+ createSeparator: () => ISeparator;
+}
+/**
+ * Custom symbol info fields to be shown in the Security Info dialog.
+ */
+export interface AdditionalSymbolInfoField {
+ /** the name of the new symbol info */
+ title: string;
+ /** used to look up a property from the symbol info returned from the chart's datafeed */
+ propertyName: string;
+}
+/**
+ * Overrides for the 'Advance/Decline' indicator.
+ *
+ * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}.
+ */
+export 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}.
+ */
+export 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;
+}
+/**
+ * Override properties for the Anchoredvp drawing tool.
+ */
+export interface AnchoredvpLineToolOverrides {
+ /** Default value: `undefined` */
+ "linetoolanchoredvp.graphics.hhists.histBars2.colors.0": string;
+ /** Default value: `undefined` */
+ "linetoolanchoredvp.graphics.hhists.histBars2.colors.1": string;
+ /** Default value: `undefined` */
+ "linetoolanchoredvp.graphics.hhists.histBars2.valuesColor": string;
+ /** Default value: `undefined` */
+ "linetoolanchoredvp.graphics.hhists.histBarsVA.colors.0": string;
+ /** Default value: `undefined` */
+ "linetoolanchoredvp.graphics.hhists.histBarsVA.colors.1": string;
+ /** Default value: `undefined` */
+ "linetoolanchoredvp.graphics.hhists.histBarsVA.valuesColor": string;
+ /** Default value: `undefined` */
+ "linetoolanchoredvp.graphics.horizlines.pocLines.color": string;
+ /** Default value: `undefined` */
+ "linetoolanchoredvp.graphics.horizlines.vahLines.color": string;
+ /** Default value: `undefined` */
+ "linetoolanchoredvp.graphics.horizlines.valLines.color": string;
+ /** Default value: `undefined` */
+ "linetoolanchoredvp.graphics.polygons.histBoxBg.color": string;
+ /** Default value: `undefined` */
+ "linetoolanchoredvp.styles.developingPoc.color": string;
+ /** Default value: `undefined` */
+ "linetoolanchoredvp.styles.developingVAHigh.color": string;
+ /** Default value: `undefined` */
+ "linetoolanchoredvp.styles.developingVALow.color": string;
+}
+/**
+ * Override properties for the Anchoredvwap drawing tool.
+ */
+export interface AnchoredvwapLineToolOverrides {
+ /** Default value: `#4caf50` */
+ "linetoolanchoredvwap.areaBackground.backgroundColor": string;
+ /** Default value: `true` */
+ "linetoolanchoredvwap.areaBackground.fillBackground": boolean;
+ /** Default value: `95` */
+ "linetoolanchoredvwap.areaBackground.transparency": number;
+ /** Default value: `#4caf50` */
+ "linetoolanchoredvwap.filledAreasStyle.Background_1.color": string;
+ /** Default value: `95` */
+ "linetoolanchoredvwap.filledAreasStyle.Background_1.transparency": number;
+ /** Default value: `true` */
+ "linetoolanchoredvwap.filledAreasStyle.Background_1.visible": boolean;
+ /** Default value: `Standard Deviation` */
+ "linetoolanchoredvwap.inputs.Bands Calculation Mode": string;
+ /** Default value: `1` */
+ "linetoolanchoredvwap.inputs.bands_multiplier": number;
+ /** Default value: `2` */
+ "linetoolanchoredvwap.inputs.bands_multiplier_2": number;
+ /** Default value: `3` */
+ "linetoolanchoredvwap.inputs.bands_multiplier_3": number;
+ /** Default value: `true` */
+ "linetoolanchoredvwap.inputs.calculate_stDev": boolean;
+ /** Default value: `false` */
+ "linetoolanchoredvwap.inputs.calculate_stDev_2": boolean;
+ /** Default value: `false` */
+ "linetoolanchoredvwap.inputs.calculate_stDev_3": boolean;
+ /** Default value: `hlc3` */
+ "linetoolanchoredvwap.inputs.source": string;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.inputs.start_time": number;
+ /** Default value: `default` */
+ "linetoolanchoredvwap.precision": string;
+ /** Default value: `#4caf50` */
+ "linetoolanchoredvwap.styles.LowerBand.color": string;
+ /** Default value: `15` */
+ "linetoolanchoredvwap.styles.LowerBand.display": number;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.LowerBand.linestyle": number;
+ /** Default value: `1` */
+ "linetoolanchoredvwap.styles.LowerBand.linewidth": number;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.LowerBand.plottype": number;
+ /** Default value: `false` */
+ "linetoolanchoredvwap.styles.LowerBand.trackPrice": boolean;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.LowerBand.transparency": number;
+ /** Default value: `#808000` */
+ "linetoolanchoredvwap.styles.LowerBand_2.color": string;
+ /** Default value: `15` */
+ "linetoolanchoredvwap.styles.LowerBand_2.display": number;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.LowerBand_2.linestyle": number;
+ /** Default value: `1` */
+ "linetoolanchoredvwap.styles.LowerBand_2.linewidth": number;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.LowerBand_2.plottype": number;
+ /** Default value: `false` */
+ "linetoolanchoredvwap.styles.LowerBand_2.trackPrice": boolean;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.LowerBand_2.transparency": number;
+ /** Default value: `#00897b` */
+ "linetoolanchoredvwap.styles.LowerBand_3.color": string;
+ /** Default value: `15` */
+ "linetoolanchoredvwap.styles.LowerBand_3.display": number;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.LowerBand_3.linestyle": number;
+ /** Default value: `1` */
+ "linetoolanchoredvwap.styles.LowerBand_3.linewidth": number;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.LowerBand_3.plottype": number;
+ /** Default value: `false` */
+ "linetoolanchoredvwap.styles.LowerBand_3.trackPrice": boolean;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.LowerBand_3.transparency": number;
+ /** Default value: `#4caf50` */
+ "linetoolanchoredvwap.styles.UpperBand.color": string;
+ /** Default value: `15` */
+ "linetoolanchoredvwap.styles.UpperBand.display": number;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.UpperBand.linestyle": number;
+ /** Default value: `1` */
+ "linetoolanchoredvwap.styles.UpperBand.linewidth": number;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.UpperBand.plottype": number;
+ /** Default value: `false` */
+ "linetoolanchoredvwap.styles.UpperBand.trackPrice": boolean;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.UpperBand.transparency": number;
+ /** Default value: `#808000` */
+ "linetoolanchoredvwap.styles.UpperBand_2.color": string;
+ /** Default value: `15` */
+ "linetoolanchoredvwap.styles.UpperBand_2.display": number;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.UpperBand_2.linestyle": number;
+ /** Default value: `1` */
+ "linetoolanchoredvwap.styles.UpperBand_2.linewidth": number;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.UpperBand_2.plottype": number;
+ /** Default value: `false` */
+ "linetoolanchoredvwap.styles.UpperBand_2.trackPrice": boolean;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.UpperBand_2.transparency": number;
+ /** Default value: `#00897b` */
+ "linetoolanchoredvwap.styles.UpperBand_3.color": string;
+ /** Default value: `15` */
+ "linetoolanchoredvwap.styles.UpperBand_3.display": number;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.UpperBand_3.linestyle": number;
+ /** Default value: `1` */
+ "linetoolanchoredvwap.styles.UpperBand_3.linewidth": number;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.UpperBand_3.plottype": number;
+ /** Default value: `false` */
+ "linetoolanchoredvwap.styles.UpperBand_3.trackPrice": boolean;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.UpperBand_3.transparency": number;
+ /** Default value: `#1e88e5` */
+ "linetoolanchoredvwap.styles.VWAP.color": string;
+ /** Default value: `15` */
+ "linetoolanchoredvwap.styles.VWAP.display": number;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.VWAP.linestyle": number;
+ /** Default value: `1` */
+ "linetoolanchoredvwap.styles.VWAP.linewidth": number;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.VWAP.plottype": number;
+ /** Default value: `false` */
+ "linetoolanchoredvwap.styles.VWAP.trackPrice": boolean;
+ /** Default value: `0` */
+ "linetoolanchoredvwap.styles.VWAP.transparency": number;
+}
+/**
+ * Override properties for the Arc drawing tool.
+ */
+export interface ArcLineToolOverrides {
+ /** Default value: `rgba(233, 30, 99, 0.2)` */
+ "linetoolarc.backgroundColor": string;
+ /** Default value: `#e91e63` */
+ "linetoolarc.color": string;
+ /** Default value: `true` */
+ "linetoolarc.fillBackground": boolean;
+ /** Default value: `2` */
+ "linetoolarc.linewidth": number;
+ /** Default value: `80` */
+ "linetoolarc.transparency": number;
+}
+export interface AreaStylePreferences {
+ /** Top color */
+ color1: string;
+ /** Bottom color */
+ color2: string;
+ /** Line Color */
+ 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}.
+ */
+export 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}.
+ */
+export 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;
+}
+/**
+ * Override properties for the Arrow drawing tool.
+ */
+export interface ArrowLineToolOverrides {
+ /** Default value: `false` */
+ "linetoolarrow.alwaysShowStats": boolean;
+ /** Default value: `false` */
+ "linetoolarrow.bold": boolean;
+ /** Default value: `false` */
+ "linetoolarrow.extendLeft": boolean;
+ /** Default value: `false` */
+ "linetoolarrow.extendRight": boolean;
+ /** Default value: `14` */
+ "linetoolarrow.fontsize": number;
+ /** Default value: `center` */
+ "linetoolarrow.horzLabelsAlign": string;
+ /** Default value: `false` */
+ "linetoolarrow.italic": boolean;
+ /** Default value: `0` */
+ "linetoolarrow.leftEnd": number;
+ /** Default value: `#2962FF` */
+ "linetoolarrow.linecolor": string;
+ /** Default value: `0` */
+ "linetoolarrow.linestyle": number;
+ /** Default value: `2` */
+ "linetoolarrow.linewidth": number;
+ /** Default value: `1` */
+ "linetoolarrow.rightEnd": number;
+ /** Default value: `false` */
+ "linetoolarrow.showAngle": boolean;
+ /** Default value: `false` */
+ "linetoolarrow.showBarsRange": boolean;
+ /** Default value: `false` */
+ "linetoolarrow.showDateTimeRange": boolean;
+ /** Default value: `false` */
+ "linetoolarrow.showDistance": boolean;
+ /** Default value: `false` */
+ "linetoolarrow.showLabel": boolean;
+ /** Default value: `false` */
+ "linetoolarrow.showMiddlePoint": boolean;
+ /** Default value: `false` */
+ "linetoolarrow.showPercentPriceRange": boolean;
+ /** Default value: `false` */
+ "linetoolarrow.showPipsPriceRange": boolean;
+ /** Default value: `false` */
+ "linetoolarrow.showPriceLabels": boolean;
+ /** Default value: `false` */
+ "linetoolarrow.showPriceRange": boolean;
+ /** Default value: `2` */
+ "linetoolarrow.statsPosition": number;
+ /** Default value: `#2962FF` */
+ "linetoolarrow.textcolor": string;
+ /** Default value: `bottom` */
+ "linetoolarrow.vertLabelsAlign": string;
+}
+/**
+ * Override properties for the Arrowmarkdown drawing tool.
+ */
+export interface ArrowmarkdownLineToolOverrides {
+ /** Default value: `#CC2F3C` */
+ "linetoolarrowmarkdown.arrowColor": string;
+ /** Default value: `false` */
+ "linetoolarrowmarkdown.bold": boolean;
+ /** Default value: `#CC2F3C` */
+ "linetoolarrowmarkdown.color": string;
+ /** Default value: `14` */
+ "linetoolarrowmarkdown.fontsize": number;
+ /** Default value: `false` */
+ "linetoolarrowmarkdown.italic": boolean;
+ /** Default value: `true` */
+ "linetoolarrowmarkdown.showLabel": boolean;
+}
+/**
+ * Override properties for the Arrowmarker drawing tool.
+ */
+export interface ArrowmarkerLineToolOverrides {
+ /** Default value: `#1E53E5` */
+ "linetoolarrowmarker.backgroundColor": string;
+ /** Default value: `true` */
+ "linetoolarrowmarker.bold": boolean;
+ /** Default value: `16` */
+ "linetoolarrowmarker.fontsize": number;
+ /** Default value: `false` */
+ "linetoolarrowmarker.italic": boolean;
+ /** Default value: `true` */
+ "linetoolarrowmarker.showLabel": boolean;
+ /** Default value: `#1E53E5` */
+ "linetoolarrowmarker.textColor": string;
+}
+/**
+ * Override properties for the Arrowmarkleft drawing tool.
+ */
+export interface ArrowmarkleftLineToolOverrides {
+ /** Default value: `#2962FF` */
+ "linetoolarrowmarkleft.arrowColor": string;
+ /** Default value: `false` */
+ "linetoolarrowmarkleft.bold": boolean;
+ /** Default value: `#2962FF` */
+ "linetoolarrowmarkleft.color": string;
+ /** Default value: `14` */
+ "linetoolarrowmarkleft.fontsize": number;
+ /** Default value: `false` */
+ "linetoolarrowmarkleft.italic": boolean;
+ /** Default value: `true` */
+ "linetoolarrowmarkleft.showLabel": boolean;
+}
+/**
+ * Override properties for the Arrowmarkright drawing tool.
+ */
+export interface ArrowmarkrightLineToolOverrides {
+ /** Default value: `#2962FF` */
+ "linetoolarrowmarkright.arrowColor": string;
+ /** Default value: `false` */
+ "linetoolarrowmarkright.bold": boolean;
+ /** Default value: `#2962FF` */
+ "linetoolarrowmarkright.color": string;
+ /** Default value: `14` */
+ "linetoolarrowmarkright.fontsize": number;
+ /** Default value: `false` */
+ "linetoolarrowmarkright.italic": boolean;
+ /** Default value: `true` */
+ "linetoolarrowmarkright.showLabel": boolean;
+}
+/**
+ * Override properties for the Arrowmarkup drawing tool.
+ */
+export interface ArrowmarkupLineToolOverrides {
+ /** Default value: `#089981` */
+ "linetoolarrowmarkup.arrowColor": string;
+ /** Default value: `false` */
+ "linetoolarrowmarkup.bold": boolean;
+ /** Default value: `#089981` */
+ "linetoolarrowmarkup.color": string;
+ /** Default value: `14` */
+ "linetoolarrowmarkup.fontsize": number;
+ /** Default value: `false` */
+ "linetoolarrowmarkup.italic": boolean;
+ /** Default value: `true` */
+ "linetoolarrowmarkup.showLabel": boolean;
+}
+export 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}.
+ */
+export 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}.
+ */
+export 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}.
+ */
+export 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}.
+ */
+export 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}.
+ */
+export 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;
+}
+/**
+ * Override properties for the Balloon drawing tool.
+ */
+export interface BalloonLineToolOverrides {
+ /** Default value: `rgba(156, 39, 176, 0.7)` */
+ "linetoolballoon.backgroundColor": string;
+ /** Default value: `rgba(156, 39, 176, 0)` */
+ "linetoolballoon.borderColor": string;
+ /** Default value: `#ffffff` */
+ "linetoolballoon.color": string;
+ /** Default value: `14` */
+ "linetoolballoon.fontsize": number;
+ /** Default value: `30` */
+ "linetoolballoon.transparency": number;
+}
+/**
+ * Bar data point
+ */
+export 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;
+}
+export 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;
+}
+/**
+ * Override properties for the Barspattern drawing tool.
+ */
+export interface BarspatternLineToolOverrides {
+ /** Default value: `#2962FF` */
+ "linetoolbarspattern.color": string;
+ /** Default value: `false` */
+ "linetoolbarspattern.flipped": boolean;
+ /** Default value: `false` */
+ "linetoolbarspattern.mirrored": boolean;
+ /** Default value: `0` */
+ "linetoolbarspattern.mode": number;
+}
+export interface BaseInputFieldValidatorResult {
+ /** Is the base input value valid */
+ valid: boolean;
+}
+export 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;
+ /**
+ * 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;
+}
+/**
+ * Override properties for the Beziercubic drawing tool.
+ */
+export interface BeziercubicLineToolOverrides {
+ /** Default value: `rgba(103, 58, 183, 0.2)` */
+ "linetoolbeziercubic.backgroundColor": string;
+ /** Default value: `false` */
+ "linetoolbeziercubic.extendLeft": boolean;
+ /** Default value: `false` */
+ "linetoolbeziercubic.extendRight": boolean;
+ /** Default value: `false` */
+ "linetoolbeziercubic.fillBackground": boolean;
+ /** Default value: `0` */
+ "linetoolbeziercubic.leftEnd": number;
+ /** Default value: `#673ab7` */
+ "linetoolbeziercubic.linecolor": string;
+ /** Default value: `0` */
+ "linetoolbeziercubic.linestyle": number;
+ /** Default value: `2` */
+ "linetoolbeziercubic.linewidth": number;
+ /** Default value: `0` */
+ "linetoolbeziercubic.rightEnd": number;
+ /** Default value: `80` */
+ "linetoolbeziercubic.transparency": number;
+}
+/**
+ * Override properties for the Bezierquadro drawing tool.
+ */
+export interface BezierquadroLineToolOverrides {
+ /** Default value: `rgba(41, 98, 255, 0.2)` */
+ "linetoolbezierquadro.backgroundColor": string;
+ /** Default value: `false` */
+ "linetoolbezierquadro.extendLeft": boolean;
+ /** Default value: `false` */
+ "linetoolbezierquadro.extendRight": boolean;
+ /** Default value: `false` */
+ "linetoolbezierquadro.fillBackground": boolean;
+ /** Default value: `0` */
+ "linetoolbezierquadro.leftEnd": number;
+ /** Default value: `#2962FF` */
+ "linetoolbezierquadro.linecolor": string;
+ /** Default value: `0` */
+ "linetoolbezierquadro.linestyle": number;
+ /** Default value: `2` */
+ "linetoolbezierquadro.linewidth": number;
+ /** Default value: `0` */
+ "linetoolbezierquadro.rightEnd": number;
+ /** Default value: `50` */
+ "linetoolbezierquadro.transparency": number;
+}
+/**
+ * Overrides for the 'Bollinger Bands %B' indicator.
+ *
+ * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}.
+ */
+export 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}.
+ */
+export 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}.
+ */
+export 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;
+}
+/**
+ * An object that contains information about a bracket order.
+ */
+export interface BracketOrder extends BracketOrderBase, CustomFields {
+}
+export interface BracketOrderBase extends PlacedOrderBase {
+ /** If an order is a bracket, it should contain an ID of a parent order/position. */
+ parentId: string;
+ /** Type of the bracket's parent. */
+ parentType: ParentType;
+}
+export interface Brackets {
+ /** Stop loss */
+ stopLoss?: number;
+ /** Guaranteed Stop */
+ guaranteedStop?: number;
+ /** Take Profit */
+ takeProfit?: number;
+ /** Trailing Stop Pips */
+ trailingStopPips?: number;
+}
+export interface BrokerConfigFlags {
+ /**
+ * Changes _Amount_ to _Quantity_ in Order Ticket.
+ * @default false
+ */
+ showQuantityInsteadOfAmount?: boolean;
+ /**
+ * Enables order brackets: take-profit and stop-loss.
+ * @default false
+ */
+ supportOrderBrackets?: boolean;
+ /**
+ * Enables stop loss orders. If this flag is set to `true`, the library displays stop loss orders and a user can place a stop loss order using the Order Ticket.
+ * If you set this flag to `false`, the {@link BrokerConfigFlags.supportTrailingStop} and/or {@link BrokerConfigFlags.supportGuaranteedStop} flag should be set to `true`.
+ * If the `supportStopLoss`, `supportTrailingStop`, and `supportGuaranteedStop` flags are set to `false`, the default value will be used.
+ * @default true
+ */
+ supportStopLoss?: boolean;
+ /**
+ * Enables trailing stop orders.
+ * If you set this flag to `true`, the library displays trailing stop orders and a user can place a trailing stop order using the Order Ticket.
+ * @default false
+ */
+ supportTrailingStop?: boolean;
+ /**
+ * Enables guaranteed stop loss orders.
+ * If you set this flag to `true`, the library displays guaranteed stop orders and a user can place a guaranteed stop order using the Order Ticket.
+ * @default false
+ */
+ supportGuaranteedStop?: boolean;
+ /**
+ * Enables [positions](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions).
+ * This flag requires the [`positions`](https://www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.IBrokerTerminal#positions) method to be implemented.
+ * If you set `supportPositions` to `false`, the _Positions_ tab in the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/) will be hidden.
+ * @default true
+ */
+ supportPositions?: boolean;
+ /**
+ * Enables position brackets: take-profit and stop-loss orders.
+ * If you set `supportPositionBrackets` to `true`, the library displays an _Edit_ button for positions and _Edit position..._ in the position's context menu.
+ * This flag requires the {@link IBrokerTerminal.editPositionBrackets} method to be implemented.
+ * @default false
+ */
+ supportPositionBrackets?: boolean;
+ /**
+ * Enables brackets for individual positions: take-profit and stop-loss orders.
+ * If you set this flag to `true`, the library displays an _Edit_ button for individual positions and _Edit position..._ in the individual position's context menu.
+ * This flag requires the {@link IBrokerTerminal.editIndividualPositionBrackets} method to be implemented.
+ * @default false
+ */
+ supportIndividualPositionBrackets?: boolean;
+ /**
+ * Enables [position netting](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#position-netting).
+ * This flag requires the [`positions`](https://www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.IBrokerTerminal#positions) and [`individualPositions`](https://www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.IBrokerTerminal#individualpositions) method to be implemented.
+ *
+ * If you set this flag to `true`, the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/) will have two tabs: _Individual Positions_ and _Net Positions_.
+ *
+ * @default false
+ */
+ supportPositionNetting?: boolean;
+ /**
+ * Enables [position closing](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#close-positions).
+ * - If `supportClosePosition` is set to `false`, positions are closed using [market orders](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/orders#order-types) of the opposite side. The library calls the {@link IBrokerTerminal.placeOrder} method, passing the `isClose` property set to `true` in the `PreOrder` object.
+ * - If `supportClosePosition` is set to `true`, the library calls the {@link IBrokerTerminal.closePosition} method.
+ * @default false
+ */
+ supportClosePosition?: boolean;
+ /**
+ * Enables individual [position closing](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#close-positions).
+ * This flag requires the {@link IBrokerTerminal.closeIndividualPosition} method to be implemented.
+ * @default false
+ */
+ supportCloseIndividualPosition?: boolean;
+ /**
+ * Enables order price editing.
+ * If you set this flag to `false`, the price control in the _Order Ticket_ will be disabled when users modify orders.
+ * @default true
+ */
+ supportModifyOrderPrice?: boolean;
+ /**
+ * Enables order quantity editing.
+ * If you set this flag to `false`, the quantity control in the _Order Ticket_ will be disabled when users modify orders.
+ * @default true
+ */
+ supportEditAmount?: boolean;
+ /**
+ * Enables order brackets editing.
+ * If you set this flag to `false`, the bracket's control in the Order Ticket will be disabled,
+ * and the _Modify_ button will be hidden from the chart and in the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/).
+ * @default true
+ */
+ supportModifyBrackets?: boolean;
+ /**
+ * Enables Level 2 data for the [Depth of Market](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/depth-of-market) widget.
+ * This flag requires the [`subscribeDepth`](https://www.tradingview.com/charting-library-docs/latest/connecting_data/datafeed-api/trading-platform-methods#subscribedepth) and [`unsubscribeDepth`](https://www.tradingview.com/charting-library-docs/latest/connecting_data/datafeed-api/trading-platform-methods#unsubscribedepth) methods to be implemented.
+ * @default false
+ */
+ supportLevel2Data?: boolean;
+ /**
+ * Enables [multiple positions](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#multiposition) for one instrument at the same time.
+ *
+ * Note that if the flag is set to `true`:
+ * - The [default reversal](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#default-reversal) in the library does not work. You need to implement the [native reversal](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#native-reversal) on your backend side.
+ * - The _Flatten_ button in the [Depth of Market](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/depth-of-market) widget will be disabled.
+ * @default false
+ */
+ supportMultiposition?: boolean;
+ /**
+ * Allows using your own [profit and loss](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#provide-profit-and-loss) (P&L) values for positions.
+ * By default, `supportPLUpdate` is set to `true`, which means:
+ * - You should calculate the P&L value for a position on your backend server.
+ * - Once calculated, call the {@link IBrokerConnectionAdapterHost.plUpdate} method to provide the library with updated values.
+ * - If [position netting](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#position-netting) is enabled, you should also call {@link IBrokerConnectionAdapterHost.individualPositionPLUpdate}.
+ *
+ * If `supportPLUpdate` is set to `false`, the library automatically calculates P&L values as the difference between the current trade and the average position price.
+ * However, we recommend using your own P&L calculations for positions.
+ * This helps avoid any discrepancies between the P&L values of the account and positions due to potential delays.
+ * @default true
+ */
+ supportPLUpdate?: boolean;
+ /**
+ * Enables [position reversing](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#reverse-positions).
+ * If `supportReversePosition` is set to `false`, the _Reverse Position_ button will be hidden from the UI.
+ * @default false
+ */
+ supportReversePosition?: boolean;
+ /**
+ * Enables [native](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#native-reversal) position reversing. You should implement the {@link IBrokerTerminal.reversePosition} method to process reversing on your backend side.
+ * Note that the {@link supportReversePosition} flag should be set to `true` to enable the reverse option in the UI.
+ *
+ * If `supportNativeReversePosition` is set to `false`, the library handles reversing using the built-in mechanism. For more information, refer to the [Default reversal](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#default-reversal) section.
+ * @default false
+ */
+ supportNativeReversePosition?: boolean;
+ /**
+ * Enables market orders type in the Order Ticket.
+ * @default true
+ */
+ supportMarketOrders?: boolean;
+ /**
+ * Enables limit orders type in the Order Ticket.
+ * @default true
+ */
+ supportLimitOrders?: boolean;
+ /**
+ * Enables stop orders type in the Order Ticket.
+ * @default true
+ */
+ supportStopOrders?: boolean;
+ /**
+ * Enables stop-limit orders type in the Order Ticket.
+ * @default false
+ */
+ supportStopLimitOrders?: boolean;
+ /**
+ * Enables demo live switcher.
+ * @default true
+ */
+ supportDemoLiveSwitcher?: boolean;
+ /**
+ * Enables brackets for market orders.
+ * @default true
+ */
+ supportMarketBrackets?: boolean;
+ /**
+ * Enables symbol searching.
+ * @default false
+ */
+ supportSymbolSearch?: boolean;
+ /**
+ * Allows modifying existing [order duration](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket#enable-time-in-force-menu).
+ * @default false
+ */
+ supportModifyDuration?: boolean;
+ /**
+ * Allows modifying trailing stop orders.
+ * @default true
+ */
+ supportModifyTrailingStop?: boolean;
+ /**
+ * Allows margin.
+ * If `supportMargin` is set to `true`, you should call {@link IBrokerConnectionAdapterHost.marginAvailableUpdate} when the Trading Platform subscribes to margin available updates using {@link IBrokerTerminal.subscribeMarginAvailable}.
+ * @default false
+ */
+ supportMargin?: boolean;
+ /**
+ * Allows providing the estimated commission, fees, margin, and other order information before placing the order without actually placing it.
+ * This information will be displayed in the _Order confirmation_ dialog.
+ *
+ * This flag requires the {@link IBrokerTerminal.previewOrder} method to be implemented and `confirmId` parameter to be passed in the {@link IBrokerTerminal.placeOrder} method.
+ * Refer to [Enable order preview](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket#add-custom-fields) for more information.
+ * @default false
+ */
+ supportPlaceOrderPreview?: boolean;
+ /**
+ * Allows providing the estimated commission, fees, margin, and other order information before modifying the order without actually modifying it.
+ * This information will be displayed in the _Order confirmation_ dialog.
+ *
+ * This flag requires the {@link IBrokerTerminal.previewOrder} method to be implemented and `confirmId` parameter to be passed in the {@link IBrokerTerminal.modifyOrder} method.
+ * Refer to [Enable order preview](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket#add-custom-fields) for more information.
+ * @default false
+ */
+ supportModifyOrderPreview?: boolean;
+ /**
+ * Enables trading with leverage.
+ * If the flag is set to `true`, you should calculate the leverage using the {@link IBrokerTerminal.leverageInfo} method.
+ * @default false
+ */
+ supportLeverage?: boolean;
+ /**
+ * Displays a leverage button in the UI.
+ * Note that you should also enable the {@link BrokerConfigFlags.supportLeverage} flag.
+ * If `supportLeverageButton` is set to `true`, the leverage input field appears in the Order Ticket.
+ * Clicking the input field activates a dedicated Leverage Dialog.
+ * @default true
+ */
+ supportLeverageButton?: boolean;
+ /**
+ * Enables orders history.
+ * If `supportOrdersHistory` is set to `true`, the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/) will have an additional tab: _Orders History_.
+ * This flag requires the [`ordersHistory`](https://www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.IBrokerTerminal#ordershistory) method to be implemented.
+ * The method should return a list of orders with the `filled`, `cancelled`, and `rejected` statuses from previous trade sessions.
+ * @default false
+ */
+ supportOrdersHistory?: boolean;
+ /**
+ * Enables adding brackets to the existing order.
+ * @default true
+ */
+ supportAddBracketsToExistingOrder?: boolean;
+ /**
+ * Allows getting crypto balances for an account.
+ * Balances are displayed as the first table of the _Account Summary_ tab.
+ * Use the flag for crypto currencies only.
+ * This flag requires the {@link IBrokerConnectionAdapterHost.cryptoBalanceUpdate} method to be implemented.
+ * @default false
+ */
+ supportBalances?: boolean;
+ /**
+ * Closing a position cancels its brackets.
+ * @default false
+ */
+ closePositionCancelsOrders?: boolean;
+ /**
+ * `Stop Loss` and `Take Profit` are added or removed only together.
+ * @default false
+ */
+ supportOnlyPairPositionBrackets?: boolean;
+ /**
+ * Enables cryptocurrency trading (exchanging).
+ * This flag switches the Order Ticket to Crypto Exchange mode,
+ * which provides additional controls for entering the quantity in either the base or quote currency.
+ * @default false
+ */
+ supportCryptoExchangeOrderTicket?: boolean;
+ /**
+ * Enables displaying Profit & Loss values in instrument currency.
+ * @default false
+ */
+ positionPLInInstrumentCurrency?: boolean;
+ /**
+ * Enables [partial position closing](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#partial-closing).
+ * This flag requires the {@link IBrokerTerminal.closePosition} method to be implemented.
+ * @default false
+ */
+ supportPartialClosePosition?: boolean;
+ /**
+ * Enables [partial individual position closing](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#partial-closing).
+ * This flag requires the {@link IBrokerTerminal.closeIndividualPosition} method to be implemented.
+ * @default false
+ */
+ supportPartialCloseIndividualPosition?: boolean;
+ /**
+ * Modifies the confirmation dialog text for closing a bracket order.
+ * When set to `true`, the text explicitly states that cancelling a bracket order will also cancel its associated pair.
+ * When set to `false`, the text will include the ID of the singular bracket order being cancelled.
+ *
+ * Note that the library does not cancel orders itself.
+ * You should implement the {@link IBrokerTerminal.cancelOrder} or {@link IBrokerTerminal.cancelOrders } method.
+ * @default false
+ */
+ supportCancellingBothBracketsOnly?: boolean;
+ /**
+ * Enables crypto brackets.
+ * @default false
+ */
+ supportCryptoBrackets?: boolean;
+ /**
+ * Enables the _Notifications log_ tab in the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/).
+ * @default true
+ */
+ showNotificationsLog?: boolean;
+ /**
+ * Whether stop orders should behave like Market-if-Touched in both directions.
+ * Enabling this flag prevents the check of stop price direction from the stop limit Order Ticket.
+ * @default false
+ */
+ supportStopOrdersInBothDirections?: boolean;
+ /**
+ * Whether stop-limit orders should behave like Limit-if-Touched in both directions.
+ * Enabling this flag prevents the check of stop price direction from the stop limit Order Ticket.
+ */
+ supportStopLimitOrdersInBothDirections?: boolean;
+ /**
+ * Whether the integration supports limit price validation in the order ticket to eliminate the possibility to place
+ * an order on the wrong side of the market that will most likely trigger and get filled immediately.
+ */
+ supportStrictCheckingLimitOrderPrice?: boolean;
+ /**
+ * If set to `true`, executions are displayed on the chart.
+ * This flag requires the [`executions`](https://www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.IBrokerTerminal#executions) method to be implemented.
+ * @default false
+ */
+ supportExecutions?: boolean;
+ /**
+ * Allows modifying order type.
+ * @default false
+ */
+ supportModifyOrderType?: boolean;
+ /**
+ * Enables closing of individual positions in FIFO order.
+ * @default false
+ */
+ requiresFIFOCloseIndividualPositions?: boolean;
+ /**
+ * Allows brokers to add their own parameters that will be displayed in Order info.
+ * @default false
+ */
+ supportCustomOrderInfo?: boolean;
+}
+export interface BrokerCustomUI {
+ /**
+ * Shows Order Ticket to create or modify an order and executes handler if Buy/Sell/Modify is pressed.
+ * @param {OrderTemplate|Order} order - order to be placed or modified
+ * @param {OrderTicketFocusControl} [focus] - Control to focus on when dialog is opened
+ */
+ showOrderDialog?: (order: OrderTemplate | Order, focus?: OrderTicketFocusControl) => Promise;
+ /**
+ * Shows the Position Dialog
+ * @param {Position|IndividualPosition} position - position to be placed or modified
+ * @param {Brackets} brackets - brackets for the position
+ * @param {OrderTicketFocusControl} [focus] - Control to focus on when dialog is opened
+ */
+ showPositionDialog?: (position: Position | IndividualPosition, brackets: Brackets, focus?: OrderTicketFocusControl) => Promise;
+ /**
+ * Shows a confirmation dialog and executes handler if YES/OK is pressed.
+ * @param {Order} order - order to be cancelled
+ */
+ showCancelOrderDialog?: (order: Order) => Promise;
+ /**
+ * Shows the Close Position Dialog.
+ * @param {Position|IndividualPosition} position - position to be closed
+ */
+ showClosePositionDialog?: (position: Position | IndividualPosition) => Promise;
+ /**
+ * Shows the Reverse Position Dialog.
+ * @param {Position} position - position to be reversed
+ */
+ showReversePositionDialog?: (position: Position) => Promise;
+}
+/**
+ * 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.
+ */
+export 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.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;
+ "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.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;
+}
+/**
+ * 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.
+ */
+export 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.normal.text.activeColor": 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;
+ "buy.disabled.text.activeColor": 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.normal.text.activeColor": 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;
+ "sell.disabled.text.activeColor": string;
+}
+/**
+ * Override properties for the Brush drawing tool.
+ */
+export interface BrushLineToolOverrides {
+ /** Default value: `#00bcd4` */
+ "linetoolbrush.backgroundColor": string;
+ /** Default value: `false` */
+ "linetoolbrush.fillBackground": boolean;
+ /** Default value: `0` */
+ "linetoolbrush.leftEnd": number;
+ /** Default value: `#00bcd4` */
+ "linetoolbrush.linecolor": string;
+ /** Default value: `2` */
+ "linetoolbrush.linewidth": number;
+ /** Default value: `0` */
+ "linetoolbrush.rightEnd": number;
+ /** Default value: `5` */
+ "linetoolbrush.smooth": number;
+ /** Default value: `50` */
+ "linetoolbrush.transparency": number;
+}
+/**
+ * Override properties for the Callout drawing tool.
+ */
+export interface CalloutLineToolOverrides {
+ /** Default value: `rgba(0, 151, 167, 0.7)` */
+ "linetoolcallout.backgroundColor": string;
+ /** Default value: `false` */
+ "linetoolcallout.bold": boolean;
+ /** Default value: `#0097A7` */
+ "linetoolcallout.bordercolor": string;
+ /** Default value: `#ffffff` */
+ "linetoolcallout.color": string;
+ /** Default value: `14` */
+ "linetoolcallout.fontsize": number;
+ /** Default value: `false` */
+ "linetoolcallout.italic": boolean;
+ /** Default value: `2` */
+ "linetoolcallout.linewidth": number;
+ /** Default value: `50` */
+ "linetoolcallout.transparency": number;
+ /** Default value: `false` */
+ "linetoolcallout.wordWrap": boolean;
+ /** Default value: `200` */
+ "linetoolcallout.wordWrapWidth": number;
+}
+export 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}.
+ */
+export 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}.
+ */
+export 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}.
+ */
+export 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}.
+ */
+export 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}.
+ */
+export 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;
+}
+export interface ChangeAccountSolution {
+ /** id of a sub-account suitable for trading the symbol */
+ changeAccount: AccountId;
+}
+export interface ChangeSymbolSolution {
+ /** the symbol suitable for trading with current sub-account */
+ changeSymbol: string;
+}
+export interface ChangeThemeOptions {
+ /** Disable undo for the theme change */
+ disableUndo: boolean;
+}
+/**
+ * Saved chart data
+ */
+export interface ChartData {
+ /** unique ID of the chart (may be `undefined` if it wasn't saved before) */
+ id?: string | number;
+ /** name of the chart */
+ name: string;
+ /** symbol of the chart */
+ symbol: string;
+ /** resolution of the chart */
+ resolution: ResolutionString;
+ /** content of the chart */
+ content: string;
+ /** UNIX time when the chart was last modified. Date and time will be displayed in the Load layout dialog. */
+ timestamp: number;
+}
+export interface ChartDescriptionContext {
+ /** Style of chart */
+ chartType: SeriesType;
+ /** Name of chart style */
+ chartTypeName: string;
+ /** Symbol's description from the Symbol Info */
+ description?: string;
+ /** Symbol identifier, typically the symbols ticker or name defined in the Symbol Info */
+ symbol: string;
+ /** Symbol's exchange */
+ exchange?: string;
+ /** Symbol's ticker identifier */
+ ticker?: string;
+ /** Visible time range */
+ visibleRange: VisibleTimeRange;
+ /** Visible data. Only included if [aria_detailed_chart_descriptions](https://www.tradingview.com/charting-library-docs/latest/customization/Featuresets#aria_detailed_chart_descriptions) featureset is enabled */
+ visibleData?: ExportedData;
+ /** The complete Symbol Info for the chart's main series */
+ symbolInfo: LibrarySymbolInfo | null;
+ /** Index of the current chart within a multi-chart layout */
+ chartIndex: number;
+ /** Number of visible charts in the current layout */
+ chartCount: number;
+ /** Symbol's default price formatter */
+ priceFormatter: ISymbolValueFormatter;
+ /** Resolution (interval) of the chart */
+ interval: ResolutionString;
+ /** Is the resolution (interval) intraday */
+ isIntraday: boolean;
+}
+/**
+ * Meta information about a saved chart
+ */
+export interface ChartMetaInfo {
+ /** unique ID of the chart. */
+ id: number | string;
+ /** name of the chart */
+ name: string;
+ /** symbol of the chart */
+ symbol: string;
+ /** resolution of the chart */
+ resolution: ResolutionString;
+ /** UNIX time when the chart was last modified */
+ timestamp: number;
+}
+/**
+ * Property overrides that can be used with {@link IChartingLibraryWidget.applyOverrides}.
+ */
+export 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.
+ *
+ * @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;
+ /**
+ * 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/core_concepts/Resolution#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/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 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;
+}
+/**
+ * A chart template.
+ */
+export interface ChartTemplate {
+ /**
+ * The template content.
+ */
+ content?: ChartTemplateContent;
+}
+/**
+ * Chart template content. The properties of the chart that are saved/loaded when the library saves/loads a chart template.
+ */
+export interface ChartTemplateContent {
+ [key: string]: any;
+ /**
+ * Chart properties (for example color, etc).
+ */
+ chartProperties?: {
+ /**
+ * Chart pane properties.
+ */
+ paneProperties: any;
+ /**
+ * Chart scales properties.
+ */
+ scalesProperties: any;
+ };
+ /**
+ * Series properties (for example chart style, etc).
+ */
+ mainSourceProperties?: any;
+ /**
+ * The version of the chart template.
+ */
+ version?: number;
+}
+export interface ChartingLibraryWidgetConstructor {
+ /**
+ * Constructor for the Advanced Charts Widget
+ * @param {ChartingLibraryWidgetOptions|TradingTerminalWidgetOptions} options - Constructor options
+ */
+ new (options: ChartingLibraryWidgetOptions | TradingTerminalWidgetOptions): IChartingLibraryWidget;
+}
+export interface ChartingLibraryWidgetOptions {
+ /**
+ * The `container` can either be a reference to an attribute of a DOM element inside which the iframe with the chart will be placed or the `HTMLElement` itself.
+ *
+ * ```javascript
+ * container: "tv_chart_container",
+ * ```
+ *
+ * or
+ *
+ * ```javascript
+ * container: document.getElementById("tv_chart_container"),
+ * ```
+ */
+ container: HTMLElement | string;
+ /**
+ * JavaScript object that implements the datafeed interface ({@link IBasicDataFeed}) to supply the chart with data. See [Connecting Data](https://www.tradingview.com/charting-library-docs/latest/connecting_data/) for more information on the JS API.
+ *
+ * ```javascript
+ * datafeed: new Datafeeds.UDFCompatibleDatafeed("https://demo_feed.tradingview.com")
+ * ```
+ */
+ datafeed: IBasicDataFeed | (IBasicDataFeed & IDatafeedQuotesApi);
+ /**
+ * The default interval for the chart.
+ *
+ * Example:
+ * ```javascript
+ * interval: '1D',
+ * ```
+ */
+ interval: ResolutionString;
+ /**
+ * The default symbol for the chart.
+ *
+ * Example:
+ * ```javascript
+ * symbol: 'AAPL',
+ * ```
+ */
+ symbol?: string;
+ /**
+ * A threshold delay in seconds that is used to reduce the number of `onAutoSaveNeeded` calls.
+ *
+ * ```javascript
+ * auto_save_delay: 5,
+ * ```
+ */
+ auto_save_delay?: number;
+ /**
+ * Boolean value showing whether the chart should use all the available space in the container and resize when the container itself is resized.
+ * @default false
+ *
+ * ```javascript
+ * autosize: true,
+ * ```
+ */
+ autosize?: boolean;
+ /**
+ * Setting this property to `true` makes the library write detailed [Datafeed API](https://www.tradingview.com/charting-library-docs/latest/connecting_data/datafeed-api/) logs into the browser console.
+ * Alternatively, you can use the [`charting_library_debug_mode`](https://www.tradingview.com/charting-library-docs/latest/customization/Featuresets#charting_library_debug_mode) featureset or the {@link IChartingLibraryWidget.setDebugMode} method.
+ *
+ * ```javascript
+ * debug: true,
+ * ```
+ */
+ debug?: boolean;
+ /**
+ * The array containing names of features that should be disabled by default. `Feature` means part of the functionality of the chart (part of the UI/UX). Supported features are listed in [Featuresets](https://www.tradingview.com/charting-library-docs/latest/customization/Featuresets).
+ *
+ * Example:
+ * ```javascript
+ * disabled_features: ["header_widget", "left_toolbar"],
+ * ```
+ */
+ disabled_features?: ChartingLibraryFeatureset[];
+ /**
+ * You can hide some drawings from the toolbar or add custom restrictions for applying them to the chart.
+ *
+ * This property has the same structure as the `studies_access` argument. Use the same names as you see in the UI.
+ *
+ * **Remark**: There is a special case for font-based drawings. Use the "Font Icons" name for them.
+ * Those drawings cannot be enabled or disabled separately - the entire group will have to be either enabled or disabled.
+ *
+ * @example
+ * ```javascript
+ * drawings_access: {
+ * type: 'black',
+ * tools: [
+ * {
+ * name: 'Trend Line',
+ * grayed: true
+ * },
+ * ]
+ * },
+ * ```
+ */
+ drawings_access?: AccessList;
+ /**
+ * The array containing names of features that should be enabled by default. `Feature` means part of the functionality of the chart (part of the UI/UX). Supported features are listed in [Featuresets](https://www.tradingview.com/charting-library-docs/latest/customization/Featuresets).
+ *
+ * Example:
+ * ```javascript
+ * enabled_features: ["move_logo_to_main_pane"],
+ * ```
+ */
+ enabled_features?: ChartingLibraryFeatureset[];
+ /**
+ * Boolean value showing whether the chart should use all the available space in the window.
+ * @default false
+ *
+ * ```javascript
+ * fullscreen: true,
+ * ```
+ */
+ fullscreen?: boolean;
+ /**
+ * A path to a `static` folder.
+ *
+ * ```javascript
+ * library_path: "charting_library/",
+ * ```
+ *
+ * * If you would like to host the library on a separate origin to the page containing the chart then please view the following guide: [Hosting the library on a separate origin](https://www.tradingview.com/charting-library-docs/latest/getting_started/Hosting-Library-Cross-Origin).
+ */
+ library_path?: string;
+ /**
+ * Locale to be used by the library. See [Localization](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Localization) section for details.
+ *
+ * ```javascript
+ * locale: 'en',
+ * ```
+ */
+ locale: LanguageCode;
+ /**
+ * The object containing formatting options for numbers. The only possible option is `decimal_sign` currently.
+ *
+ * ```javascript
+ * numeric_formatting: { decimal_sign: "," },
+ * ```
+ */
+ numeric_formatting?: NumericFormattingParams;
+ /**
+ * JS object containing saved chart content.
+ * Use this parameter when creating the widget if you have a saved chart already.
+ * If you want to load the chart content when the chart is initialized then use `load()` method ({@link IChartingLibraryWidget.load}) of the widget.
+ */
+ saved_data?: object;
+ /**
+ * JS object containing saved chart content meta info.
+ */
+ saved_data_meta_info?: SavedStateMetaInfo;
+ /**
+ * You can hide some studies from the toolbar or add custom restrictions for applying them to the chart.
+ *
+ * @example
+ * ```javascript
+ * studies_access: {
+ * type: "black" | "white",
+ * tools: [
+ * {
+ * name: "",
+ * grayed: true
+ * },
+ * < ... >
+ * ]
+ * }
+ * ```
+ */
+ studies_access?: AccessList;
+ /**
+ * Maximum amount of studies allowed at one time within the layout. Minimum value is 2.
+ *
+ * ```javascript
+ * study_count_limit: 5,
+ * ```
+ */
+ study_count_limit?: number;
+ /**
+ * A threshold delay in milliseconds that is used to reduce the number of search requests when the user enters the symbol name in the [Symbol Search](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Symbol-Search).
+ *
+ * ```javascript
+ * symbol_search_request_delay: 1000,
+ * ```
+ */
+ symbol_search_request_delay?: number;
+ /**
+ * Sets the default time frame of the chart.
+ *
+ * The time frame can be relative to the current date, or a range.
+ *
+ * A relative time frame is a number with a letter D for days and M for months:
+ *
+ * ```javascript
+ * timeframe: '3M',
+ * ```
+ *
+ * A range is an object with to and from properties. The to and from properties should be UNIX timestamps:
+ *
+ * ```javascript
+ * timeframe: { from: 1640995200, to: 1643673600 } // from 2022-01-01 to 2022-02-01
+ * ```
+ *
+ * **Note**:
+ * When using a range the chart will still request data up to the current date. This is to enable scrolling forward in time once the chart has loaded.
+ */
+ timeframe?: TimeframeOption;
+ /**
+ * Default time zone of the chart. The time on the timescale is displayed according to this time zone.
+ * See the [list of supported time zones](https://www.tradingview.com/charting-library-docs/latest/ui_elements/timezones#supported-time-zones) for available values. Set it to `exchange` to use the exchange time zone. Use the {@link ChartingLibraryWidgetOptions.overrides} section if you wish to override the default value.
+ *
+ * ```javascript
+ * timezone: "America/New_York",
+ * ```
+ */
+ timezone?: "exchange" | Timezone;
+ /**
+ * Background color of the toolbars.
+ *
+ * ```javascript
+ * toolbar_bg: '#f4f7f9',
+ * ```
+ */
+ toolbar_bg?: string;
+ /**
+ * The desired width of a widget. Please make sure that there is enough space for the widget to be displayed correctly.
+ *
+ * ```javascript
+ * width: 300,
+ * ```
+ *
+ * **Remark**: If you want the chart to use all the available space use the `fullscreen` parameter instead of setting it to '100%'.
+ */
+ width?: number;
+ /**
+ * The desired height of a widget. Please make sure that there is enough space for the widget to be displayed correctly.
+ *
+ * ```javascript
+ * height: 600,
+ * ```
+ *
+ * **Remark**: If you want the chart to use all the available space use the `fullscreen` parameter instead of setting it to '100%'.
+ */
+ height?: number;
+ /**
+ * Set the storage URL endpoint for use with the high-level saving/loading chart API.
+ * Refer to [Save and load REST API](https://www.tradingview.com/charting-library-docs/latest/saving_loading/save-load-rest-api/) for more information.
+ *
+ * ```javascript
+ * charts_storage_url: 'http://storage.yourserver.com',
+ * ```
+ */
+ charts_storage_url?: string;
+ /**
+ * A version of your backend. Supported values are: `"1.0"` | `"1.1"`. Study Templates are supported starting from version `"1.1"`.
+ *
+ * ```javascript
+ * charts_storage_api_version: "1.1",
+ * ```
+ */
+ charts_storage_api_version?: AvailableSaveloadVersions;
+ /**
+ * Set the client ID for the high-level saving / loading charts API.
+ * Refer to [Saving and Loading Charts](https://www.tradingview.com/charting-library-docs/latest/saving_loading/) for more information.
+ *
+ * ```javascript
+ * client_id: 'yourserver.com',
+ * ```
+ */
+ client_id?: string;
+ /**
+ * Set the user ID for the high-level saving / loading charts API.
+ * Refer to [Saving and Loading Charts](https://www.tradingview.com/charting-library-docs/latest/saving_loading/) for more information.
+ *
+ * ```javascript
+ * user_id: 'public_user_id',
+ * ```
+ */
+ user_id?: string;
+ /**
+ * Set this parameter to `true` if you want the library to load the last saved chart for a user. You should implement [save/load](https://www.tradingview.com/charting-library-docs/latest/saving_loading/) first to make it work.
+ *
+ * Note that the {@link symbol} property takes precedence over `load_last_chart`. If `symbol` is specified, its value is displayed on the chart instead of the saved symbol. To avoid this issue, consider removing the `symbol` property when `load_last_chart` is enabled.
+ *
+ * ```javascript
+ * load_last_chart: true,
+ * ```
+ */
+ load_last_chart?: boolean;
+ /**
+ * Use this option to customize the style or inputs of the indicators.
+ * You can also customize the styles and inputs of the `Compare` series using this argument.
+ * Refer to [Indicator Overrides](https://www.tradingview.com/charting-library-docs/latest/customization/overrides/indicator-overrides#specify-default-properties) for more information.
+ * Overrides for built-in indicators are listed in {@link StudyOverrides}.
+ *
+ * ```javascript
+ * studies_overrides: {
+ * "volume.volume.color.0": "#00FFFF",
+ * },
+ * ```
+ */
+ studies_overrides?: Partial;
+ /**
+ * Custom formatters for adjusting the display format of price, date, and time values.
+ *
+ * Example:
+ *
+ * ```javascript
+ * custom_formatters: {
+ * timeFormatter: {
+ * format: (date) => {
+ * const _format_str = '%h:%m';
+ * return _format_str
+ * .replace('%h', date.getUTCHours(), 2)
+ * .replace('%m', date.getUTCMinutes(), 2)
+ * .replace('%s', date.getUTCSeconds(), 2);
+ * }
+ * },
+ * dateFormatter: {
+ * format: (date) => {
+ * return date.getUTCFullYear() + '/' + (date.getUTCMonth() + 1) + '/' + date.getUTCDate();
+ * }
+ * },
+ * tickMarkFormatter: (date, tickMarkType) => {
+ * switch (tickMarkType) {
+ * case 'Year':
+ * return 'Y' + date.getUTCFullYear();
+ *
+ * case 'Month':
+ * return 'M' + (date.getUTCMonth() + 1);
+ *
+ * case 'DayOfMonth':
+ * return 'D' + date.getUTCDate();
+ *
+ * case 'Time':
+ * return 'T' + date.getUTCHours() + ':' + date.getUTCMinutes();
+ *
+ * case 'TimeWithSeconds':
+ * return 'S' + date.getUTCHours() + ':' + date.getUTCMinutes() + ':' + date.getUTCSeconds();
+ * }
+ *
+ * throw new Error('unhandled tick mark type ' + tickMarkType);
+ * },
+ * priceFormatterFactory: (symbolInfo, minTick) => {
+ * if (symbolInfo?.fractional || minTick !== 'default' && minTick.split(',')[2] === 'true') {
+ * return {
+ * format: (price, signPositive) => {
+ * // return the appropriate format
+ * },
+ * };
+ * }
+ * return null; // this is to use default formatter;
+ * },
+ * studyFormatterFactory: (format, symbolInfo) => {
+ * if (format.type === 'price') {
+ * const numberFormat = new Intl.NumberFormat('en-US', { notation: 'scientific' });
+ * return {
+ * format: (value) => numberFormat.format(value)
+ * };
+ * }
+ *
+ * if (format.type === 'volume') {
+ * return {
+ * format: (value) => (value / 1e9).toPrecision(format?.precision || 2) + 'B'
+ * };
+ * }
+ *
+ * if (format.type === 'percent') {
+ * return {
+ * format: (value) => `${value.toPrecision(format?.precision || 4)} percent`
+ * };
+ * }
+ *
+ * return null; // this is to use default formatter;
+ * },
+ * }
+ * ```
+ *
+ * **Remark**: `tickMarkFormatter` must display the UTC date, and not the date corresponding to your local timezone.
+ */
+ custom_formatters?: CustomFormatters;
+ /**
+ * Override values for the default widget properties
+ * You can override most of the properties (which also may be edited by user through UI)
+ * using `overrides` parameter of Widget Constructor. `overrides` is supposed to be an object.
+ * The keys of this object are the names of overridden properties.
+ * The values of these keys are the new values of the properties.
+ *
+ * Example:
+ * ```javascript
+ * overrides: {
+ * "mainSeriesProperties.style": 2
+ * }
+ * ```
+ * This code will change the default series style to "line".
+ * All customizable properties are listed in [separate article](https://www.tradingview.com/charting-library-docs/latest/customization/overrides/Overrides).
+ */
+ overrides?: Partial;
+ /**
+ * This URL is used to send a POST request with binary chart snapshots when a user clicks the [snapshot](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Snapshots) button.
+ * This POST request contains `multipart/form-data` with the field `preparedImage` that represents binary data of the snapshot image in `image/png` format.
+ *
+ * This endpoint should return the full URL of the saved image in the response.
+ *
+ * ```javascript
+ * snapshot_url: "https://myserver.com/snapshot",
+ * ```
+ */
+ snapshot_url?: string;
+ /**
+ * List of visible time frames that can be selected at the bottom of the chart. See [Time frame toolbar](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Time-Scale#time-frame-toolbar) for more information. Time frame is an object containing the following properties:
+ *
+ * Example:
+ *
+ * ```javascript
+ * time_frames: [
+ * { text: "50y", resolution: "6M", description: "50 Years" },
+ * { text: "3y", resolution: "1W", description: "3 Years", title: "3yr" },
+ * { text: "8m", resolution: "1D", description: "8 Month" },
+ * { text: "3d", resolution: "5", description: "3 Days" },
+ * { text: "1000y", resolution: "1W", description: "All", title: "All" },
+ * ]
+ * ```
+ */
+ time_frames?: TimeFrameItem[];
+ /**
+ * Adds your custom CSS to the chart. `url` should be an absolute or relative path to the `static` folder.
+ *
+ * ```javascript
+ * custom_css_url: 'css/style.css',
+ * ```
+ */
+ custom_css_url?: string;
+ /**
+ * Changes the font family used on the chart including the [time scale](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Time-Scale), [price scale](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Price-Scale), and chart's pane.
+ * If you want to customize fonts outside the chart, for example, within [Watchlist](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Watch-List) or another widget,
+ * you should use the {@link ChartingLibraryWidgetOptions.custom_css_url} property to provide custom CSS styles.
+ *
+ * Specify `custom_font_family` in [Widget Constructor](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Widget-Constructor) as follows:
+ *
+ * ```javascript
+ * custom_font_family: "'Inconsolata', monospace",
+ * ```
+ *
+ * The `custom_font_family` value should have the same format as the `font-family` property in CSS.
+ * To use a font that is not available by default on your system, you should first add this font to your [custom CSS](#custom_css_url).
+ * For example, the code sample below imports a Google font into your custom CSS:
+ *
+ * ```css
+ * @import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@500&display=swap');
+ * ```
+ *
+ */
+ custom_font_family?: string;
+ /**
+ * Elements that should be marked as favorites for a new browser or user.
+ * You can use this property to specify default favorite chart types, drawings, indicators, and resolutions.
+ * To do this, assign a {@link Favorites} object to `favorites`. The example of such object is demonstrated below.
+ *
+ * ```javascript
+ * favorites: {
+ * intervals: ["1D", "3D", "3W", "W", "M"],
+ * indicators: ["Awesome Oscillator", "Bollinger Bands"],
+ * drawingTools: ['LineToolBrush', 'LineToolCallout', 'LineToolCircle'],
+ * chartTypes: ['Area', 'Candles'],
+ * },
+ * ```
+ *
+ * To allow users to add/remove items from favorites, enable the [`items_favoriting`](https://www.tradingview.com/charting-library-docs/latest/customization/Featuresets#items_favoriting) featureset.
+ *
+ * Note that favorites saved in [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) take precedence over the ones specified in the `favorites` property.
+ * Therefore, the library tries to load the favorites from `localStorage` first, and then use the elements in `favorites` if there is nothing saved in `localStorage`.
+ * If you want the elements specified within `favorites` to always apply, disable `localStorage` using the [`use_localstorage_for_settings`](https://www.tradingview.com/charting-library-docs/latest/customization/Featuresets#use_localstorage_for_settings) featureset.
+ *
+ * You can also use {@link ChartingLibraryWidgetOptions.settings_adapter} to store favorites. These favorites take precedence over favorites in the `favorites` property and `localStorage`.
+ * Refer to the [Customization precedence](https://www.tradingview.com/charting-library-docs/latest/customization/customization-precedence) article to learn more about the application order of different approaches for changing the chart appearance and behavior.
+ */
+ favorites?: Favorites;
+ /**
+ * An object containing the save/load functions.
+ * It is used to implement a custom save/load algorithm.
+ * Refer to [API handlers](https://www.tradingview.com/charting-library-docs/latest/saving_loading/save-load-adapter) for more information.
+ */
+ save_load_adapter?: IExternalSaveLoadAdapter;
+ /**
+ * Customization of the loading spinner. Value is an object with the following possible keys:
+ *
+ * * `backgroundColor`
+ * * `foregroundColor`
+ *
+ * Example:
+ *
+ * ```javascript
+ * loading_screen: { backgroundColor: "#000000" }
+ * ```
+ */
+ loading_screen?: LoadingScreenOptions;
+ /**
+ * An object that contains set/remove functions. Use it to save [user settings](https://www.tradingview.com/charting-library-docs/latest/saving_loading/user-settings) to your preferred storage, including the server-side one.
+ *
+ * Example:
+ * ```javascript
+ * settings_adapter: {
+ * initialSettings: { ... },
+ * setValue: function(key, value) { ... },
+ * removeValue: function(key) { ... },
+ * }
+ * ```
+ */
+ settings_adapter?: ISettingsAdapter;
+ /**
+ * Set predefined custom theme color for the chart. Supported values are: `"light"` | `"dark"`.
+ *
+ * ```javascript
+ * theme: "light",
+ * ```
+ */
+ theme?: ThemeName;
+ /**
+ * an array of custom compare symbols for the Compare window.
+ *
+ * Example:
+ * ```javascript
+ * compare_symbols: [
+ * { symbol: 'DAL', title: 'Delta Air Lines' },
+ * { symbol: 'VZ', title: 'Verizon' },
+ * ],
+ * ```
+ */
+ compare_symbols?: CompareSymbol[];
+ /**
+ * Function that returns a Promise object with an array of your custom indicators.
+ *
+ * `PineJS` variable will be passed as the first argument of this function and can be used inside your indicators to access internal helper functions.
+ *
+ * Refer to [Custom indicators](https://www.tradingview.com/charting-library-docs/latest/custom_studies/) for more information.
+ *
+ * ```javascript
+ * custom_indicators_getter: function(PineJS) {
+ * return Promise.resolve([
+ * // *** your indicator object, created from the template ***
+ * ]);
+ * },
+ * ```
+ */
+ custom_indicators_getter?: (PineJS: PineJS) => Promise;
+ /**
+ * An optional field containing an array of custom symbol info fields to be shown in the Security Info dialog.
+ *
+ * Refer to [Symbology](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology) for more information about symbol info.
+ *
+ * ```javascript
+ * additional_symbol_info_fields: [
+ * { title: 'Ticker', propertyName: 'ticker' }
+ * ]
+ * ```
+ */
+ additional_symbol_info_fields?: AdditionalSymbolInfoField[];
+ /**
+ * An additional optional field to change the look and feel of buttons on the top toolbar.
+ *
+ * By default (if option is omitted) header will be in adaptive mode (fullsize if the window width allows and icons on smaller windows).
+ *
+ * Example:
+ * ```javascript
+ * header_widget_buttons_mode: 'fullsize',
+ * ```
+ */
+ header_widget_buttons_mode?: HeaderWidgetButtonsMode;
+ /**
+ * Use this property to override the [context menu](https://www.tradingview.com/charting-library-docs/latest/ui_elements/context-menu). You can also change the menu on the fly using the {@link IChartingLibraryWidget.onContextMenu} method.
+ */
+ context_menu?: ContextMenuOptions;
+ /**
+ * An additional optional field to add more bars on screen.
+ *
+ * Example:
+ * ```javascript
+ * time_scale: {
+ * min_bar_spacing: 10,
+ * }
+ * ```
+ */
+ time_scale?: TimeScaleOptions;
+ /**
+ * Use this property to set a custom translation function for UI strings.
+ * It accepts the original text, the singular form of the text, and the translated text as arguments.
+ * The function should return a string with the new translation or `null` to fall back to the default translation.
+ *
+ * The example below shows how to rename the "Trend Line" drawing to "Line Drawing".
+ *
+ * ```javascript
+ * custom_translate_function: (originalText, singularOriginalText, translatedText) => {
+ * if (originalText === "Trend Line") {
+ * return "Line Drawing";
+ * }
+ * return null;
+ * }
+ * ```
+ */
+ custom_translate_function?: CustomTranslateFunction;
+ /**
+ * Use this property to set a function to override the symbol input from the [Symbol Search](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Symbol-Search).
+ *
+ * For example, you may want to get additional input from the user before deciding which symbol should be resolved.
+ *
+ * The function should take two parameters: a `string` of input from the Symbol Search and a optional search result item. It should return a `Promise` that resolves with a symbol ticker and a human-friendly symbol name.
+ *
+ * **NOTE:** This override is not called when adding a symbol to the watchlist.
+ *
+ * ```typescript
+ * {
+ * // `SearchSymbolResultItem` is the same interface as for items returned to the Datafeed's searchSymbols result callback.
+ * symbol_search_complete: (symbol: string, searchResultItem?: SearchSymbolResultItem) => {
+ * return new Promise((resolve) => {
+ * let symbol = getNewSymbol(symbol, searchResultItem);
+ * let name = getHumanFriendlyName(symbol, searchResultItem)
+ * resolve({ symbol: symbol, name: name });
+ * });
+ * }
+ * }
+ * ```
+ */
+ symbol_search_complete?: SymbolSearchCompleteOverrideFunction;
+ /**
+ * The object that contains new values for values saved to the settings.
+ * These overrides will replace any matching values from the settings, regardless of where the settings are loaded from (i.e. local storage or a custom settings adapter).
+ * The object is similar to the [overrides](#overrides) object.
+ *
+ * [overrides](#overrides) will not affect values that have been saved to settings so this option can be used instead.
+ *
+ * ```javascript
+ * settings_overrides: {
+ * "linetooltrendline.linecolor": "blue"
+ * }
+ * ```
+ */
+ settings_overrides?: Overrides;
+ /**
+ * List of custom time zones.
+ *
+ * Refer to [Timezones](https://www.tradingview.com/charting-library-docs/latest/ui_elements/timezones) for more information.
+ */
+ custom_timezones?: CustomAliasedTimezone[];
+ /**
+ * Use this property to set your own chart description function. `context` will be passed to the function.
+ *
+ * This description is read aloud by screen readers when a chart within the layout is selected via the `Tab` key.
+ *
+ * The function should return either a string with a description or `null` to fallback to the default description.
+ *
+ * ```javascript
+ * custom_chart_description_function: (context) => {
+ * return Promise.resolve(`Chart ${context.chartIndex + 1} of ${context.chartCount}. ${context.chartTypeName} chart of ${context.symbol}.`);
+ * }
+ * ```
+ */
+ custom_chart_description_function?: ChartDescriptorFunction;
+ /**
+ * Custom theme colors to override the default light and dark 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.
+ */
+ custom_themes?: CustomThemes;
+ /**
+ * EXPERIMENTAL. Customise the storage of image data for the image drawing tool.
+ *
+ * By default images have no size limit and are saved in the chart layout which may not be suitable, depending on your chart storage implementation.
+ */
+ image_storage_adapter?: IImageStorageAdapter;
+}
+export interface CheckboxFieldMetaInfo extends CustomFieldMetaInfoBase {
+ /** @inheritDoc */
+ inputType: "Checkbox";
+ /** @inheritDoc */
+ value: boolean;
+ /** Does the field support modification */
+ supportModify?: boolean;
+ /** Help message for the field */
+ help?: string;
+}
+/**
+ * Overrides for the 'Chop Zone' indicator.
+ *
+ * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}.
+ */
+export 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}.
+ */
+export 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;
+}
+/**
+ * Override properties for the Circle drawing tool.
+ */
+export interface CircleLineToolOverrides {
+ /** Default value: `rgba(255, 152, 0, 0.2)` */
+ "linetoolcircle.backgroundColor": string;
+ /** Default value: `false` */
+ "linetoolcircle.bold": boolean;
+ /** Default value: `#FF9800` */
+ "linetoolcircle.color": string;
+ /** Default value: `true` */
+ "linetoolcircle.fillBackground": boolean;
+ /** Default value: `14` */
+ "linetoolcircle.fontSize": number;
+ /** Default value: `false` */
+ "linetoolcircle.italic": boolean;
+ /** Default value: `2` */
+ "linetoolcircle.linewidth": number;
+ /** Default value: `false` */
+ "linetoolcircle.showLabel": boolean;
+ /** Default value: `#FF9800` */
+ "linetoolcircle.textColor": string;
+}
+export 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;
+}
+export 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;
+}
+/**
+ * Override properties for the Comment drawing tool.
+ */
+export interface CommentLineToolOverrides {
+ /** Default value: `#2962FF` */
+ "linetoolcomment.backgroundColor": string;
+ /** Default value: `#2962FF` */
+ "linetoolcomment.borderColor": string;
+ /** Default value: `#ffffff` */
+ "linetoolcomment.color": string;
+ /** Default value: `16` */
+ "linetoolcomment.fontsize": number;
+ /** Default value: `0` */
+ "linetoolcomment.transparency": number;
+}
+/**
+ * Overrides for the 'Commodity Channel Index' indicator.
+ *
+ * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}.
+ */
+export 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}.
+ */
+export 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;
+}
+/**
+ * Defines a custom compare symbol for the Compare dialog window
+ */
+export interface CompareSymbol {
+ /** symbol identifier */
+ symbol: string;
+ /** the name of instrument that will be displayed near the corresponding checkbox */
+ title: string;
+}
+/**
+ * Overrides for the 'Connors RSI' indicator.
+ *
+ * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}.
+ */
+export 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;
+}
+export 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;
+}
+/** Use this interface to override the [context menu](https://www.tradingview.com/charting-library-docs/latest/ui_elements/context-menu). */
+export interface ContextMenuOptions {
+ /**
+ * Provide this function if you want to change the set of actions being displayed in the context menu.
+ *
+ * You can filter out, add yours and re-order items.
+ *
+ * The library will call your function each time it wants to display a context menu and will provide a list of items to display.
+ * This function should return an array of items to display.
+ *
+ * Example:
+ *
+ * ```js
+ * context_menu: {
+ * items_processor: function(items, actionsFactory, params) {
+ * console.log(`Menu name is: ${params.menuName}`);
+ * const newItem = actionsFactory.createAction({
+ * actionId: 'hello-world',
+ * label: 'Say Hello',
+ * onExecute: function() {
+ * alert('Hello World');
+ * },
+ * });
+ * items.unshift(newItem);
+ * return Promise.resolve(items);
+ * },
+ * },
+ * ```
+ */
+ items_processor?: ContextMenuItemsProcessor;
+ /**
+ * Provide this function to override the default renderer for context menu so you can adjust existing menu items.
+ */
+ renderer_factory?: ContextMenuRendererFactory;
+}
+export interface ContextMenuPosition {
+ /** 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;
+ /** Touch positions */
+ touches?: readonly {
+ /** X (horizontal) coordinate (in pixels) at which the touch event occurred, relative to the left edge of the applications viewport. */
+ clientX: number;
+ /** Y (vertical) coordinate (in pixels) at which the touch event occurred, relative to the left edge of the applications viewport. */
+ clientY: number;
+ }[];
+ /**
+ * Tells what side of the context menu widget should be used to "attach" to a provided x coordinate.
+ * If the value is `undefined`, then you may treat it based on whether it is rtl or not (e.g. `'right'` for rtl and `'left'` otherwise).
+ * The value `'auto'` behaves as `undefined` but additionally checks if there is enough space to place the menu and if it's not then the result value is inverted.
+ */
+ attachToXBy?: "left" | "right" | "auto";
+ /**
+ * Tells what side of the context menu widget should be used to "attach" to a provided y coordinate:
+ * - `'auto'` means similar to `'top'` but the menu could be expanded above the coordinate if needed (if there is no enough space to place it below)
+ * - `'auto-strict'` means `'top'` if the whole menu fits the space below the coordinate and `'bottom'` otherwise (see {@link box})
+ * - `'top'` means that the menu should be placed to the bottom of y coordinate (the menu should be attached by its bottom to y coordinate)
+ * - `'bottom'` means that the menu should be placed above y coordinate (the menu should be attached by its top to y coordinate)
+ *
+ * You may treat `undefined` as `'auto'`.
+ */
+ attachToYBy?: "auto" | "auto-strict" | "top" | "bottom";
+ /**
+ * The optional structure that helps to more accurate calculate a position of the menu (see {@link attachToYBy}).
+ */
+ box?: {
+ /** menu x coordinate */
+ x: number;
+ /** menu y coordinate */
+ y: number;
+ /** menu width */
+ w: number;
+ /** menu height */
+ h: number;
+ /** x coordinate overlaps */
+ overlapX?: boolean;
+ };
+ /**
+ * Additional horizontal margin.
+ */
+ marginX?: number;
+ /**
+ * Additional vertical margin.
+ */
+ marginY?: number;
+}
+/**
+ * Overrides for the 'Coppock Curve' indicator.
+ *
+ * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}.
+ */
+export 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}.
+ */
+export 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}.
+ */
+export 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.
+ */
+export interface CreateAnchoredShapeOptions extends CreateShapeOptionsBase {
+ /**
+ * A drawing to create;
+ */
+ shape: "anchored_text" | "anchored_note";
+}
+export interface CreateContextMenuParams {
+ /** name of the menu */
+ menuName: string;
+ /**
+ * Additional details for the context menu.
+ * `type` field can be one of the following: `series`, `study`, `shape`, `groupOfShapes`, `position`, `order`, `priceScale`.
+ */
+ detail?: {
+ /** series type */
+ type: "series";
+ /** id */
+ id: string;
+ } | {
+ /** study type */
+ type: "study";
+ /** id */
+ id: string | null;
+ } | {
+ /** shape type */
+ type: "shape";
+ /** id */
+ id: number | string | null;
+ } | {
+ /** groupOfShapes type */
+ type: "groupOfShapes";
+ /** id */
+ id: string | null;
+ } | {
+ /** Trading position */
+ type: "position";
+ /** id */
+ id: string | null;
+ } | {
+ /** Trading order */
+ type: "order";
+ /** id */
+ id: string | null;
+ } | {
+ /** Price scale */
+ type: "priceScale";
+ /** id */
+ id: string;
+ /** Pane index */
+ paneIndex: number;
+ /** Chart index */
+ chartIndex: number;
+ };
+}
+export 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.
+ */
+export interface CreateMultipointShapeOptions extends CreateShapeOptionsBase {
+ /**
+ * A drawing to create.
+ */
+ shape?: Exclude;
+}
+/**
+ * Options for creating a drawing.
+ */
+export 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.
+ */
+export interface CreateShapeOptionsBase {
+ /** Text for drawing */
+ 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.
+ */
+export 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.
+ */
+export 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;
+}
+export 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.
+ */
+export 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.
+ */
+export 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[];
+}
+export 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;
+}
+/**
+ * Override properties for the Crossline drawing tool.
+ */
+export interface CrosslineLineToolOverrides {
+ /** Default value: `#2962FF` */
+ "linetoolcrossline.linecolor": string;
+ /** Default value: `0` */
+ "linetoolcrossline.linestyle": number;
+ /** Default value: `2` */
+ "linetoolcrossline.linewidth": number;
+ /** Default value: `true` */
+ "linetoolcrossline.showPrice": boolean;
+ /** Default value: `true` */
+ "linetoolcrossline.showTime": boolean;
+}
+export interface CryptoBalance {
+ /** Symbol */
+ symbol: string;
+ /** Total balance */
+ total: number;
+ /** Available balance */
+ available: number;
+ /** Reserved balance */
+ reserved?: number;
+ /** Balance value */
+ value?: number;
+ /** Balance value's currency */
+ valueCurrency?: string;
+ /** Long name of Crypto */
+ longName?: string;
+ /** Bitcoin value of balance */
+ btcValue?: number;
+}
+/**
+ * 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.
+ */
+export 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[];
+}
+export 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;
+}
+export interface CustomAliasedTimezone extends CustomTimezoneInfo {
+ /**
+ * Id for the custom timezone.
+ */
+ id: CustomTimezoneId;
+}
+export interface CustomComboBoxItem {
+ /** Combo box item text */
+ text: string;
+ /** Combo box item value */
+ value: string;
+}
+export interface CustomComboBoxMetaInfo extends CustomInputFieldMetaInfo {
+ /** @inheritDoc */
+ inputType: "ComboBox";
+ /** Items for the combo box input field */
+ items: CustomComboBoxItem[];
+}
+export interface CustomFieldMetaInfoBase {
+ /** Type of the input field */
+ inputType: string;
+ /** Input field ID */
+ id: string;
+ /** Title for the input field */
+ title: string;
+ /** Value of the field */
+ value?: any;
+ /** Should the input field value be saved to settings */
+ saveToSettings?: boolean;
+}
+/**
+ * Custom fields to be added to an object.
+ */
+export interface CustomFields {
+ /** Custom field */
+ [key: string]: any;
+}
+/** */
+export interface CustomFormatter {
+ /** Formats date and time */
+ format(date: Date): string;
+ /** Converts date and time to local time zone. */
+ formatLocal(date: Date): string;
+ /**
+ * Returns a value in a format known by the UI.
+ * Required when using `dateFormatter`, it has to return a date in the following format: `YYYY-MM-DD`.
+ */
+ parse(value: string): string;
+}
+/**
+ * Formatters used to adjust the displayed format of the date and time values.
+ */
+export interface CustomFormatters {
+ /** Used to format the time displayed in the bottom toolbar (time zone) */
+ timeFormatter?: CustomFormatter;
+ /**
+ * Used to format the date displayed over the timescale when hovering over a chart.
+ * Note that by declaring this formatter all the default ones defined in Chart settings/Scales/Date format
+ * will display the exact same outcome as the formatter.
+ */
+ dateFormatter?: CustomFormatter;
+ /**
+ * Used to format date displayed in the time axis
+ * **Remark**: `tickMarkFormatter` must display the UTC date, and not the date corresponding to your local time zone.
+ */
+ tickMarkFormatter?: (date: Date, tickMarkType: TickMarkType) => string;
+ /** Used to format numeric price values on the [price scale](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Price-Scale) and [Watchlist](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Watch-List) (*Last* and *Chg* columns). */
+ priceFormatterFactory?: SeriesFormatterFactory;
+ /**
+ * Used to format the numbers displayed within a custom study.
+ */
+ studyFormatterFactory?: CustomStudyFormatterFactory;
+}
+export 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);
+}
+export interface CustomInputFieldMetaInfo extends CustomFieldMetaInfoBase {
+ /** Prevent modification */
+ preventModify?: boolean;
+ /** Placeholder string for the field */
+ placeHolder?: string;
+ /** Validator function for the field */
+ validator?: InputFieldValidator;
+ /** Additional custom information */
+ customInfo?: any;
+}
+/**
+ * An object that contains the results of broker specific user inputs (for example a digital signature).
+ */
+export interface CustomInputFieldsValues {
+ [fieldId: string]: TextWithCheckboxValue | boolean | string | any;
+}
+/**
+ * Action link to be displayed at the end of the section for the
+ * status item in the pop-up tooltip.
+ */
+export 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.
+ */
+export 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;
+}
+/**
+ * Study format description used in custom study formatters.
+ */
+export interface CustomStudyFormatterFormat {
+ /**
+ * The format of the plot.
+ */
+ type: "price" | "volume" | "percent" | "inherit";
+ /**
+ * The format precision.
+ */
+ precision?: number;
+}
+export interface CustomTableElementFormatter {
+ /** Custom formatter name */
+ name: FormatterName;
+ /** Formatter to generate HTML element */
+ formatElement?: CustomTableFormatElementFunction;
+ /** Formatter to generate text. Return an empty string if you don't need to display this */
+ formatText: TableFormatTextFunction;
+ /** Allow usage of priceFormatter */
+ isPriceFormatterNeeded?: boolean;
+}
+/**
+ * Custom colors to override either the default light or dark theme.
+ */
+export 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.
+ */
+export interface CustomThemes {
+ light: CustomThemeColors;
+ dark: CustomThemeColors;
+}
+export interface CustomTimezoneInfo {
+ /**
+ * Timezone identifier ({@link TimezoneId}) to which this custom
+ * timezone should be mapped to. This must be a timezone supported
+ * by library.
+ *
+ * Additionally, you can specify a `Etc/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).
+ */
+ alias: TimezoneId | GmtTimezoneId;
+ /**
+ * Display name for the timezone
+ */
+ title: string;
+}
+/**
+ * Override properties for the Cypherpattern drawing tool.
+ */
+export interface CypherpatternLineToolOverrides {
+ /** Default value: `#2962FF` */
+ "linetoolcypherpattern.backgroundColor": string;
+ /** Default value: `false` */
+ "linetoolcypherpattern.bold": boolean;
+ /** Default value: `#2962FF` */
+ "linetoolcypherpattern.color": string;
+ /** Default value: `true` */
+ "linetoolcypherpattern.fillBackground": boolean;
+ /** Default value: `12` */
+ "linetoolcypherpattern.fontsize": number;
+ /** Default value: `false` */
+ "linetoolcypherpattern.italic": boolean;
+ /** Default value: `2` */
+ "linetoolcypherpattern.linewidth": number;
+ /** Default value: `#ffffff` */
+ "linetoolcypherpattern.textcolor": string;
+ /** Default value: `85` */
+ "linetoolcypherpattern.transparency": number;
+}
+/**
+ * Depth of Market (Order Book) Data
+ */
+export 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
+ */
+export 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.
+ */
+export 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/core_concepts/Resolution) 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/core_concepts/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;
+}
+/**
+ * This object contains symbol quote values, where a [quote](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/quotes) represents a set of data describing the current price.
+ * The library uses quote data for various trading functionalities, including the [Order Ticket](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket), [Legend](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Legend),
+ * and widgets, such as [Watchlist](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Watch-List), [Details](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#details),
+ * [News](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/news), and [Depth of Market](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#depth-of-market).
+ *
+ * While all properties in this object are marked as optional, populating most of them is required for supporting trading functionalities.
+ * Providing values that do not match the expected data types can cause issues such as UI [loading delays](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Datafeed-Issues#delays-in-trading-platform-ui-elements) or [missing data](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Datafeed-Issues#quotes-are-not-displayed-or-refreshed).
+ * See property descriptions for more information.
+ */
+export interface DatafeedQuoteValues {
+ /**
+ * Price change. It is usually calculated as a difference between the current price and close price of the previous day (regular session).
+ * In the UI, `ch` and {@link chp} are represented as the last day change parameter in *Data Window*.
+ * You can also display these values in the [legend](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Legend#last-day-change-values).
+ * If `ch` and `chp` are not provided, `0.00 (0.00%)` is displayed instead.
+ *
+ * Note that `ch` and `chp` are **required** for mobile apps. Otherwise, [`NaN` values](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Legend#nan-values-in-legend) will appear in the legend.
+ */
+ ch?: number;
+ /**
+ * Price change percentage. In the UI, `chp` and {@link ch} are represented as the last day change parameter in *Data Window*.
+ * You can also display these values in the [Legend](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Legend#last-day-change-values).
+ * If `ch` and `chp` are not provided, `0.00 (0.00%)` is displayed instead.
+ *
+ * Note that `ch` and `chp` are **required** for mobile apps. Otherwise, [`NaN` values](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Legend#nan-values-in-legend) will appear in the Legend.
+ */
+ chp?: number;
+ /** Short name for a symbol. Short name is used in the title for the [News](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/news), [Watchlist](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Watch-List) and [Details](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#details) widgets. You can disable the [`prefer_quote_short_name`](https://www.tradingview.com/charting-library-docs/latest/customization/Featuresets#prefer_quote_short_name) to use the {@link LibrarySymbolInfo.ticker} value instead. */
+ short_name?: string;
+ /** The name of the exchange. The exchange name is displayed in the [Details](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#details) widget. */
+ exchange?: string;
+ /** A short description of the symbol. This description is displayed in the [Details](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#details) widget and the tooltip of the [Watchlist](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Watch-List) widget. */
+ description?: string;
+ /**
+ * The price at which the most recent trade of a security occurred, regardless of whether it was a buy or sell.
+ * Required for the [Order Ticket](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket), [Depth of Market](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#depth-of-market), [Buy/Sell buttons](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#buysell-buttons-and-lines), and [Details](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#details) and [Watchlist](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Watch-List) widgets.
+ */
+ lp?: number;
+ /** Ask price – the lowest price a seller is willing to accept for a security. The value is displayed in the [Order Ticket](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket) and [Buy/Sell buttons](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#buysell-buttons-and-lines). */
+ ask?: number;
+ /** Bid price – the highest price a buyer is willing to pay for a security. The value is displayed in the [Order Ticket](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket) and [Buy/Sell buttons](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#buysell-buttons-and-lines). */
+ bid?: number;
+ /** Spread – the difference between the ask and bid prices. The value is displayed between [Buy/Sell buttons](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#buysell-buttons-and-lines). */
+ spread?: number;
+ /** Today's opening price */
+ open_price?: number;
+ /** Today's high price. The value is displayed in the [Details](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#details) widget. */
+ high_price?: number;
+ /** Today's low price. The value is displayed in the [Details](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#details) widget. */
+ low_price?: number;
+ /**
+ * Closing price of the symbol from the previous regular market session.
+ *
+ * Required for mobile apps. Otherwise, `NaN` values will appear in the [Legend](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Legend).
+ */
+ prev_close_price?: number;
+ /** Today's trading volume. This value is displayed in the [Watchlist](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Watch-List) widget. */
+ volume?: number;
+ /** Original name */
+ original_name?: string;
+ /** Pre-/post-market price. This value is required to display the [pre-/post-market price line](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Extended-Sessions#enable-the-price-line) on the chart and information on the extended session in the [Details](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#details) widget. */
+ rtc?: number;
+ /** Pre-/post-market price update time. This value is required to display information on the [extended session](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Extended-Sessions) in the [Details](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#details) widget. */
+ rtc_time?: number;
+ /** Pre-/post-market price change. This value is required to display information on the [extended session](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Extended-Sessions) in the [Details](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#details) widget. */
+ rch?: number;
+ /** Pre-/post-market price change percentage. This value is required to display information on the [extended session](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Extended-Sessions) the [Details](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#details) widget. */
+ rchp?: number;
+ [valueName: string]: string | number | string[] | number[] | undefined;
+}
+export interface DatafeedSymbolType {
+ /** Name of the symbol type */
+ name: string;
+ /** Value to be passed as the `symbolType` argument to `searchSymbols` */
+ value: string;
+}
+export interface DefaultContextMenuActionsParams {
+}
+export interface DefaultDropdownActionsParams {
+ /** Show trading properties */
+ tradingProperties?: boolean;
+ /** Restore confirmations */
+ restoreConfirmations?: boolean;
+}
+/**
+ * Overrides for the 'Detrended Price Oscillator' indicator.
+ *
+ * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}.
+ */
+export 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;
+}
+export 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}.
+ */
+export 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;
+}
+export interface DisconnectionInfo {
+ message?: string;
+ disconnectType?: DisconnectType;
+}
+/**
+ * Override properties for the Disjointangle drawing tool.
+ */
+export interface DisjointangleLineToolOverrides {
+ /** Default value: `rgba(8, 153, 129, 0.2)` */
+ "linetooldisjointangle.backgroundColor": string;
+ /** Default value: `false` */
+ "linetooldisjointangle.bold": boolean;
+ /** Default value: `false` */
+ "linetooldisjointangle.extendLeft": boolean;
+ /** Default value: `false` */
+ "linetooldisjointangle.extendRight": boolean;
+ /** Default value: `true` */
+ "linetooldisjointangle.fillBackground": boolean;
+ /** Default value: `12` */
+ "linetooldisjointangle.fontsize": number;
+ /** Default value: `false` */
+ "linetooldisjointangle.italic": boolean;
+ /** Default value: `false` */
+ "linetooldisjointangle.labelBold": boolean;
+ /** Default value: `14` */
+ "linetooldisjointangle.labelFontSize": number;
+ /** Default value: `left` */
+ "linetooldisjointangle.labelHorzAlign": string;
+ /** Default value: `false` */
+ "linetooldisjointangle.labelItalic": boolean;
+ /** Default value: `#089981` */
+ "linetooldisjointangle.labelTextColor": string;
+ /** Default value: `bottom` */
+ "linetooldisjointangle.labelVertAlign": string;
+ /** Default value: `false` */
+ "linetooldisjointangle.labelVisible": boolean;
+ /** Default value: `0` */
+ "linetooldisjointangle.leftEnd": number;
+ /** Default value: `#089981` */
+ "linetooldisjointangle.linecolor": string;
+ /** Default value: `0` */
+ "linetooldisjointangle.linestyle": number;
+ /** Default value: `2` */
+ "linetooldisjointangle.linewidth": number;
+ /** Default value: `0` */
+ "linetooldisjointangle.rightEnd": number;
+ /** Default value: `false` */
+ "linetooldisjointangle.showBarsRange": boolean;
+ /** Default value: `false` */
+ "linetooldisjointangle.showDateTimeRange": boolean;
+ /** Default value: `false` */
+ "linetooldisjointangle.showPriceRange": boolean;
+ /** Default value: `false` */
+ "linetooldisjointangle.showPrices": boolean;
+ /** Default value: `#089981` */
+ "linetooldisjointangle.textcolor": string;
+ /** Default value: `20` */
+ "linetooldisjointangle.transparency": number;
+}
+/**
+ * Overrides for the 'Donchian Channels' indicator.
+ *
+ * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}.
+ */
+export 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}.
+ */
+export 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
+ */
+export 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;
+}
+/** Item within a dropdown menu */
+export 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 */
+export 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}.
+ */
+export 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}.
+ */
+export 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;
+}
+export 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}.
+ */
+export 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;
+}
+/**
+ * Override properties for the Elliottcorrection drawing tool.
+ */
+export interface ElliottcorrectionLineToolOverrides {
+ /** Default value: `#3d85c6` */
+ "linetoolelliottcorrection.color": string;
+ /** Default value: `7` */
+ "linetoolelliottcorrection.degree": number;
+ /** Default value: `2` */
+ "linetoolelliottcorrection.linewidth": number;
+ /** Default value: `true` */
+ "linetoolelliottcorrection.showWave": boolean;
+}
+/**
+ * Override properties for the Elliottdoublecombo drawing tool.
+ */
+export interface ElliottdoublecomboLineToolOverrides {
+ /** Default value: `#6aa84f` */
+ "linetoolelliottdoublecombo.color": string;
+ /** Default value: `7` */
+ "linetoolelliottdoublecombo.degree": number;
+ /** Default value: `2` */
+ "linetoolelliottdoublecombo.linewidth": number;
+ /** Default value: `true` */
+ "linetoolelliottdoublecombo.showWave": boolean;
+}
+/**
+ * Override properties for the Elliottimpulse drawing tool.
+ */
+export interface ElliottimpulseLineToolOverrides {
+ /** Default value: `#3d85c6` */
+ "linetoolelliottimpulse.color": string;
+ /** Default value: `7` */
+ "linetoolelliottimpulse.degree": number;
+ /** Default value: `2` */
+ "linetoolelliottimpulse.linewidth": number;
+ /** Default value: `true` */
+ "linetoolelliottimpulse.showWave": boolean;
+}
+/**
+ * Override properties for the Elliotttriangle drawing tool.
+ */
+export interface ElliotttriangleLineToolOverrides {
+ /** Default value: `#FF9800` */
+ "linetoolelliotttriangle.color": string;
+ /** Default value: `7` */
+ "linetoolelliotttriangle.degree": number;
+ /** Default value: `2` */
+ "linetoolelliotttriangle.linewidth": number;
+ /** Default value: `true` */
+ "linetoolelliotttriangle.showWave": boolean;
+}
+/**
+ * Override properties for the Elliotttriplecombo drawing tool.
+ */
+export interface ElliotttriplecomboLineToolOverrides {
+ /** Default value: `#6aa84f` */
+ "linetoolelliotttriplecombo.color": string;
+ /** Default value: `7` */
+ "linetoolelliotttriplecombo.degree": number;
+ /** Default value: `2` */
+ "linetoolelliotttriplecombo.linewidth": number;
+ /** Default value: `true` */
+ "linetoolelliotttriplecombo.showWave": boolean;
+}
+/**
+ * Override properties for the Ellipse drawing tool.
+ */
+export interface EllipseLineToolOverrides {
+ /** Default value: `rgba(242, 54, 69, 0.2)` */
+ "linetoolellipse.backgroundColor": string;
+ /** Default value: `false` */
+ "linetoolellipse.bold": boolean;
+ /** Default value: `#F23645` */
+ "linetoolellipse.color": string;
+ /** Default value: `true` */
+ "linetoolellipse.fillBackground": boolean;
+ /** Default value: `14` */
+ "linetoolellipse.fontSize": number;
+ /** Default value: `false` */
+ "linetoolellipse.italic": boolean;
+ /** Default value: `2` */
+ "linetoolellipse.linewidth": number;
+ /** Default value: `false` */
+ "linetoolellipse.showLabel": boolean;
+ /** Default value: `#F23645` */
+ "linetoolellipse.textColor": string;
+ /** Default value: `50` */
+ "linetoolellipse.transparency": number;
+}
+/**
+ * Override properties for the Emoji drawing tool.
+ */
+export interface EmojiLineToolOverrides {
+ /** Default value: `1.5707963267948966` */
+ "linetoolemoji.angle": number;
+ /**
+ * Default value: `😀`
+ *
+ * Refer to [Drawings list](https://www.tradingview.com/charting-library-docs/latest/ui_elements/drawings/Drawings-List#emojis) for a list of emojis.
+ * Note that the emoji code requires `u/` before it.
+ */
+ /** Default value: `40` */
+ "linetoolemoji.size": number;
+}
+export interface EmojiOptions {
+ /** Emoji */
+ emoji: string;
+}
+export 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}.
+ */
+export 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;
+}
+export interface ErrorFormatterParseResult extends FormatterParseResult {
+ /** Optional message when there's an error while parsing */
+ error?: string;
+ /** @inheritDoc */
+ res: false;
+}
+/** Exchange Description */
+export 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;
+}
+/**
+ * Describes a single execution.
+ * Execution is when a buy or sell order is completed for a financial instrument.
+ */
+export interface Execution extends CustomFields {
+ /** Symbol name */
+ symbol: string;
+ /** Execution price */
+ price: number;
+ /** Execution Quantity */
+ qty: number;
+ /** Execution Side */
+ side: Side;
+ /** Time (unix timestamp in milliseconds) */
+ time: number;
+ /** Commission amount for executed trade */
+ commission?: number;
+ /** Net amount for executed trade */
+ netAmount?: number;
+}
+/**
+ * Override properties for the Execution drawing tool.
+ */
+export interface ExecutionLineToolOverrides {
+ /** Default value: `#4094e8` */
+ "linetoolexecution.arrowBuyColor": string;
+ /** Default value: `8` */
+ "linetoolexecution.arrowHeight": number;
+ /** Default value: `#e75656` */
+ "linetoolexecution.arrowSellColor": string;
+ /** Default value: `1` */
+ "linetoolexecution.arrowSpacing": number;
+ /** Default value: `buy` */
+ "linetoolexecution.direction": string;
+ /** Default value: `false` */
+ "linetoolexecution.fontBold": boolean;
+ /** Default value: `Verdana` */
+ "linetoolexecution.fontFamily": string;
+ /** Default value: `false` */
+ "linetoolexecution.fontItalic": boolean;
+ /** Default value: `10` */
+ "linetoolexecution.fontSize": number;
+ /** Default value: `undefined` */
+ "linetoolexecution.text": string;
+ /** Default value: `#000000` */
+ "linetoolexecution.textColor": string;
+ /** Default value: `0` */
+ "linetoolexecution.textTransparency": number;
+ /** Default value: `undefined` */
+ "linetoolexecution.tooltip": string;
+}
+export 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
+ */
+export 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[][];
+}
+/**
+ * Override properties for the Extended drawing tool.
+ */
+export interface ExtendedLineToolOverrides {
+ /** Default value: `false` */
+ "linetoolextended.alwaysShowStats": boolean;
+ /** Default value: `false` */
+ "linetoolextended.bold": boolean;
+ /** Default value: `true` */
+ "linetoolextended.extendLeft": boolean;
+ /** Default value: `true` */
+ "linetoolextended.extendRight": boolean;
+ /** Default value: `14` */
+ "linetoolextended.fontsize": number;
+ /** Default value: `center` */
+ "linetoolextended.horzLabelsAlign": string;
+ /** Default value: `false` */
+ "linetoolextended.italic": boolean;
+ /** Default value: `0` */
+ "linetoolextended.leftEnd": number;
+ /** Default value: `#2962FF` */
+ "linetoolextended.linecolor": string;
+ /** Default value: `0` */
+ "linetoolextended.linestyle": number;
+ /** Default value: `2` */
+ "linetoolextended.linewidth": number;
+ /** Default value: `0` */
+ "linetoolextended.rightEnd": number;
+ /** Default value: `false` */
+ "linetoolextended.showAngle": boolean;
+ /** Default value: `false` */
+ "linetoolextended.showBarsRange": boolean;
+ /** Default value: `false` */
+ "linetoolextended.showDateTimeRange": boolean;
+ /** Default value: `false` */
+ "linetoolextended.showDistance": boolean;
+ /** Default value: `false` */
+ "linetoolextended.showLabel": boolean;
+ /** Default value: `false` */
+ "linetoolextended.showMiddlePoint": boolean;
+ /** Default value: `false` */
+ "linetoolextended.showPercentPriceRange": boolean;
+ /** Default value: `false` */
+ "linetoolextended.showPipsPriceRange": boolean;
+ /** Default value: `false` */
+ "linetoolextended.showPriceLabels": boolean;
+ /** Default value: `false` */
+ "linetoolextended.showPriceRange": boolean;
+ /** Default value: `2` */
+ "linetoolextended.statsPosition": number;
+ /** Default value: `#2962FF` */
+ "linetoolextended.textcolor": string;
+ /** Default value: `bottom` */
+ "linetoolextended.vertLabelsAlign": string;
+}
+/**
+ * Favorites which can be defined within the Widget Constructor options (see {@link ChartingLibraryWidgetOptions.favorites}).
+ */
+export interface Favorites {
+ /**
+ * An array of time intervals that are marked as favorite.
+ *
+ * Example: `["D", "2D"]`
+ */
+ intervals?: ResolutionString[];
+ /**
+ * An array of indicator titles that are marked as favorite.
+ * The names of indicators are identical to the `title` property of the indicator. For built-in indicators
+ * this will match the chart UI in the English version.
+ *
+ * Example: `["Awesome Oscillator", "Bollinger Bands"]`.
+ */
+ indicators?: string[];
+ /**
+ * An array of chart types that are marked as favorite.
+ * The names of chart types are listed within the {@link ChartTypeFavorites} or {@link TradingTerminalChartTypeFavorites} type.
+ *
+ * Example: `["Area", "Candles"]`.
+ */
+ chartTypes?: TChartTypeFavorites[];
+ /**
+ * An array of drawing tool identifiers that should be marked as favorite. These will only
+ * be applied if there aren't existing favorites.
+ *
+ * Example: ['LineToolBrush', 'LineToolCallout', 'LineToolCircle']
+ */
+ drawingTools?: DrawingToolIdentifier[];
+}
+/**
+ * Override properties for the Fibchannel drawing tool.
+ */
+export interface FibchannelLineToolOverrides {
+ /** Default value: `false` */
+ "linetoolfibchannel.coeffsAsPercents": boolean;
+ /** Default value: `false` */
+ "linetoolfibchannel.extendLeft": boolean;
+ /** Default value: `false` */
+ "linetoolfibchannel.extendRight": boolean;
+ /** Default value: `true` */
+ "linetoolfibchannel.fillBackground": boolean;
+ /** Default value: `left` */
+ "linetoolfibchannel.horzLabelsAlign": string;
+ /** Default value: `12` */
+ "linetoolfibchannel.labelFontSize": number;
+ /** Default value: `0` */
+ "linetoolfibchannel.level1.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolfibchannel.level1.color": string;
+ /** Default value: `true` */
+ "linetoolfibchannel.level1.visible": boolean;
+ /** Default value: `3.618` */
+ "linetoolfibchannel.level10.coeff": number;
+ /** Default value: `#9c27b0` */
+ "linetoolfibchannel.level10.color": string;
+ /** Default value: `true` */
+ "linetoolfibchannel.level10.visible": boolean;
+ /** Default value: `4.236` */
+ "linetoolfibchannel.level11.coeff": number;
+ /** Default value: `#e91e63` */
+ "linetoolfibchannel.level11.color": string;
+ /** Default value: `true` */
+ "linetoolfibchannel.level11.visible": boolean;
+ /** Default value: `1.272` */
+ "linetoolfibchannel.level12.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolfibchannel.level12.color": string;
+ /** Default value: `false` */
+ "linetoolfibchannel.level12.visible": boolean;
+ /** Default value: `1.414` */
+ "linetoolfibchannel.level13.coeff": number;
+ /** Default value: `#F23645` */
+ "linetoolfibchannel.level13.color": string;
+ /** Default value: `false` */
+ "linetoolfibchannel.level13.visible": boolean;
+ /** Default value: `2.272` */
+ "linetoolfibchannel.level14.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolfibchannel.level14.color": string;
+ /** Default value: `false` */
+ "linetoolfibchannel.level14.visible": boolean;
+ /** Default value: `2.414` */
+ "linetoolfibchannel.level15.coeff": number;
+ /** Default value: `#4caf50` */
+ "linetoolfibchannel.level15.color": string;
+ /** Default value: `false` */
+ "linetoolfibchannel.level15.visible": boolean;
+ /** Default value: `2` */
+ "linetoolfibchannel.level16.coeff": number;
+ /** Default value: `#089981` */
+ "linetoolfibchannel.level16.color": string;
+ /** Default value: `false` */
+ "linetoolfibchannel.level16.visible": boolean;
+ /** Default value: `3` */
+ "linetoolfibchannel.level17.coeff": number;
+ /** Default value: `#00bcd4` */
+ "linetoolfibchannel.level17.color": string;
+ /** Default value: `false` */
+ "linetoolfibchannel.level17.visible": boolean;
+ /** Default value: `3.272` */
+ "linetoolfibchannel.level18.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolfibchannel.level18.color": string;
+ /** Default value: `false` */
+ "linetoolfibchannel.level18.visible": boolean;
+ /** Default value: `3.414` */
+ "linetoolfibchannel.level19.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibchannel.level19.color": string;
+ /** Default value: `false` */
+ "linetoolfibchannel.level19.visible": boolean;
+ /** Default value: `0.236` */
+ "linetoolfibchannel.level2.coeff": number;
+ /** Default value: `#F23645` */
+ "linetoolfibchannel.level2.color": string;
+ /** Default value: `true` */
+ "linetoolfibchannel.level2.visible": boolean;
+ /** Default value: `4` */
+ "linetoolfibchannel.level20.coeff": number;
+ /** Default value: `#F23645` */
+ "linetoolfibchannel.level20.color": string;
+ /** Default value: `false` */
+ "linetoolfibchannel.level20.visible": boolean;
+ /** Default value: `4.272` */
+ "linetoolfibchannel.level21.coeff": number;
+ /** Default value: `#9c27b0` */
+ "linetoolfibchannel.level21.color": string;
+ /** Default value: `false` */
+ "linetoolfibchannel.level21.visible": boolean;
+ /** Default value: `4.414` */
+ "linetoolfibchannel.level22.coeff": number;
+ /** Default value: `#e91e63` */
+ "linetoolfibchannel.level22.color": string;
+ /** Default value: `false` */
+ "linetoolfibchannel.level22.visible": boolean;
+ /** Default value: `4.618` */
+ "linetoolfibchannel.level23.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolfibchannel.level23.color": string;
+ /** Default value: `false` */
+ "linetoolfibchannel.level23.visible": boolean;
+ /** Default value: `4.764` */
+ "linetoolfibchannel.level24.coeff": number;
+ /** Default value: `#089981` */
+ "linetoolfibchannel.level24.color": string;
+ /** Default value: `false` */
+ "linetoolfibchannel.level24.visible": boolean;
+ /** Default value: `0.382` */
+ "linetoolfibchannel.level3.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolfibchannel.level3.color": string;
+ /** Default value: `true` */
+ "linetoolfibchannel.level3.visible": boolean;
+ /** Default value: `0.5` */
+ "linetoolfibchannel.level4.coeff": number;
+ /** Default value: `#4caf50` */
+ "linetoolfibchannel.level4.color": string;
+ /** Default value: `true` */
+ "linetoolfibchannel.level4.visible": boolean;
+ /** Default value: `0.618` */
+ "linetoolfibchannel.level5.coeff": number;
+ /** Default value: `#089981` */
+ "linetoolfibchannel.level5.color": string;
+ /** Default value: `true` */
+ "linetoolfibchannel.level5.visible": boolean;
+ /** Default value: `0.786` */
+ "linetoolfibchannel.level6.coeff": number;
+ /** Default value: `#00bcd4` */
+ "linetoolfibchannel.level6.color": string;
+ /** Default value: `true` */
+ "linetoolfibchannel.level6.visible": boolean;
+ /** Default value: `1` */
+ "linetoolfibchannel.level7.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolfibchannel.level7.color": string;
+ /** Default value: `true` */
+ "linetoolfibchannel.level7.visible": boolean;
+ /** Default value: `1.618` */
+ "linetoolfibchannel.level8.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibchannel.level8.color": string;
+ /** Default value: `true` */
+ "linetoolfibchannel.level8.visible": boolean;
+ /** Default value: `2.618` */
+ "linetoolfibchannel.level9.coeff": number;
+ /** Default value: `#F23645` */
+ "linetoolfibchannel.level9.color": string;
+ /** Default value: `true` */
+ "linetoolfibchannel.level9.visible": boolean;
+ /** Default value: `0` */
+ "linetoolfibchannel.levelsStyle.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibchannel.levelsStyle.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibchannel.showCoeffs": boolean;
+ /** Default value: `true` */
+ "linetoolfibchannel.showPrices": boolean;
+ /** Default value: `80` */
+ "linetoolfibchannel.transparency": number;
+ /** Default value: `middle` */
+ "linetoolfibchannel.vertLabelsAlign": string;
+}
+/**
+ * Override properties for the Fibcircles drawing tool.
+ */
+export interface FibcirclesLineToolOverrides {
+ /** Default value: `false` */
+ "linetoolfibcircles.coeffsAsPercents": boolean;
+ /** Default value: `true` */
+ "linetoolfibcircles.fillBackground": boolean;
+ /** Default value: `0.236` */
+ "linetoolfibcircles.level1.coeff": number;
+ /** Default value: `#F23645` */
+ "linetoolfibcircles.level1.color": string;
+ /** Default value: `0` */
+ "linetoolfibcircles.level1.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibcircles.level1.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibcircles.level1.visible": boolean;
+ /** Default value: `4.236` */
+ "linetoolfibcircles.level10.coeff": number;
+ /** Default value: `#e91e63` */
+ "linetoolfibcircles.level10.color": string;
+ /** Default value: `0` */
+ "linetoolfibcircles.level10.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibcircles.level10.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibcircles.level10.visible": boolean;
+ /** Default value: `4.618` */
+ "linetoolfibcircles.level11.coeff": number;
+ /** Default value: `#F23645` */
+ "linetoolfibcircles.level11.color": string;
+ /** Default value: `0` */
+ "linetoolfibcircles.level11.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibcircles.level11.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibcircles.level11.visible": boolean;
+ /** Default value: `0.382` */
+ "linetoolfibcircles.level2.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolfibcircles.level2.color": string;
+ /** Default value: `0` */
+ "linetoolfibcircles.level2.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibcircles.level2.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibcircles.level2.visible": boolean;
+ /** Default value: `0.5` */
+ "linetoolfibcircles.level3.coeff": number;
+ /** Default value: `#089981` */
+ "linetoolfibcircles.level3.color": string;
+ /** Default value: `0` */
+ "linetoolfibcircles.level3.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibcircles.level3.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibcircles.level3.visible": boolean;
+ /** Default value: `0.618` */
+ "linetoolfibcircles.level4.coeff": number;
+ /** Default value: `#4caf50` */
+ "linetoolfibcircles.level4.color": string;
+ /** Default value: `0` */
+ "linetoolfibcircles.level4.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibcircles.level4.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibcircles.level4.visible": boolean;
+ /** Default value: `0.786` */
+ "linetoolfibcircles.level5.coeff": number;
+ /** Default value: `#00bcd4` */
+ "linetoolfibcircles.level5.color": string;
+ /** Default value: `0` */
+ "linetoolfibcircles.level5.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibcircles.level5.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibcircles.level5.visible": boolean;
+ /** Default value: `1` */
+ "linetoolfibcircles.level6.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolfibcircles.level6.color": string;
+ /** Default value: `0` */
+ "linetoolfibcircles.level6.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibcircles.level6.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibcircles.level6.visible": boolean;
+ /** Default value: `1.618` */
+ "linetoolfibcircles.level7.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibcircles.level7.color": string;
+ /** Default value: `0` */
+ "linetoolfibcircles.level7.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibcircles.level7.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibcircles.level7.visible": boolean;
+ /** Default value: `2.618` */
+ "linetoolfibcircles.level8.coeff": number;
+ /** Default value: `#e91e63` */
+ "linetoolfibcircles.level8.color": string;
+ /** Default value: `0` */
+ "linetoolfibcircles.level8.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibcircles.level8.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibcircles.level8.visible": boolean;
+ /** Default value: `3.618` */
+ "linetoolfibcircles.level9.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibcircles.level9.color": string;
+ /** Default value: `0` */
+ "linetoolfibcircles.level9.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibcircles.level9.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibcircles.level9.visible": boolean;
+ /** Default value: `true` */
+ "linetoolfibcircles.showCoeffs": boolean;
+ /** Default value: `80` */
+ "linetoolfibcircles.transparency": number;
+ /** Default value: `#808080` */
+ "linetoolfibcircles.trendline.color": string;
+ /** Default value: `2` */
+ "linetoolfibcircles.trendline.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibcircles.trendline.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibcircles.trendline.visible": boolean;
+}
+/**
+ * Override properties for the Fibretracement drawing tool.
+ */
+export interface FibretracementLineToolOverrides {
+ /** Default value: `false` */
+ "linetoolfibretracement.coeffsAsPercents": boolean;
+ /** Default value: `false` */
+ "linetoolfibretracement.extendLines": boolean;
+ /** Default value: `false` */
+ "linetoolfibretracement.extendLinesLeft": boolean;
+ /** Default value: `false` */
+ "linetoolfibretracement.fibLevelsBasedOnLogScale": boolean;
+ /** Default value: `true` */
+ "linetoolfibretracement.fillBackground": boolean;
+ /** Default value: `left` */
+ "linetoolfibretracement.horzLabelsAlign": string;
+ /** Default value: `center` */
+ "linetoolfibretracement.horzTextAlign": string;
+ /** Default value: `12` */
+ "linetoolfibretracement.labelFontSize": number;
+ /** Default value: `0` */
+ "linetoolfibretracement.level1.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolfibretracement.level1.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level1.text": string;
+ /** Default value: `true` */
+ "linetoolfibretracement.level1.visible": boolean;
+ /** Default value: `3.618` */
+ "linetoolfibretracement.level10.coeff": number;
+ /** Default value: `#9c27b0` */
+ "linetoolfibretracement.level10.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level10.text": string;
+ /** Default value: `true` */
+ "linetoolfibretracement.level10.visible": boolean;
+ /** Default value: `4.236` */
+ "linetoolfibretracement.level11.coeff": number;
+ /** Default value: `#e91e63` */
+ "linetoolfibretracement.level11.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level11.text": string;
+ /** Default value: `true` */
+ "linetoolfibretracement.level11.visible": boolean;
+ /** Default value: `1.272` */
+ "linetoolfibretracement.level12.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolfibretracement.level12.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level12.text": string;
+ /** Default value: `false` */
+ "linetoolfibretracement.level12.visible": boolean;
+ /** Default value: `1.414` */
+ "linetoolfibretracement.level13.coeff": number;
+ /** Default value: `#F23645` */
+ "linetoolfibretracement.level13.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level13.text": string;
+ /** Default value: `false` */
+ "linetoolfibretracement.level13.visible": boolean;
+ /** Default value: `2.272` */
+ "linetoolfibretracement.level14.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolfibretracement.level14.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level14.text": string;
+ /** Default value: `false` */
+ "linetoolfibretracement.level14.visible": boolean;
+ /** Default value: `2.414` */
+ "linetoolfibretracement.level15.coeff": number;
+ /** Default value: `#4caf50` */
+ "linetoolfibretracement.level15.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level15.text": string;
+ /** Default value: `false` */
+ "linetoolfibretracement.level15.visible": boolean;
+ /** Default value: `2` */
+ "linetoolfibretracement.level16.coeff": number;
+ /** Default value: `#089981` */
+ "linetoolfibretracement.level16.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level16.text": string;
+ /** Default value: `false` */
+ "linetoolfibretracement.level16.visible": boolean;
+ /** Default value: `3` */
+ "linetoolfibretracement.level17.coeff": number;
+ /** Default value: `#00bcd4` */
+ "linetoolfibretracement.level17.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level17.text": string;
+ /** Default value: `false` */
+ "linetoolfibretracement.level17.visible": boolean;
+ /** Default value: `3.272` */
+ "linetoolfibretracement.level18.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolfibretracement.level18.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level18.text": string;
+ /** Default value: `false` */
+ "linetoolfibretracement.level18.visible": boolean;
+ /** Default value: `3.414` */
+ "linetoolfibretracement.level19.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibretracement.level19.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level19.text": string;
+ /** Default value: `false` */
+ "linetoolfibretracement.level19.visible": boolean;
+ /** Default value: `0.236` */
+ "linetoolfibretracement.level2.coeff": number;
+ /** Default value: `#F23645` */
+ "linetoolfibretracement.level2.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level2.text": string;
+ /** Default value: `true` */
+ "linetoolfibretracement.level2.visible": boolean;
+ /** Default value: `4` */
+ "linetoolfibretracement.level20.coeff": number;
+ /** Default value: `#F23645` */
+ "linetoolfibretracement.level20.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level20.text": string;
+ /** Default value: `false` */
+ "linetoolfibretracement.level20.visible": boolean;
+ /** Default value: `4.272` */
+ "linetoolfibretracement.level21.coeff": number;
+ /** Default value: `#9c27b0` */
+ "linetoolfibretracement.level21.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level21.text": string;
+ /** Default value: `false` */
+ "linetoolfibretracement.level21.visible": boolean;
+ /** Default value: `4.414` */
+ "linetoolfibretracement.level22.coeff": number;
+ /** Default value: `#e91e63` */
+ "linetoolfibretracement.level22.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level22.text": string;
+ /** Default value: `false` */
+ "linetoolfibretracement.level22.visible": boolean;
+ /** Default value: `4.618` */
+ "linetoolfibretracement.level23.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolfibretracement.level23.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level23.text": string;
+ /** Default value: `false` */
+ "linetoolfibretracement.level23.visible": boolean;
+ /** Default value: `4.764` */
+ "linetoolfibretracement.level24.coeff": number;
+ /** Default value: `#089981` */
+ "linetoolfibretracement.level24.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level24.text": string;
+ /** Default value: `false` */
+ "linetoolfibretracement.level24.visible": boolean;
+ /** Default value: `0.382` */
+ "linetoolfibretracement.level3.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolfibretracement.level3.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level3.text": string;
+ /** Default value: `true` */
+ "linetoolfibretracement.level3.visible": boolean;
+ /** Default value: `0.5` */
+ "linetoolfibretracement.level4.coeff": number;
+ /** Default value: `#4caf50` */
+ "linetoolfibretracement.level4.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level4.text": string;
+ /** Default value: `true` */
+ "linetoolfibretracement.level4.visible": boolean;
+ /** Default value: `0.618` */
+ "linetoolfibretracement.level5.coeff": number;
+ /** Default value: `#089981` */
+ "linetoolfibretracement.level5.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level5.text": string;
+ /** Default value: `true` */
+ "linetoolfibretracement.level5.visible": boolean;
+ /** Default value: `0.786` */
+ "linetoolfibretracement.level6.coeff": number;
+ /** Default value: `#00bcd4` */
+ "linetoolfibretracement.level6.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level6.text": string;
+ /** Default value: `true` */
+ "linetoolfibretracement.level6.visible": boolean;
+ /** Default value: `1` */
+ "linetoolfibretracement.level7.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolfibretracement.level7.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level7.text": string;
+ /** Default value: `true` */
+ "linetoolfibretracement.level7.visible": boolean;
+ /** Default value: `1.618` */
+ "linetoolfibretracement.level8.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibretracement.level8.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level8.text": string;
+ /** Default value: `true` */
+ "linetoolfibretracement.level8.visible": boolean;
+ /** Default value: `2.618` */
+ "linetoolfibretracement.level9.coeff": number;
+ /** Default value: `#F23645` */
+ "linetoolfibretracement.level9.color": string;
+ /** Default value: `undefined` */
+ "linetoolfibretracement.level9.text": string;
+ /** Default value: `true` */
+ "linetoolfibretracement.level9.visible": boolean;
+ /** Default value: `0` */
+ "linetoolfibretracement.levelsStyle.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibretracement.levelsStyle.linewidth": number;
+ /** Default value: `false` */
+ "linetoolfibretracement.reverse": boolean;
+ /** Default value: `true` */
+ "linetoolfibretracement.showCoeffs": boolean;
+ /** Default value: `true` */
+ "linetoolfibretracement.showPrices": boolean;
+ /** Default value: `true` */
+ "linetoolfibretracement.showText": boolean;
+ /** Default value: `80` */
+ "linetoolfibretracement.transparency": number;
+ /** Default value: `#808080` */
+ "linetoolfibretracement.trendline.color": string;
+ /** Default value: `2` */
+ "linetoolfibretracement.trendline.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibretracement.trendline.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibretracement.trendline.visible": boolean;
+ /** Default value: `middle` */
+ "linetoolfibretracement.vertLabelsAlign": string;
+ /** Default value: `middle` */
+ "linetoolfibretracement.vertTextAlign": string;
+}
+/**
+ * Override properties for the Fibspeedresistancearcs drawing tool.
+ */
+export interface FibspeedresistancearcsLineToolOverrides {
+ /** Default value: `true` */
+ "linetoolfibspeedresistancearcs.fillBackground": boolean;
+ /** Default value: `false` */
+ "linetoolfibspeedresistancearcs.fullCircles": boolean;
+ /** Default value: `0.236` */
+ "linetoolfibspeedresistancearcs.level1.coeff": number;
+ /** Default value: `#F23645` */
+ "linetoolfibspeedresistancearcs.level1.color": string;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancearcs.level1.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibspeedresistancearcs.level1.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancearcs.level1.visible": boolean;
+ /** Default value: `4.236` */
+ "linetoolfibspeedresistancearcs.level10.coeff": number;
+ /** Default value: `#e91e63` */
+ "linetoolfibspeedresistancearcs.level10.color": string;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancearcs.level10.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibspeedresistancearcs.level10.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancearcs.level10.visible": boolean;
+ /** Default value: `4.618` */
+ "linetoolfibspeedresistancearcs.level11.coeff": number;
+ /** Default value: `#F23645` */
+ "linetoolfibspeedresistancearcs.level11.color": string;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancearcs.level11.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibspeedresistancearcs.level11.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancearcs.level11.visible": boolean;
+ /** Default value: `0.382` */
+ "linetoolfibspeedresistancearcs.level2.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolfibspeedresistancearcs.level2.color": string;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancearcs.level2.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibspeedresistancearcs.level2.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancearcs.level2.visible": boolean;
+ /** Default value: `0.5` */
+ "linetoolfibspeedresistancearcs.level3.coeff": number;
+ /** Default value: `#089981` */
+ "linetoolfibspeedresistancearcs.level3.color": string;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancearcs.level3.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibspeedresistancearcs.level3.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancearcs.level3.visible": boolean;
+ /** Default value: `0.618` */
+ "linetoolfibspeedresistancearcs.level4.coeff": number;
+ /** Default value: `#4caf50` */
+ "linetoolfibspeedresistancearcs.level4.color": string;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancearcs.level4.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibspeedresistancearcs.level4.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancearcs.level4.visible": boolean;
+ /** Default value: `0.786` */
+ "linetoolfibspeedresistancearcs.level5.coeff": number;
+ /** Default value: `#00bcd4` */
+ "linetoolfibspeedresistancearcs.level5.color": string;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancearcs.level5.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibspeedresistancearcs.level5.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancearcs.level5.visible": boolean;
+ /** Default value: `1` */
+ "linetoolfibspeedresistancearcs.level6.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolfibspeedresistancearcs.level6.color": string;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancearcs.level6.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibspeedresistancearcs.level6.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancearcs.level6.visible": boolean;
+ /** Default value: `1.618` */
+ "linetoolfibspeedresistancearcs.level7.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibspeedresistancearcs.level7.color": string;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancearcs.level7.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibspeedresistancearcs.level7.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancearcs.level7.visible": boolean;
+ /** Default value: `2.618` */
+ "linetoolfibspeedresistancearcs.level8.coeff": number;
+ /** Default value: `#e91e63` */
+ "linetoolfibspeedresistancearcs.level8.color": string;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancearcs.level8.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibspeedresistancearcs.level8.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancearcs.level8.visible": boolean;
+ /** Default value: `3.618` */
+ "linetoolfibspeedresistancearcs.level9.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibspeedresistancearcs.level9.color": string;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancearcs.level9.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibspeedresistancearcs.level9.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancearcs.level9.visible": boolean;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancearcs.showCoeffs": boolean;
+ /** Default value: `80` */
+ "linetoolfibspeedresistancearcs.transparency": number;
+ /** Default value: `#808080` */
+ "linetoolfibspeedresistancearcs.trendline.color": string;
+ /** Default value: `2` */
+ "linetoolfibspeedresistancearcs.trendline.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibspeedresistancearcs.trendline.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancearcs.trendline.visible": boolean;
+}
+/**
+ * Override properties for the Fibspeedresistancefan drawing tool.
+ */
+export interface FibspeedresistancefanLineToolOverrides {
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.fillBackground": boolean;
+ /** Default value: `rgba(21, 56, 153, 0.8)` */
+ "linetoolfibspeedresistancefan.grid.color": string;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancefan.grid.linestyle": number;
+ /** Default value: `1` */
+ "linetoolfibspeedresistancefan.grid.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.grid.visible": boolean;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancefan.hlevel1.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolfibspeedresistancefan.hlevel1.color": string;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.hlevel1.visible": boolean;
+ /** Default value: `0.25` */
+ "linetoolfibspeedresistancefan.hlevel2.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolfibspeedresistancefan.hlevel2.color": string;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.hlevel2.visible": boolean;
+ /** Default value: `0.382` */
+ "linetoolfibspeedresistancefan.hlevel3.coeff": number;
+ /** Default value: `#00bcd4` */
+ "linetoolfibspeedresistancefan.hlevel3.color": string;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.hlevel3.visible": boolean;
+ /** Default value: `0.5` */
+ "linetoolfibspeedresistancefan.hlevel4.coeff": number;
+ /** Default value: `#4caf50` */
+ "linetoolfibspeedresistancefan.hlevel4.color": string;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.hlevel4.visible": boolean;
+ /** Default value: `0.618` */
+ "linetoolfibspeedresistancefan.hlevel5.coeff": number;
+ /** Default value: `#089981` */
+ "linetoolfibspeedresistancefan.hlevel5.color": string;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.hlevel5.visible": boolean;
+ /** Default value: `0.75` */
+ "linetoolfibspeedresistancefan.hlevel6.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibspeedresistancefan.hlevel6.color": string;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.hlevel6.visible": boolean;
+ /** Default value: `1` */
+ "linetoolfibspeedresistancefan.hlevel7.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolfibspeedresistancefan.hlevel7.color": string;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.hlevel7.visible": boolean;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancefan.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibspeedresistancefan.linewidth": number;
+ /** Default value: `false` */
+ "linetoolfibspeedresistancefan.reverse": boolean;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.showBottomLabels": boolean;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.showLeftLabels": boolean;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.showRightLabels": boolean;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.showTopLabels": boolean;
+ /** Default value: `80` */
+ "linetoolfibspeedresistancefan.transparency": number;
+ /** Default value: `0` */
+ "linetoolfibspeedresistancefan.vlevel1.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolfibspeedresistancefan.vlevel1.color": string;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.vlevel1.visible": boolean;
+ /** Default value: `0.25` */
+ "linetoolfibspeedresistancefan.vlevel2.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolfibspeedresistancefan.vlevel2.color": string;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.vlevel2.visible": boolean;
+ /** Default value: `0.382` */
+ "linetoolfibspeedresistancefan.vlevel3.coeff": number;
+ /** Default value: `#00bcd4` */
+ "linetoolfibspeedresistancefan.vlevel3.color": string;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.vlevel3.visible": boolean;
+ /** Default value: `0.5` */
+ "linetoolfibspeedresistancefan.vlevel4.coeff": number;
+ /** Default value: `#4caf50` */
+ "linetoolfibspeedresistancefan.vlevel4.color": string;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.vlevel4.visible": boolean;
+ /** Default value: `0.618` */
+ "linetoolfibspeedresistancefan.vlevel5.coeff": number;
+ /** Default value: `#089981` */
+ "linetoolfibspeedresistancefan.vlevel5.color": string;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.vlevel5.visible": boolean;
+ /** Default value: `0.75` */
+ "linetoolfibspeedresistancefan.vlevel6.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibspeedresistancefan.vlevel6.color": string;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.vlevel6.visible": boolean;
+ /** Default value: `1` */
+ "linetoolfibspeedresistancefan.vlevel7.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolfibspeedresistancefan.vlevel7.color": string;
+ /** Default value: `true` */
+ "linetoolfibspeedresistancefan.vlevel7.visible": boolean;
+}
+/**
+ * Override properties for the Fibtimezone drawing tool.
+ */
+export interface FibtimezoneLineToolOverrides {
+ /** Default value: `false` */
+ "linetoolfibtimezone.fillBackground": boolean;
+ /** Default value: `right` */
+ "linetoolfibtimezone.horzLabelsAlign": string;
+ /** Default value: `0` */
+ "linetoolfibtimezone.level1.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolfibtimezone.level1.color": string;
+ /** Default value: `0` */
+ "linetoolfibtimezone.level1.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibtimezone.level1.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibtimezone.level1.visible": boolean;
+ /** Default value: `55` */
+ "linetoolfibtimezone.level10.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibtimezone.level10.color": string;
+ /** Default value: `0` */
+ "linetoolfibtimezone.level10.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibtimezone.level10.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibtimezone.level10.visible": boolean;
+ /** Default value: `89` */
+ "linetoolfibtimezone.level11.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibtimezone.level11.color": string;
+ /** Default value: `0` */
+ "linetoolfibtimezone.level11.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibtimezone.level11.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibtimezone.level11.visible": boolean;
+ /** Default value: `1` */
+ "linetoolfibtimezone.level2.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibtimezone.level2.color": string;
+ /** Default value: `0` */
+ "linetoolfibtimezone.level2.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibtimezone.level2.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibtimezone.level2.visible": boolean;
+ /** Default value: `2` */
+ "linetoolfibtimezone.level3.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibtimezone.level3.color": string;
+ /** Default value: `0` */
+ "linetoolfibtimezone.level3.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibtimezone.level3.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibtimezone.level3.visible": boolean;
+ /** Default value: `3` */
+ "linetoolfibtimezone.level4.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibtimezone.level4.color": string;
+ /** Default value: `0` */
+ "linetoolfibtimezone.level4.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibtimezone.level4.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibtimezone.level4.visible": boolean;
+ /** Default value: `5` */
+ "linetoolfibtimezone.level5.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibtimezone.level5.color": string;
+ /** Default value: `0` */
+ "linetoolfibtimezone.level5.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibtimezone.level5.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibtimezone.level5.visible": boolean;
+ /** Default value: `8` */
+ "linetoolfibtimezone.level6.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibtimezone.level6.color": string;
+ /** Default value: `0` */
+ "linetoolfibtimezone.level6.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibtimezone.level6.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibtimezone.level6.visible": boolean;
+ /** Default value: `13` */
+ "linetoolfibtimezone.level7.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibtimezone.level7.color": string;
+ /** Default value: `0` */
+ "linetoolfibtimezone.level7.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibtimezone.level7.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibtimezone.level7.visible": boolean;
+ /** Default value: `21` */
+ "linetoolfibtimezone.level8.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibtimezone.level8.color": string;
+ /** Default value: `0` */
+ "linetoolfibtimezone.level8.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibtimezone.level8.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibtimezone.level8.visible": boolean;
+ /** Default value: `34` */
+ "linetoolfibtimezone.level9.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibtimezone.level9.color": string;
+ /** Default value: `0` */
+ "linetoolfibtimezone.level9.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibtimezone.level9.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibtimezone.level9.visible": boolean;
+ /** Default value: `true` */
+ "linetoolfibtimezone.showLabels": boolean;
+ /** Default value: `80` */
+ "linetoolfibtimezone.transparency": number;
+ /** Default value: `#808080` */
+ "linetoolfibtimezone.trendline.color": string;
+ /** Default value: `2` */
+ "linetoolfibtimezone.trendline.linestyle": number;
+ /** Default value: `1` */
+ "linetoolfibtimezone.trendline.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibtimezone.trendline.visible": boolean;
+ /** Default value: `bottom` */
+ "linetoolfibtimezone.vertLabelsAlign": string;
+}
+/**
+ * Override properties for the Fibwedge drawing tool.
+ */
+export interface FibwedgeLineToolOverrides {
+ /** Default value: `true` */
+ "linetoolfibwedge.fillBackground": boolean;
+ /** Default value: `0.236` */
+ "linetoolfibwedge.level1.coeff": number;
+ /** Default value: `#F23645` */
+ "linetoolfibwedge.level1.color": string;
+ /** Default value: `0` */
+ "linetoolfibwedge.level1.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibwedge.level1.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibwedge.level1.visible": boolean;
+ /** Default value: `4.236` */
+ "linetoolfibwedge.level10.coeff": number;
+ /** Default value: `#e91e63` */
+ "linetoolfibwedge.level10.color": string;
+ /** Default value: `0` */
+ "linetoolfibwedge.level10.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibwedge.level10.linewidth": number;
+ /** Default value: `false` */
+ "linetoolfibwedge.level10.visible": boolean;
+ /** Default value: `4.618` */
+ "linetoolfibwedge.level11.coeff": number;
+ /** Default value: `#e91e63` */
+ "linetoolfibwedge.level11.color": string;
+ /** Default value: `0` */
+ "linetoolfibwedge.level11.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibwedge.level11.linewidth": number;
+ /** Default value: `false` */
+ "linetoolfibwedge.level11.visible": boolean;
+ /** Default value: `0.382` */
+ "linetoolfibwedge.level2.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolfibwedge.level2.color": string;
+ /** Default value: `0` */
+ "linetoolfibwedge.level2.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibwedge.level2.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibwedge.level2.visible": boolean;
+ /** Default value: `0.5` */
+ "linetoolfibwedge.level3.coeff": number;
+ /** Default value: `#4caf50` */
+ "linetoolfibwedge.level3.color": string;
+ /** Default value: `0` */
+ "linetoolfibwedge.level3.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibwedge.level3.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibwedge.level3.visible": boolean;
+ /** Default value: `0.618` */
+ "linetoolfibwedge.level4.coeff": number;
+ /** Default value: `#089981` */
+ "linetoolfibwedge.level4.color": string;
+ /** Default value: `0` */
+ "linetoolfibwedge.level4.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibwedge.level4.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibwedge.level4.visible": boolean;
+ /** Default value: `0.786` */
+ "linetoolfibwedge.level5.coeff": number;
+ /** Default value: `#00bcd4` */
+ "linetoolfibwedge.level5.color": string;
+ /** Default value: `0` */
+ "linetoolfibwedge.level5.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibwedge.level5.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibwedge.level5.visible": boolean;
+ /** Default value: `1` */
+ "linetoolfibwedge.level6.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolfibwedge.level6.color": string;
+ /** Default value: `0` */
+ "linetoolfibwedge.level6.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibwedge.level6.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibwedge.level6.visible": boolean;
+ /** Default value: `1.618` */
+ "linetoolfibwedge.level7.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolfibwedge.level7.color": string;
+ /** Default value: `0` */
+ "linetoolfibwedge.level7.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibwedge.level7.linewidth": number;
+ /** Default value: `false` */
+ "linetoolfibwedge.level7.visible": boolean;
+ /** Default value: `2.618` */
+ "linetoolfibwedge.level8.coeff": number;
+ /** Default value: `#F23645` */
+ "linetoolfibwedge.level8.color": string;
+ /** Default value: `0` */
+ "linetoolfibwedge.level8.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibwedge.level8.linewidth": number;
+ /** Default value: `false` */
+ "linetoolfibwedge.level8.visible": boolean;
+ /** Default value: `3.618` */
+ "linetoolfibwedge.level9.coeff": number;
+ /** Default value: `#673ab7` */
+ "linetoolfibwedge.level9.color": string;
+ /** Default value: `0` */
+ "linetoolfibwedge.level9.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibwedge.level9.linewidth": number;
+ /** Default value: `false` */
+ "linetoolfibwedge.level9.visible": boolean;
+ /** Default value: `true` */
+ "linetoolfibwedge.showCoeffs": boolean;
+ /** Default value: `80` */
+ "linetoolfibwedge.transparency": number;
+ /** Default value: `#808080` */
+ "linetoolfibwedge.trendline.color": string;
+ /** Default value: `0` */
+ "linetoolfibwedge.trendline.linestyle": number;
+ /** Default value: `2` */
+ "linetoolfibwedge.trendline.linewidth": number;
+ /** Default value: `true` */
+ "linetoolfibwedge.trendline.visible": boolean;
+}
+/**
+ * Overrides for the '52 Week High/Low' indicator.
+ *
+ * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}.
+ */
+export 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}.
+ */
+export 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;
+}
+/**
+ * Override properties for the Fivepointspattern drawing tool.
+ */
+export interface FivepointspatternLineToolOverrides {
+ /** Default value: `#2962FF` */
+ "linetool5pointspattern.backgroundColor": string;
+ /** Default value: `false` */
+ "linetool5pointspattern.bold": boolean;
+ /** Default value: `#2962FF` */
+ "linetool5pointspattern.color": string;
+ /** Default value: `true` */
+ "linetool5pointspattern.fillBackground": boolean;
+ /** Default value: `12` */
+ "linetool5pointspattern.fontsize": number;
+ /** Default value: `false` */
+ "linetool5pointspattern.italic": boolean;
+ /** Default value: `2` */
+ "linetool5pointspattern.linewidth": number;
+ /** Default value: `#ffffff` */
+ "linetool5pointspattern.textcolor": string;
+ /** Default value: `85` */
+ "linetool5pointspattern.transparency": number;
+}
+/**
+ * Overrides for the 'Fixed Range' indicator.
+ *
+ * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}.
+ */
+export 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;
+}
+/**
+ * Override properties for the Flagmark drawing tool.
+ */
+export interface FlagmarkLineToolOverrides {
+ /** Default value: `#2962FF` */
+ "linetoolflagmark.flagColor": string;
+}
+/**
+ * Override properties for the Flatbottom drawing tool.
+ */
+export interface FlatbottomLineToolOverrides {
+ /** Default value: `rgba(255, 152, 0, 0.2)` */
+ "linetoolflatbottom.backgroundColor": string;
+ /** Default value: `false` */
+ "linetoolflatbottom.bold": boolean;
+ /** Default value: `false` */
+ "linetoolflatbottom.extendLeft": boolean;
+ /** Default value: `false` */
+ "linetoolflatbottom.extendRight": boolean;
+ /** Default value: `true` */
+ "linetoolflatbottom.fillBackground": boolean;
+ /** Default value: `12` */
+ "linetoolflatbottom.fontsize": number;
+ /** Default value: `false` */
+ "linetoolflatbottom.italic": boolean;
+ /** Default value: `false` */
+ "linetoolflatbottom.labelBold": boolean;
+ /** Default value: `14` */
+ "linetoolflatbottom.labelFontSize": number;
+ /** Default value: `left` */
+ "linetoolflatbottom.labelHorzAlign": string;
+ /** Default value: `false` */
+ "linetoolflatbottom.labelItalic": boolean;
+ /** Default value: `#FF9800` */
+ "linetoolflatbottom.labelTextColor": string;
+ /** Default value: `bottom` */
+ "linetoolflatbottom.labelVertAlign": string;
+ /** Default value: `false` */
+ "linetoolflatbottom.labelVisible": boolean;
+ /** Default value: `0` */
+ "linetoolflatbottom.leftEnd": number;
+ /** Default value: `#FF9800` */
+ "linetoolflatbottom.linecolor": string;
+ /** Default value: `0` */
+ "linetoolflatbottom.linestyle": number;
+ /** Default value: `2` */
+ "linetoolflatbottom.linewidth": number;
+ /** Default value: `0` */
+ "linetoolflatbottom.rightEnd": number;
+ /** Default value: `false` */
+ "linetoolflatbottom.showBarsRange": boolean;
+ /** Default value: `false` */
+ "linetoolflatbottom.showDateTimeRange": boolean;
+ /** Default value: `false` */
+ "linetoolflatbottom.showPriceRange": boolean;
+ /** Default value: `false` */
+ "linetoolflatbottom.showPrices": boolean;
+ /** Default value: `#FF9800` */
+ "linetoolflatbottom.textcolor": string;
+ /** Default value: `20` */
+ "linetoolflatbottom.transparency": number;
+}
+/**
+ * Format options
+ */
+export interface FormatterFormatOptions {
+ /**
+ * Ignore locale number format settings like decimal/thousands separators
+ */
+ ignoreLocaleNumberFormat?: boolean;
+}
+/**
+ * Format options
+ */
+export interface FormatterParseOptions {
+ /**
+ * Ignore locale number format settings like decimal/thousands separators
+ */
+ ignoreLocaleNumberFormat?: boolean;
+}
+export interface FormatterParseResult {
+ /** Returns if the formatter support parsing */
+ res: boolean;
+}
+/**
+ * Override properties for the Ganncomplex drawing tool.
+ */
+export interface GanncomplexLineToolOverrides {
+ /** Default value: `#FF9800` */
+ "linetoolganncomplex.arcs.0.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.arcs.0.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.arcs.0.width": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.arcs.0.x": number;
+ /** Default value: `0` */
+ "linetoolganncomplex.arcs.0.y": number;
+ /** Default value: `#FF9800` */
+ "linetoolganncomplex.arcs.1.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.arcs.1.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.arcs.1.width": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.arcs.1.x": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.arcs.1.y": number;
+ /** Default value: `#2962FF` */
+ "linetoolganncomplex.arcs.10.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.arcs.10.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.arcs.10.width": number;
+ /** Default value: `5` */
+ "linetoolganncomplex.arcs.10.x": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.arcs.10.y": number;
+ /** Default value: `#FF9800` */
+ "linetoolganncomplex.arcs.2.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.arcs.2.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.arcs.2.width": number;
+ /** Default value: `1.5` */
+ "linetoolganncomplex.arcs.2.x": number;
+ /** Default value: `0` */
+ "linetoolganncomplex.arcs.2.y": number;
+ /** Default value: `#00bcd4` */
+ "linetoolganncomplex.arcs.3.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.arcs.3.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.arcs.3.width": number;
+ /** Default value: `2` */
+ "linetoolganncomplex.arcs.3.x": number;
+ /** Default value: `0` */
+ "linetoolganncomplex.arcs.3.y": number;
+ /** Default value: `#00bcd4` */
+ "linetoolganncomplex.arcs.4.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.arcs.4.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.arcs.4.width": number;
+ /** Default value: `2` */
+ "linetoolganncomplex.arcs.4.x": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.arcs.4.y": number;
+ /** Default value: `#4caf50` */
+ "linetoolganncomplex.arcs.5.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.arcs.5.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.arcs.5.width": number;
+ /** Default value: `3` */
+ "linetoolganncomplex.arcs.5.x": number;
+ /** Default value: `0` */
+ "linetoolganncomplex.arcs.5.y": number;
+ /** Default value: `#4caf50` */
+ "linetoolganncomplex.arcs.6.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.arcs.6.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.arcs.6.width": number;
+ /** Default value: `3` */
+ "linetoolganncomplex.arcs.6.x": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.arcs.6.y": number;
+ /** Default value: `#089981` */
+ "linetoolganncomplex.arcs.7.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.arcs.7.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.arcs.7.width": number;
+ /** Default value: `4` */
+ "linetoolganncomplex.arcs.7.x": number;
+ /** Default value: `0` */
+ "linetoolganncomplex.arcs.7.y": number;
+ /** Default value: `#089981` */
+ "linetoolganncomplex.arcs.8.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.arcs.8.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.arcs.8.width": number;
+ /** Default value: `4` */
+ "linetoolganncomplex.arcs.8.x": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.arcs.8.y": number;
+ /** Default value: `#2962FF` */
+ "linetoolganncomplex.arcs.9.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.arcs.9.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.arcs.9.width": number;
+ /** Default value: `5` */
+ "linetoolganncomplex.arcs.9.x": number;
+ /** Default value: `0` */
+ "linetoolganncomplex.arcs.9.y": number;
+ /** Default value: `true` */
+ "linetoolganncomplex.arcsBackground.fillBackground": boolean;
+ /** Default value: `80` */
+ "linetoolganncomplex.arcsBackground.transparency": number;
+ /** Default value: `#B39DDB` */
+ "linetoolganncomplex.fanlines.0.color": string;
+ /** Default value: `false` */
+ "linetoolganncomplex.fanlines.0.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.fanlines.0.width": number;
+ /** Default value: `8` */
+ "linetoolganncomplex.fanlines.0.x": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.fanlines.0.y": number;
+ /** Default value: `#F23645` */
+ "linetoolganncomplex.fanlines.1.color": string;
+ /** Default value: `false` */
+ "linetoolganncomplex.fanlines.1.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.fanlines.1.width": number;
+ /** Default value: `5` */
+ "linetoolganncomplex.fanlines.1.x": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.fanlines.1.y": number;
+ /** Default value: `#B39DDB` */
+ "linetoolganncomplex.fanlines.10.color": string;
+ /** Default value: `false` */
+ "linetoolganncomplex.fanlines.10.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.fanlines.10.width": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.fanlines.10.x": number;
+ /** Default value: `8` */
+ "linetoolganncomplex.fanlines.10.y": number;
+ /** Default value: `#808080` */
+ "linetoolganncomplex.fanlines.2.color": string;
+ /** Default value: `false` */
+ "linetoolganncomplex.fanlines.2.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.fanlines.2.width": number;
+ /** Default value: `4` */
+ "linetoolganncomplex.fanlines.2.x": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.fanlines.2.y": number;
+ /** Default value: `#FF9800` */
+ "linetoolganncomplex.fanlines.3.color": string;
+ /** Default value: `false` */
+ "linetoolganncomplex.fanlines.3.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.fanlines.3.width": number;
+ /** Default value: `3` */
+ "linetoolganncomplex.fanlines.3.x": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.fanlines.3.y": number;
+ /** Default value: `#00bcd4` */
+ "linetoolganncomplex.fanlines.4.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.fanlines.4.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.fanlines.4.width": number;
+ /** Default value: `2` */
+ "linetoolganncomplex.fanlines.4.x": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.fanlines.4.y": number;
+ /** Default value: `#4caf50` */
+ "linetoolganncomplex.fanlines.5.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.fanlines.5.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.fanlines.5.width": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.fanlines.5.x": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.fanlines.5.y": number;
+ /** Default value: `#089981` */
+ "linetoolganncomplex.fanlines.6.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.fanlines.6.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.fanlines.6.width": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.fanlines.6.x": number;
+ /** Default value: `2` */
+ "linetoolganncomplex.fanlines.6.y": number;
+ /** Default value: `#089981` */
+ "linetoolganncomplex.fanlines.7.color": string;
+ /** Default value: `false` */
+ "linetoolganncomplex.fanlines.7.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.fanlines.7.width": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.fanlines.7.x": number;
+ /** Default value: `3` */
+ "linetoolganncomplex.fanlines.7.y": number;
+ /** Default value: `#2962FF` */
+ "linetoolganncomplex.fanlines.8.color": string;
+ /** Default value: `false` */
+ "linetoolganncomplex.fanlines.8.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.fanlines.8.width": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.fanlines.8.x": number;
+ /** Default value: `4` */
+ "linetoolganncomplex.fanlines.8.y": number;
+ /** Default value: `#9575cd` */
+ "linetoolganncomplex.fanlines.9.color": string;
+ /** Default value: `false` */
+ "linetoolganncomplex.fanlines.9.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.fanlines.9.width": number;
+ /** Default value: `1` */
+ "linetoolganncomplex.fanlines.9.x": number;
+ /** Default value: `5` */
+ "linetoolganncomplex.fanlines.9.y": number;
+ /** Default value: `false` */
+ "linetoolganncomplex.fillBackground": boolean;
+ /** Default value: `false` */
+ "linetoolganncomplex.labelsStyle.bold": boolean;
+ /** Default value: `12` */
+ "linetoolganncomplex.labelsStyle.fontSize": number;
+ /** Default value: `false` */
+ "linetoolganncomplex.labelsStyle.italic": boolean;
+ /** Default value: `#808080` */
+ "linetoolganncomplex.levels.0.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.levels.0.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.levels.0.width": number;
+ /** Default value: `#FF9800` */
+ "linetoolganncomplex.levels.1.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.levels.1.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.levels.1.width": number;
+ /** Default value: `#00bcd4` */
+ "linetoolganncomplex.levels.2.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.levels.2.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.levels.2.width": number;
+ /** Default value: `#4caf50` */
+ "linetoolganncomplex.levels.3.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.levels.3.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.levels.3.width": number;
+ /** Default value: `#089981` */
+ "linetoolganncomplex.levels.4.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.levels.4.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.levels.4.width": number;
+ /** Default value: `#808080` */
+ "linetoolganncomplex.levels.5.color": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.levels.5.visible": boolean;
+ /** Default value: `2` */
+ "linetoolganncomplex.levels.5.width": number;
+ /** Default value: `false` */
+ "linetoolganncomplex.reverse": boolean;
+ /** Default value: `undefined` */
+ "linetoolganncomplex.scaleRatio": string;
+ /** Default value: `true` */
+ "linetoolganncomplex.showLabels": boolean;
+}
+/**
+ * Override properties for the Gannfan drawing tool.
+ */
+export interface GannfanLineToolOverrides {
+ /** Default value: `true` */
+ "linetoolgannfan.fillBackground": boolean;
+ /** Default value: `1` */
+ "linetoolgannfan.level1.coeff1": number;
+ /** Default value: `8` */
+ "linetoolgannfan.level1.coeff2": number;
+ /** Default value: `#FF9800` */
+ "linetoolgannfan.level1.color": string;
+ /** Default value: `0` */
+ "linetoolgannfan.level1.linestyle": number;
+ /** Default value: `2` */
+ "linetoolgannfan.level1.linewidth": number;
+ /** Default value: `true` */
+ "linetoolgannfan.level1.visible": boolean;
+ /** Default value: `1` */
+ "linetoolgannfan.level2.coeff1": number;
+ /** Default value: `4` */
+ "linetoolgannfan.level2.coeff2": number;
+ /** Default value: `#089981` */
+ "linetoolgannfan.level2.color": string;
+ /** Default value: `0` */
+ "linetoolgannfan.level2.linestyle": number;
+ /** Default value: `2` */
+ "linetoolgannfan.level2.linewidth": number;
+ /** Default value: `true` */
+ "linetoolgannfan.level2.visible": boolean;
+ /** Default value: `1` */
+ "linetoolgannfan.level3.coeff1": number;
+ /** Default value: `3` */
+ "linetoolgannfan.level3.coeff2": number;
+ /** Default value: `#4caf50` */
+ "linetoolgannfan.level3.color": string;
+ /** Default value: `0` */
+ "linetoolgannfan.level3.linestyle": number;
+ /** Default value: `2` */
+ "linetoolgannfan.level3.linewidth": number;
+ /** Default value: `true` */
+ "linetoolgannfan.level3.visible": boolean;
+ /** Default value: `1` */
+ "linetoolgannfan.level4.coeff1": number;
+ /** Default value: `2` */
+ "linetoolgannfan.level4.coeff2": number;
+ /** Default value: `#089981` */
+ "linetoolgannfan.level4.color": string;
+ /** Default value: `0` */
+ "linetoolgannfan.level4.linestyle": number;
+ /** Default value: `2` */
+ "linetoolgannfan.level4.linewidth": number;
+ /** Default value: `true` */
+ "linetoolgannfan.level4.visible": boolean;
+ /** Default value: `1` */
+ "linetoolgannfan.level5.coeff1": number;
+ /** Default value: `1` */
+ "linetoolgannfan.level5.coeff2": number;
+ /** Default value: `#00bcd4` */
+ "linetoolgannfan.level5.color": string;
+ /** Default value: `0` */
+ "linetoolgannfan.level5.linestyle": number;
+ /** Default value: `2` */
+ "linetoolgannfan.level5.linewidth": number;
+ /** Default value: `true` */
+ "linetoolgannfan.level5.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfan.level6.coeff1": number;
+ /** Default value: `1` */
+ "linetoolgannfan.level6.coeff2": number;
+ /** Default value: `#2962FF` */
+ "linetoolgannfan.level6.color": string;
+ /** Default value: `0` */
+ "linetoolgannfan.level6.linestyle": number;
+ /** Default value: `2` */
+ "linetoolgannfan.level6.linewidth": number;
+ /** Default value: `true` */
+ "linetoolgannfan.level6.visible": boolean;
+ /** Default value: `3` */
+ "linetoolgannfan.level7.coeff1": number;
+ /** Default value: `1` */
+ "linetoolgannfan.level7.coeff2": number;
+ /** Default value: `#9c27b0` */
+ "linetoolgannfan.level7.color": string;
+ /** Default value: `0` */
+ "linetoolgannfan.level7.linestyle": number;
+ /** Default value: `2` */
+ "linetoolgannfan.level7.linewidth": number;
+ /** Default value: `true` */
+ "linetoolgannfan.level7.visible": boolean;
+ /** Default value: `4` */
+ "linetoolgannfan.level8.coeff1": number;
+ /** Default value: `1` */
+ "linetoolgannfan.level8.coeff2": number;
+ /** Default value: `#e91e63` */
+ "linetoolgannfan.level8.color": string;
+ /** Default value: `0` */
+ "linetoolgannfan.level8.linestyle": number;
+ /** Default value: `2` */
+ "linetoolgannfan.level8.linewidth": number;
+ /** Default value: `true` */
+ "linetoolgannfan.level8.visible": boolean;
+ /** Default value: `8` */
+ "linetoolgannfan.level9.coeff1": number;
+ /** Default value: `1` */
+ "linetoolgannfan.level9.coeff2": number;
+ /** Default value: `#F23645` */
+ "linetoolgannfan.level9.color": string;
+ /** Default value: `0` */
+ "linetoolgannfan.level9.linestyle": number;
+ /** Default value: `2` */
+ "linetoolgannfan.level9.linewidth": number;
+ /** Default value: `true` */
+ "linetoolgannfan.level9.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfan.linewidth": number;
+ /** Default value: `true` */
+ "linetoolgannfan.showLabels": boolean;
+ /** Default value: `80` */
+ "linetoolgannfan.transparency": number;
+}
+/**
+ * Override properties for the Gannfixed drawing tool.
+ */
+export interface GannfixedLineToolOverrides {
+ /** Default value: `#FF9800` */
+ "linetoolgannfixed.arcs.0.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.arcs.0.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.arcs.0.width": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.arcs.0.x": number;
+ /** Default value: `0` */
+ "linetoolgannfixed.arcs.0.y": number;
+ /** Default value: `#FF9800` */
+ "linetoolgannfixed.arcs.1.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.arcs.1.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.arcs.1.width": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.arcs.1.x": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.arcs.1.y": number;
+ /** Default value: `#2962FF` */
+ "linetoolgannfixed.arcs.10.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.arcs.10.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.arcs.10.width": number;
+ /** Default value: `5` */
+ "linetoolgannfixed.arcs.10.x": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.arcs.10.y": number;
+ /** Default value: `#FF9800` */
+ "linetoolgannfixed.arcs.2.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.arcs.2.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.arcs.2.width": number;
+ /** Default value: `1.5` */
+ "linetoolgannfixed.arcs.2.x": number;
+ /** Default value: `0` */
+ "linetoolgannfixed.arcs.2.y": number;
+ /** Default value: `#00bcd4` */
+ "linetoolgannfixed.arcs.3.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.arcs.3.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.arcs.3.width": number;
+ /** Default value: `2` */
+ "linetoolgannfixed.arcs.3.x": number;
+ /** Default value: `0` */
+ "linetoolgannfixed.arcs.3.y": number;
+ /** Default value: `#00bcd4` */
+ "linetoolgannfixed.arcs.4.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.arcs.4.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.arcs.4.width": number;
+ /** Default value: `2` */
+ "linetoolgannfixed.arcs.4.x": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.arcs.4.y": number;
+ /** Default value: `#4caf50` */
+ "linetoolgannfixed.arcs.5.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.arcs.5.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.arcs.5.width": number;
+ /** Default value: `3` */
+ "linetoolgannfixed.arcs.5.x": number;
+ /** Default value: `0` */
+ "linetoolgannfixed.arcs.5.y": number;
+ /** Default value: `#4caf50` */
+ "linetoolgannfixed.arcs.6.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.arcs.6.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.arcs.6.width": number;
+ /** Default value: `3` */
+ "linetoolgannfixed.arcs.6.x": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.arcs.6.y": number;
+ /** Default value: `#089981` */
+ "linetoolgannfixed.arcs.7.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.arcs.7.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.arcs.7.width": number;
+ /** Default value: `4` */
+ "linetoolgannfixed.arcs.7.x": number;
+ /** Default value: `0` */
+ "linetoolgannfixed.arcs.7.y": number;
+ /** Default value: `#089981` */
+ "linetoolgannfixed.arcs.8.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.arcs.8.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.arcs.8.width": number;
+ /** Default value: `4` */
+ "linetoolgannfixed.arcs.8.x": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.arcs.8.y": number;
+ /** Default value: `#2962FF` */
+ "linetoolgannfixed.arcs.9.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.arcs.9.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.arcs.9.width": number;
+ /** Default value: `5` */
+ "linetoolgannfixed.arcs.9.x": number;
+ /** Default value: `0` */
+ "linetoolgannfixed.arcs.9.y": number;
+ /** Default value: `true` */
+ "linetoolgannfixed.arcsBackground.fillBackground": boolean;
+ /** Default value: `80` */
+ "linetoolgannfixed.arcsBackground.transparency": number;
+ /** Default value: `#B39DDB` */
+ "linetoolgannfixed.fanlines.0.color": string;
+ /** Default value: `false` */
+ "linetoolgannfixed.fanlines.0.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.fanlines.0.width": number;
+ /** Default value: `8` */
+ "linetoolgannfixed.fanlines.0.x": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.fanlines.0.y": number;
+ /** Default value: `#F23645` */
+ "linetoolgannfixed.fanlines.1.color": string;
+ /** Default value: `false` */
+ "linetoolgannfixed.fanlines.1.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.fanlines.1.width": number;
+ /** Default value: `5` */
+ "linetoolgannfixed.fanlines.1.x": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.fanlines.1.y": number;
+ /** Default value: `#B39DDB` */
+ "linetoolgannfixed.fanlines.10.color": string;
+ /** Default value: `false` */
+ "linetoolgannfixed.fanlines.10.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.fanlines.10.width": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.fanlines.10.x": number;
+ /** Default value: `8` */
+ "linetoolgannfixed.fanlines.10.y": number;
+ /** Default value: `#808080` */
+ "linetoolgannfixed.fanlines.2.color": string;
+ /** Default value: `false` */
+ "linetoolgannfixed.fanlines.2.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.fanlines.2.width": number;
+ /** Default value: `4` */
+ "linetoolgannfixed.fanlines.2.x": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.fanlines.2.y": number;
+ /** Default value: `#FF9800` */
+ "linetoolgannfixed.fanlines.3.color": string;
+ /** Default value: `false` */
+ "linetoolgannfixed.fanlines.3.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.fanlines.3.width": number;
+ /** Default value: `3` */
+ "linetoolgannfixed.fanlines.3.x": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.fanlines.3.y": number;
+ /** Default value: `#00bcd4` */
+ "linetoolgannfixed.fanlines.4.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.fanlines.4.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.fanlines.4.width": number;
+ /** Default value: `2` */
+ "linetoolgannfixed.fanlines.4.x": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.fanlines.4.y": number;
+ /** Default value: `#4caf50` */
+ "linetoolgannfixed.fanlines.5.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.fanlines.5.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.fanlines.5.width": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.fanlines.5.x": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.fanlines.5.y": number;
+ /** Default value: `#089981` */
+ "linetoolgannfixed.fanlines.6.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.fanlines.6.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.fanlines.6.width": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.fanlines.6.x": number;
+ /** Default value: `2` */
+ "linetoolgannfixed.fanlines.6.y": number;
+ /** Default value: `#089981` */
+ "linetoolgannfixed.fanlines.7.color": string;
+ /** Default value: `false` */
+ "linetoolgannfixed.fanlines.7.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.fanlines.7.width": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.fanlines.7.x": number;
+ /** Default value: `3` */
+ "linetoolgannfixed.fanlines.7.y": number;
+ /** Default value: `#2962FF` */
+ "linetoolgannfixed.fanlines.8.color": string;
+ /** Default value: `false` */
+ "linetoolgannfixed.fanlines.8.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.fanlines.8.width": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.fanlines.8.x": number;
+ /** Default value: `4` */
+ "linetoolgannfixed.fanlines.8.y": number;
+ /** Default value: `#9575cd` */
+ "linetoolgannfixed.fanlines.9.color": string;
+ /** Default value: `false` */
+ "linetoolgannfixed.fanlines.9.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.fanlines.9.width": number;
+ /** Default value: `1` */
+ "linetoolgannfixed.fanlines.9.x": number;
+ /** Default value: `5` */
+ "linetoolgannfixed.fanlines.9.y": number;
+ /** Default value: `false` */
+ "linetoolgannfixed.fillBackground": boolean;
+ /** Default value: `#808080` */
+ "linetoolgannfixed.levels.0.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.levels.0.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.levels.0.width": number;
+ /** Default value: `#FF9800` */
+ "linetoolgannfixed.levels.1.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.levels.1.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.levels.1.width": number;
+ /** Default value: `#00bcd4` */
+ "linetoolgannfixed.levels.2.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.levels.2.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.levels.2.width": number;
+ /** Default value: `#4caf50` */
+ "linetoolgannfixed.levels.3.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.levels.3.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.levels.3.width": number;
+ /** Default value: `#089981` */
+ "linetoolgannfixed.levels.4.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.levels.4.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.levels.4.width": number;
+ /** Default value: `#808080` */
+ "linetoolgannfixed.levels.5.color": string;
+ /** Default value: `true` */
+ "linetoolgannfixed.levels.5.visible": boolean;
+ /** Default value: `2` */
+ "linetoolgannfixed.levels.5.width": number;
+ /** Default value: `false` */
+ "linetoolgannfixed.reverse": boolean;
+}
+/**
+ * Override properties for the Gannsquare drawing tool.
+ */
+export interface GannsquareLineToolOverrides {
+ /** Default value: `rgba(21, 56, 153, 0.8)` */
+ "linetoolgannsquare.color": string;
+ /** Default value: `#9C9C9C` */
+ "linetoolgannsquare.fans.color": string;
+ /** Default value: `false` */
+ "linetoolgannsquare.fans.visible": boolean;
+ /** Default value: `true` */
+ "linetoolgannsquare.fillHorzBackground": boolean;
+ /** Default value: `true` */
+ "linetoolgannsquare.fillVertBackground": boolean;
+ /** Default value: `0` */
+ "linetoolgannsquare.hlevel1.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolgannsquare.hlevel1.color": string;
+ /** Default value: `true` */
+ "linetoolgannsquare.hlevel1.visible": boolean;
+ /** Default value: `0.25` */
+ "linetoolgannsquare.hlevel2.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolgannsquare.hlevel2.color": string;
+ /** Default value: `true` */
+ "linetoolgannsquare.hlevel2.visible": boolean;
+ /** Default value: `0.382` */
+ "linetoolgannsquare.hlevel3.coeff": number;
+ /** Default value: `#00bcd4` */
+ "linetoolgannsquare.hlevel3.color": string;
+ /** Default value: `true` */
+ "linetoolgannsquare.hlevel3.visible": boolean;
+ /** Default value: `0.5` */
+ "linetoolgannsquare.hlevel4.coeff": number;
+ /** Default value: `#4caf50` */
+ "linetoolgannsquare.hlevel4.color": string;
+ /** Default value: `true` */
+ "linetoolgannsquare.hlevel4.visible": boolean;
+ /** Default value: `0.618` */
+ "linetoolgannsquare.hlevel5.coeff": number;
+ /** Default value: `#089981` */
+ "linetoolgannsquare.hlevel5.color": string;
+ /** Default value: `true` */
+ "linetoolgannsquare.hlevel5.visible": boolean;
+ /** Default value: `0.75` */
+ "linetoolgannsquare.hlevel6.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolgannsquare.hlevel6.color": string;
+ /** Default value: `true` */
+ "linetoolgannsquare.hlevel6.visible": boolean;
+ /** Default value: `1` */
+ "linetoolgannsquare.hlevel7.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolgannsquare.hlevel7.color": string;
+ /** Default value: `true` */
+ "linetoolgannsquare.hlevel7.visible": boolean;
+ /** Default value: `80` */
+ "linetoolgannsquare.horzTransparency": number;
+ /** Default value: `0` */
+ "linetoolgannsquare.linestyle": number;
+ /** Default value: `2` */
+ "linetoolgannsquare.linewidth": number;
+ /** Default value: `false` */
+ "linetoolgannsquare.reverse": boolean;
+ /** Default value: `true` */
+ "linetoolgannsquare.showBottomLabels": boolean;
+ /** Default value: `true` */
+ "linetoolgannsquare.showLeftLabels": boolean;
+ /** Default value: `true` */
+ "linetoolgannsquare.showRightLabels": boolean;
+ /** Default value: `true` */
+ "linetoolgannsquare.showTopLabels": boolean;
+ /** Default value: `80` */
+ "linetoolgannsquare.vertTransparency": number;
+ /** Default value: `0` */
+ "linetoolgannsquare.vlevel1.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolgannsquare.vlevel1.color": string;
+ /** Default value: `true` */
+ "linetoolgannsquare.vlevel1.visible": boolean;
+ /** Default value: `0.25` */
+ "linetoolgannsquare.vlevel2.coeff": number;
+ /** Default value: `#FF9800` */
+ "linetoolgannsquare.vlevel2.color": string;
+ /** Default value: `true` */
+ "linetoolgannsquare.vlevel2.visible": boolean;
+ /** Default value: `0.382` */
+ "linetoolgannsquare.vlevel3.coeff": number;
+ /** Default value: `#00bcd4` */
+ "linetoolgannsquare.vlevel3.color": string;
+ /** Default value: `true` */
+ "linetoolgannsquare.vlevel3.visible": boolean;
+ /** Default value: `0.5` */
+ "linetoolgannsquare.vlevel4.coeff": number;
+ /** Default value: `#4caf50` */
+ "linetoolgannsquare.vlevel4.color": string;
+ /** Default value: `true` */
+ "linetoolgannsquare.vlevel4.visible": boolean;
+ /** Default value: `0.618` */
+ "linetoolgannsquare.vlevel5.coeff": number;
+ /** Default value: `#089981` */
+ "linetoolgannsquare.vlevel5.color": string;
+ /** Default value: `true` */
+ "linetoolgannsquare.vlevel5.visible": boolean;
+ /** Default value: `0.75` */
+ "linetoolgannsquare.vlevel6.coeff": number;
+ /** Default value: `#2962FF` */
+ "linetoolgannsquare.vlevel6.color": string;
+ /** Default value: `true` */
+ "linetoolgannsquare.vlevel6.visible": boolean;
+ /** Default value: `1` */
+ "linetoolgannsquare.vlevel7.coeff": number;
+ /** Default value: `#808080` */
+ "linetoolgannsquare.vlevel7.color": string;
+ /** Default value: `true` */
+ "linetoolgannsquare.vlevel7.visible": boolean;
+}
+export interface GetNewsResponse {
+ /** Title */
+ title?: string;
+ /** Retrieved news items */
+ newsItems: NewsItem[];
+}
+/**
+ * Override properties for the Ghostfeed drawing tool.
+ */
+export interface GhostfeedLineToolOverrides {
+ /** Default value: `20` */
+ "linetoolghostfeed.averageHL": number;
+ /** Default value: `#378658` */
+ "linetoolghostfeed.candleStyle.borderColor": string;
+ /** Default value: `#F23645` */
+ "linetoolghostfeed.candleStyle.borderDownColor": string;
+ /** Default value: `#089981` */
+ "linetoolghostfeed.candleStyle.borderUpColor": string;
+ /** Default value: `#FAA1A4` */
+ "linetoolghostfeed.candleStyle.downColor": string;
+ /** Default value: `true` */
+ "linetoolghostfeed.candleStyle.drawBorder": boolean;
+ /** Default value: `true` */
+ "linetoolghostfeed.candleStyle.drawWick": boolean;
+ /** Default value: `#ACE5DC` */
+ "linetoolghostfeed.candleStyle.upColor": string;
+ /** Default value: `#808080` */
+ "linetoolghostfeed.candleStyle.wickColor": string;
+ /** Default value: `50` */
+ "linetoolghostfeed.transparency": number;
+ /** Default value: `50` */
+ "linetoolghostfeed.variance": number;
+}
+export 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}.
+ */
+export 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 */
+export 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;
+}
+export interface HLCAreaStylePreferences {
+ /** High line color */
+ highLineColor: string;
+ /** High line style */
+ highLineStyle: number;
+ /** High line width */
+ highLineWidth: number;
+ /** 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;
+}
+export interface HLCBarsStylePreferences {
+ /** Bar color */
+ color: string;
+ /** Draw thin bars. Default - `true` */
+ thinBars: boolean;
+}
+/**
+ * Override properties for the Headandshoulders drawing tool.
+ */
+export interface HeadandshouldersLineToolOverrides {
+ /** Default value: `#089981` */
+ "linetoolheadandshoulders.backgroundColor": string;
+ /** Default value: `false` */
+ "linetoolheadandshoulders.bold": boolean;
+ /** Default value: `#089981` */
+ "linetoolheadandshoulders.color": string;
+ /** Default value: `true` */
+ "linetoolheadandshoulders.fillBackground": boolean;
+ /** Default value: `12` */
+ "linetoolheadandshoulders.fontsize": number;
+ /** Default value: `false` */
+ "linetoolheadandshoulders.italic": boolean;
+ /** Default value: `2` */
+ "linetoolheadandshoulders.linewidth": number;
+ /** Default value: `#ffffff` */
+ "linetoolheadandshoulders.textcolor": string;
+ /** Default value: `85` */
+ "linetoolheadandshoulders.transparency": number;
+}
+export 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;
+}
+export 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;
+}
+/**
+ * Override properties for the Highlighter drawing tool.
+ */
+export interface HighlighterLineToolOverrides {
+ /** Default value: `rgba(242, 54, 69, 0.2)` */
+ "linetoolhighlighter.linecolor": string;
+ /** Default value: `5` */
+ "linetoolhighlighter.smooth": number;
+ /** Default value: `80` */
+ "linetoolhighlighter.transparency": number;
+ /** Default value: `20` */
+ "linetoolhighlighter.width": number;
+}
+/**
+ * Overrides for the 'Historical Volatility' indicator.
+ *
+ * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}.
+ */
+export 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.
+ */
+export 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;
+}
+export 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
+ */
+export 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;
+}
+/**
+ * Override properties for the Horzline drawing tool.
+ */
+export interface HorzlineLineToolOverrides {
+ /** Default value: `false` */
+ "linetoolhorzline.bold": boolean;
+ /** Default value: `12` */
+ "linetoolhorzline.fontsize": number;
+ /** Default value: `center` */
+ "linetoolhorzline.horzLabelsAlign": string;
+ /** Default value: `false` */
+ "linetoolhorzline.italic": boolean;
+ /** Default value: `#2962FF` */
+ "linetoolhorzline.linecolor": string;
+ /** Default value: `0` */
+ "linetoolhorzline.linestyle": number;
+ /** Default value: `2` */
+ "linetoolhorzline.linewidth": number;
+ /** Default value: `false` */
+ "linetoolhorzline.showLabel": boolean;
+ /** Default value: `true` */
+ "linetoolhorzline.showPrice": boolean;
+ /** Default value: `#2962FF` */
+ "linetoolhorzline.textcolor": string;
+ /** Default value: `middle` */
+ "linetoolhorzline.vertLabelsAlign": string;
+}
+/**
+ * Override properties for the Horzray drawing tool.
+ */
+export interface HorzrayLineToolOverrides {
+ /** Default value: `false` */
+ "linetoolhorzray.bold": boolean;
+ /** Default value: `12` */
+ "linetoolhorzray.fontsize": number;
+ /** Default value: `center` */
+ "linetoolhorzray.horzLabelsAlign": string;
+ /** Default value: `false` */
+ "linetoolhorzray.italic": boolean;
+ /** Default value: `#2962FF` */
+ "linetoolhorzray.linecolor": string;
+ /** Default value: `0` */
+ "linetoolhorzray.linestyle": number;
+ /** Default value: `2` */
+ "linetoolhorzray.linewidth": number;
+ /** Default value: `false` */
+ "linetoolhorzray.showLabel": boolean;
+ /** Default value: `true` */
+ "linetoolhorzray.showPrice": boolean;
+ /** Default value: `#2962FF` */
+ "linetoolhorzray.textcolor": string;
+ /** Default value: `top` */
+ "linetoolhorzray.vertLabelsAlign": string;
+}
+/**
+ * Overrides for the 'Hull Moving Average' indicator.
+ *
+ * Use these properties to customize indicator via {@link IChartWidgetApi.createStudy} and {@link IStudyApi.applyOverrides}.
+ */
+export 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;
+}
+export interface HyperlinkInfo {
+ text: string;
+ url: string;
+}
+export interface IAction extends IMenuItem, IDestroyable {
+ /** @inheritDoc */
+ readonly type: MenuItemType.Action;
+ /**
+ * A method which will be called when an action should be executed (e.g. when a user clicks on the item)
+ */
+ execute(): void;
+ /**
+ * @returns Returns a state object of the action.
+ */
+ getState(): Readonly;
+ /**
+ * @returns A subscription for an event when an action is updated.
+ */
+ onUpdate(): ISubscription;
+}
+export interface IBoxedValue extends IBoxedValueReadOnly {
+ /**
+ * Set boxed value
+ * @param {T} value - value to be set
+ */
+ setValue(value: T): void;
+}
+export interface IBoxedValueReadOnly {
+ /** Value */
+ value(): T;
+}
+export interface IBrokerAccountInfo {
+ /**
+ * The library calls `accountsMetainfo` to get a list of accounts for a particular user.
+ * The method should return an array that contains an ID and name for each account.
+ *
+ * Note that if `accountsMetainfo` returns an array containing more than one element, you should implement the {@link setCurrentAccount} method.
+ * Refer to [Multiple accounts](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/multiple-accounts) for more information.
+ */
+ accountsMetainfo(): Promise;
+ /**
+ * The library calls `currentAccount` to get the current account's ID.
+ */
+ currentAccount(): AccountId;
+ /**
+ * The library calls `setCurrentAccount` when users switch accounts using the drop-down menu in the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/).
+ * This method provides your backend server with the ID of the selected account.
+ *
+ * Note that `setCurrentAccount` is required if {@link accountsMetainfo} returns an array containing more than one element.
+ * Refer to [Multiple accounts](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/multiple-accounts) for more information.
+ * @param {AccountId} id - The ID of the selected account.
+ */
+ setCurrentAccount?(id: AccountId): void;
+}
+export interface IBrokerCommon {
+ /**
+ * The library calls `chartContextMenuActions` when users open the [context menu](https://www.tradingview.com/charting-library-docs/latest/ui_elements/context-menu) on the chart.
+ * This method also renders the *Trade* button in the context menu.
+ *
+ * This method should return an array of {@link ActionMetaInfo} elements, each of them representing one context menu item.
+ * @param {TradeContext} context - A context object passed by the library.
+ * @param {DefaultContextMenuActionsParams} [options] - Default options for the context menu action parameters.
+ * @returns A promise that resolves to an array of {@link ActionMetaInfo}, which may be empty. In that case, the *Trade* button will
+ * be removed from the context menu.
+ */
+ chartContextMenuActions(context: TradeContext, options?: DefaultContextMenuActionsParams): Promise;
+ /**
+ * The library calls `isTradable` to check if a symbol can be traded.
+ * If the method returns `false`, users will see the *Non-tradable symbol* message in the UI when creating orders.
+ * You can also display a custom message with the reason why the symbol cannot be traded and the possible solution to resolve the issue.
+ * To do this, return an `IsTradableResult` object.
+ * @param {string} symbol - The symbol identifier.
+ */
+ isTradable(symbol: string): Promise;
+ /**
+ * Defines a connection status for the Broker API.
+ * If any other value than `1` ("Connected") is returned, the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/) will display an endless spinner instead of users' trading data.
+ * If you want to handle other scenarios, for example when the status is disconnected, you need to manage this scenario within your implementation and use the {@link IBrokerConnectionAdapterHost.connectionStatusUpdate} method.
+ *
+ * If the method is not implemented or returns a value other than `1`,
+ * the following error will appear in the console: *Method connectionStatus is not properly implemented*.
+ */
+ connectionStatus(): ConnectionStatus;
+ /**
+ * The library calls `orders` to request data on the user's active orders. This data is displayed on the _Orders and Positions_ pages of the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/#orders-and-positions).
+ */
+ orders(): Promise;
+ /**
+ * The library calls `ordersHistory` to request orders history.
+ * It is expected that returned orders will have a final status (`rejected`, `filled`, `cancelled`).
+ *
+ * This method is only required when you set the {@link BrokerConfigFlags.supportOrdersHistory} flag to `true`.
+ * This flag adds the *History* page, where order history is displayed, to the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/).
+ * Refer to the [History](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/#history) section for more information.
+ */
+ ordersHistory?(): Promise;
+ /**
+ * Called by Trading Platform to request [positions](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions).
+ * Required if the {@link BrokerConfigFlags.supportPositions} flag is set to `true`.
+ */
+ positions?(): Promise;
+ /**
+ * Called by Trading Platform to request [individual positions](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions).
+ * Required if the {@link BrokerConfigFlags.supportPositionNetting} flag is set to `true`.
+ */
+ individualPositions?(): Promise;
+ /**
+ * The library calls `executions` to request executions for the specified symbol.
+ * If you want executions to be displayed on the chart, set the {@link BrokerConfigFlags.supportExecutions} to `true`.
+ * @param {string} symbol - The symbol identifier.
+ */
+ executions(symbol: string): Promise;
+ /**
+ * The library calls `symbolInfo` to request symbol information for the [Order Ticket](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket) and [Depth of Market widget](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/depth-of-market).
+ * @param {string} symbol - The symbol identifier.
+ */
+ symbolInfo(symbol: string): Promise;
+ /**
+ * The library calls `accountManagerInfo` to get information required for building the [Account Manager](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/account-manager/).
+ */
+ accountManagerInfo(): AccountManagerInfo;
+ /**
+ * Provide a custom price formatter for the specified symbol.
+ * @param {string} symbol - symbol identifier
+ * @param {boolean} alignToMinMove - align formatted number to the minimum movement amount of the symbol
+ */
+ formatter?(symbol: string, alignToMinMove: boolean): Promise;
+ /**
+ * Provide a custom spread formatter for the specified symbol.
+ * @param {string} symbol - symbol identifier
+ */
+ spreadFormatter?(symbol: string): Promise;
+ /**
+ * Provide a custom quantity formatter for the specified symbol.
+ * @param {string} symbol - symbol identifier
+ */
+ quantityFormatter?(symbol: string): Promise;
+ /**
+ * Implement this method if you want to [add custom fields](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket#add-custom-fields) to the standard Order Ticket.
+ *
+ * Use the `symbol` parameter to return customization options for a particular symbol.
+ * @param {string} symbol - symbol identifier
+ */
+ getOrderDialogOptions?(symbol: string): Promise;
+ /**
+ * Implement this method if you want to customize the position dialog.
+ *
+ * Use the `symbol` parameter to return customization options for a particular symbol.
+ * @param {string} symbol - symbol identifier
+ */
+ getPositionDialogOptions?(symbol: string): Promise;
+ /**
+ * Implement this method if you want to have custom options available for different symbols.
+ * @param {string} symbol - symbol identifier
+ */
+ getSymbolSpecificTradingOptions?(symbol: string): Promise;
+}
+export interface IBrokerConnectionAdapterFactory {
+ /** Creates a Delegate object */
+ createDelegate(): IDelegate;
+ /** Creates a WatchedValue object */
+ createWatchedValue(value?: T): IWatchedValue;
+ /**
+ * Creates a price formatter.
+ * @param priceScale - Defines the number of decimal places. It is `10^number-of-decimal-places`. If a price is displayed as `1.01`, `pricescale` is `100`; If it is displayed as `1.005`, `pricescale` is `1000`.
+ * @param minMove - The amount of price precision steps for 1 tick. For example, since the tick size for U.S. equities is `0.01`, `minmov` is 1. But the price of the E-mini S&P futures contract moves upward or downward by `0.25` increments, so the `minmov` is `25`.
+ * @param fractional - For common prices, is `false` or it can be skipped. For more information on fractional prices, refer to [Fractional format](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology#fractional-format).
+ * @param minMove2 - For common prices, is `0` or it can be skipped.
+ * @param variableMinTick - For common prices, is `string` (for example, `0.01 10 0.02 25 0.05`) or it can be skipped. For more information, refer to [Variable tick size](https://www.tradingview.com/charting-library-docs/latest/connecting_data/Symbology#variable-tick-size).
+ */
+ createPriceFormatter(priceScale?: number, minMove?: number, fractional?: boolean, minMove2?: number, variableMinTick?: string): IPriceFormatter;
+}
+/**
+ * The Trading Host is an API for interaction between the Broker API and the library code related to trading.
+ * Its main purpose is to receive information from your backend server where trading logic is implemented and provide updates to the library.
+ * Refer to the [Core trading concepts](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/) article for more information.
+ */
+export interface IBrokerConnectionAdapterHost {
+ /** Broker Connection Adapter Factory object */
+ factory: IBrokerConnectionAdapterFactory;
+ /**
+ * Triggers a connection status update throughout the broker by reinvoking {@link IBrokerCommon.connectionStatus}.
+ * @param {ConnectionStatus} status - new connection status to propagate internally to the host
+ * @param {DisconnectionInfo} [info] - additional information to provide when entering a disconnected status
+ */
+ connectionStatusUpdate(status: ConnectionStatus, info?: DisconnectionInfo): void;
+ /**
+ * Generates and returns the default value formatter for the symbol
+ * @param {string} symbol - symbol identifier
+ * @param {boolean} alignToMinMove - whether the formatted number should be aligned to minimum movement for the symbol
+ */
+ defaultFormatter(symbol: string, alignToMinMove: boolean): Promise;
+ /**
+ * Generates and returns a number formatter with the desired decimal places
+ * @param {number} [decimalPlaces] - decimal places
+ */
+ numericFormatter(decimalPlaces: number): Promise;
+ /**
+ * Generates and returns a quantity formatter with the desired decimal places
+ * @param {number} [decimalPlaces] - decimal places
+ */
+ quantityFormatter(decimalPlaces?: number): Promise;
+ /**
+ * Provides default buy/sell, show properties actions to be returned as a default by {@link IBrokerCommon.chartContextMenuActions}.
+ * @param {TradeContext} context - trade context
+ * @param {DefaultContextMenuActionsParams} [params] - optional parameters
+ */
+ defaultContextMenuActions(context: TradeContext, params?: DefaultContextMenuActionsParams): Promise;
+ /**
+ * Provides default dropdown list of actions. You can use default actions in {@link IBrokerConnectionAdapterHost.setButtonDropdownActions}
+ * @param {Partial} [options] - options for the dropdown menu actions
+ */
+ defaultDropdownMenuActions(options?: Partial): ActionMetaInfo[];
+ /** Returns whether the buy/sell buttons are visible or not. */
+ sellBuyButtonsVisibility(): IWatchedValue | null;
+ /** Returns whether DOM Panel is visible or not. */
+ domPanelVisibility(): IWatchedValue | null;
+ /** Returns whether the order panel is visible or not. */
+ orderPanelVisibility(): IWatchedValue | null;
+ /** Returns if orders can be sent to the broker without showing the order ticket. */
+ silentOrdersPlacement(): IWatchedValue;
+ /**
+ * Patch changes into the current broker configuration
+ * @param {Partial} config - partial configuration changes to apply
+ */
+ patchConfig(config: Partial): void;
+ /**
+ * Set expiration durations
+ * @param {OrderDurationMetaInfo[]} durations - Expiration options for orders
+ */
+ setDurations(durations: OrderDurationMetaInfo[]): void;
+ /**
+ * Call this method to notify the chart that it needs to update information after an order is added or changed.
+ * @param {Order} order - order which was added or changed
+ */
+ orderUpdate(order: Order): void;
+ /**
+ * Call this method to clear the current cache for orders and notify the chart that it needs to request orders again.
+ * Use this method only in cases such as ID mismatches.
+ * For more details, see [Order and position IDs mismatch](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/common-issues#order-and-position-ids-mismatch).
+ */
+ ordersFullUpdate(): void;
+ /**
+ * Call this method when an order is not changed, but the fields that you added to the order object to display in the Account Manager have changed.
+ * It should be used only if you want to display custom fields in the Account Manager.
+ * @param {string} id - order id
+ * @param {Partial} orderChanges - changes made to the order object
+ */
+ orderPartialUpdate(id: string, orderChanges: Partial): void;
+ /**
+ * Call this method when a position is added or changed.
+ * @param {Position} position - position which was added or changed
+ * @param {boolean} [isHistoryUpdate] - whether the change is a history update
+ */
+ positionUpdate(position: Position, isHistoryUpdate?: boolean): void;
+ /**
+ * Call this method to clear the current cache for positions and notify the chart that it needs to request positions again.
+ * Use this method only in cases such as ID mismatches.
+ * For more details, see [Order and position IDs mismatch](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/common-issues#order-and-position-ids-mismatch).
+ */
+ positionsFullUpdate(): void;
+ /**
+ * Call this method when a position is not changed, but the fields that you added to the position object to display in the Account Manager have changed.
+ * It should be used only if you want to display custom fields in the Account Manager.
+ * @param {string} id - id of the position
+ * @param {Partial} positionChanges - changes to the position object
+ */
+ positionPartialUpdate(id: string, positionChanges: Partial): void;
+ /**
+ * Call this method when an individual position is added or changed.
+ * @param {IndividualPosition} individualPosition - updated individual position
+ * @param {boolean} [isHistoryUpdate] - whether the change is a history update
+ */
+ individualPositionUpdate(individualPosition: IndividualPosition, isHistoryUpdate?: boolean): void;
+ /**
+ * Call this method to clear the current cache for individual positions and notify the chart that it needs to request individual positions again.
+ * Use this method only in cases such as ID mismatches.
+ * For more details, see [Order and position IDs mismatch](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/common-issues#order-and-position-ids-mismatch).
+ */
+ individualPositionsFullUpdate(): void;
+ /**
+ * Call this method when an individual position has not changed, but fields that you added to the individual position object to display in the Account Manager have changed.
+ * @param {string} id - ID of the updated individual position
+ * @param {Partial} changes - changes to the individual position object
+ */
+ individualPositionPartialUpdate(id: string, changes: Partial): void;
+ /**
+ * Call this method when an execution is added.
+ * @param {Execution} execution - execution which was added
+ */
+ executionUpdate(execution: Execution): void;
+ /**
+ * Call this method when user account has been changed synchronously. The terminal will re-request all displayed information.
+ */
+ currentAccountUpdate(): void;
+ /**
+ * Trading quote realtime update
+ * @param {string} symbol - symbol identifier
+ * @param {TradingQuotes} data - realtime updated data for the symbol quotes
+ */
+ realtimeUpdate(symbol: string, data: TradingQuotes): void;
+ /**
+ * Call this method when a broker connection has received a [profit and loss](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#provide-profit-and-loss) update.
+ * Use this method when the {@link BrokerConfigFlags.supportPLUpdate} flag is set to `true` in {@link SingleBrokerMetaInfo.configFlags}.
+ * @param {string} positionId - ID of the position
+ * @param {number} pl - updated profit / loss value
+ */
+ plUpdate(positionId: string, pl: number): void;
+ /**
+ * Call this method when a broker connection has a `pipValue` update.
+ * The library subscribes to `pipValue` updates using {@link IBrokerTerminal.subscribePipValue}.
+ * @param {string} symbol - symbol with updated pip values
+ * @param {PipValues} pipValues - updated pip values
+ */
+ pipValueUpdate(symbol: string, pipValues: PipValues): void;
+ /**
+ * Call this method when a broker connection has received an individual position [profit and loss](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#provide-profit-and-loss) update.
+ * @param {string} individualPositionId - ID of the individual position
+ * @param {number} pl - updated profit / loss for the individual position
+ */
+ individualPositionPLUpdate(individualPositionId: string, pl: number): void;
+ /**
+ * Call this method when a broker connection has received an equity update. This method is required by the standard Order Ticket to calculate risks.
+ * @param {number} equity - updated equity
+ */
+ equityUpdate(equity: number): void;
+ /**
+ * Call this method when a broker connection has received a margin available update.
+ * This method is required by the standard Order Ticket to display the margin meter.
+ * This method should be used when {@link BrokerConfigFlags.supportMargin} is set to `true` in {@link SingleBrokerMetaInfo.configFlags}.
+ * The Trading Platform subscribes to margin available updates using {@link IBrokerTerminal.subscribeMarginAvailable}.
+ * @param {number} marginAvailable - updated available margin
+ */
+ marginAvailableUpdate(marginAvailable: number): void;
+ /**
+ * Call this method when a broker connection has received a balance update.
+ * This method is required by the crypto Order Ticket.
+ * It should be implemented when the {@link BrokerConfigFlags.supportBalances} flag is set to `true` in {@link SingleBrokerMetaInfo.configFlags}.
+ * @param {string} symbol - symbol ID
+ * @param {CryptoBalance} balance - updated crypto balance
+ */
+ cryptoBalanceUpdate(symbol: string, balance: CryptoBalance): void;
+ /**
+ * Update the [Depth of Market](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/depth-of-market) data for a specified symbol.
+ * @param {string} symbol - symbol identifier
+ * @param {DOMData} equity - Depth of Market data
+ */
+ domUpdate(symbol: string, equity: DOMData): void;
+ /**
+ * Sets the quantity for a given symbol.
+ * Use this method only when you need to [override the user-specified quantity](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/common-issues#symbol-quantity-is-overriden) with a new value.
+ *
+ * To specify the default quantity, use the {@link InstrumentInfo.qty} field instead.
+ * @param {string} symbol - symbol
+ * @param {number} quantity - quantity to update
+ */
+ setQty(symbol: string, quantity: number): void;
+ /**
+ * Returns the quantity for a given symbol.
+ * @param {string} symbol - symbol
+ * @return {Promise} - quantity for the given symbol
+ */
+ getQty(symbol: string): Promise;
+ /**
+ * Adds a callback to be executed whenever there's a change of quantity for a given symbol.
+ *
+ * Make sure to unsubscribe from these changes using the corresponding {@link unsubscribeSuggestedQtyChange} method.
+ *
+ * @param {string} symbol - symbol to which the callback will be linked to
+ * @param {SuggestedQtyChangedListener} listener - callback
+ */
+ subscribeSuggestedQtyChange(symbol: string, listener: SuggestedQtyChangedListener): void;
+ /**
+ * Remove a previously added callback from the list.
+ * @param {string} symbol - symbol to remove the callback from
+ * @param {SuggestedQtyChangedListener} listener - callback to be removed
+ */
+ unsubscribeSuggestedQtyChange(symbol: string, listener: SuggestedQtyChangedListener): void;
+ /**
+ * Shows the Order Ticket
+ * @param {T extends PreOrder} order - order to show in the dialog
+ * @param {OrderTicketFocusControl} [focus] - input control to focus on when dialog is opened
+ */
+ showOrderDialog?(order: T, focus?: OrderTicketFocusControl): Promise;
+ /**
+ * Shows notification message
+ * @param {string} title - notification title
+ * @param {string} text - notification content
+ * @param {NotificationType} [notificationType] - type of notification (default: NotificationType.Error)
+ */
+ showNotification(title: string, text: string, notificationType?: NotificationType): void;
+ /**
+ * Shows the cancel Order Ticket for specified order
+ * @param {string} orderId - id of order to potentially cancel
+ * @param {()=>Promise} handler - cancel order confirmation handler (called when order should be cancelled)
+ */
+ showCancelOrderDialog(orderId: string, handler: () => Promise): Promise;
+ /**
+ * Shows the cancel Order Ticket for multiple orders
+ * @param {string} symbol - symbol for which to cancel orders
+ * @param {Side} side - side of the order
+ * @param {number} qty - quantity of the order
+ * @param {()=>Promise} handler - cancel orders confirmation handler (called when orders should be cancelled)
+ */
+ showCancelMultipleOrdersDialog(symbol: string, side: Side, qty: number, handler: () => Promise): Promise;
+ /**
+ * Shows the cancel brackets dialog
+ * @param {string} orderId - id of order
+ * @param {()=>Promise} handler - cancel brackets confirmation handler (called when brackets should be cancelled)
+ */
+ showCancelBracketsDialog(orderId: string, handler: () => Promise): Promise;
+ /**
+ * Shows the cancel brackets dialog for multiple brackets
+ * @param {string} orderId - id of order
+ * @param {()=>Promise} handler - cancel brackets confirmation handler (called when brackets should be cancelled)
+ */
+ showCancelMultipleBracketsDialog(orderId: string, handler: () => Promise): Promise;
+ /**
+ * Shows reverse position dialog
+ * @param {string} position - position to be reversed
+ * @param {()=>Promise} handler - reverse position confirmation handler (called when the position should be reversed)
+ */
+ showReversePositionDialog(position: string, handler: () => Promise): Promise;
+ /**
+ * Shows the position brackets dialog
+ * @param {Position|IndividualPosition} position - position or individual position
+ * @param {Brackets} brackets - brackets for the position or individual position
+ * @param {OrderTicketFocusControl} focus - input control to focus on when dialog is opened
+ */
+ showPositionBracketsDialog(position: Position | IndividualPosition, brackets: Brackets, focus: OrderTicketFocusControl): Promise;
+ /**
+ * @deprecated This method will be removed from the library in the next major version. Please use {@link setAccountManagerVisibilityMode} instead.
+ * Activate bottom widget
+ */
+ activateBottomWidget(): Promise;
+ /**
+ * Method to retrieve the current visibility mode of the Account Manager.
+ */
+ getAccountManagerVisibilityMode(): IWatchedValueReadonly;
+ /**
+ * Method to set a new visibility mode for the Account Manager.
+ */
+ setAccountManagerVisibilityMode(mode: BottomWidgetBarMode): void;
+ /**
+ * Shows trading properties
+ */
+ showTradingProperties(): void;
+ /**
+ * Returns symbol `minTick`.
+ * @param {string} symbol - symbol identifier
+ */
+ getSymbolMinTick(symbol: string): Promise;
+ /**
+ * Displays a message dialog to a user.
+ * @param {string} title - title of the message dialog
+ * @param {string} text - message
+ * @param {boolean} [textHasHTML] - whether message text contains HTML
+ */
+ showMessageDialog(title: string, text: string, textHasHTML?: boolean): void;
+ /**
+ * Displays a confirmation dialog to a user and returns a Promise to the result.
+ * @param {string} title - title of the confirmation dialog
+ * @param {string|string[]} content - content for the dialog
+ * @param {string} [mainButtonText] - text for the main button (`true` result)
+ * @param {string} [cancelButtonText] - text for the cancel button (`false` result)
+ * @param {boolean} [showDisableConfirmationsCheckbox] - show disable confirmations checkbox within the dialog
+ */
+ showConfirmDialog(title: string, content: string | string[], mainButtonText?: string, cancelButtonText?: string, showDisableConfirmationsCheckbox?: boolean): Promise;
+ /**
+ * Displays a simple confirmation dialog to a user and returns a Promise to the result.
+ * @param {string} title - title of the confirmation dialog
+ * @param {string|string[]} content - content for the dialog
+ * @param {string} [mainButtonText] - text for the main button (`true` result)
+ * @param {string} [cancelButtonText] - text for the cancel button (`false` result)
+ * @param {boolean} [showDisableConfirmationsCheckbox] - show disable confirmations checkbox within the dialog
+ */
+ showSimpleConfirmDialog(title: string, content: string | string[], mainButtonText?: string, cancelButtonText?: string, showDisableConfirmationsCheckbox?: boolean): Promise;
+ /**
+ * Retrieves the current value for a specified [Order Ticket](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket) setting in the ellipsis menu.
+ *
+ * @template K A key of the OrderTicketSettings type.
+ * @param {K} settingName - The name of the Order Ticket setting.
+ * @returns {Promise} A promise that resolves with the value of the specified setting.
+ */
+ getOrderTicketSetting(settingName: K): Promise;
+ /**
+ * Updates the value of a specified [Order Ticket](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket) setting in the ellipsis menu.
+ *
+ * @template K A key of OrderTicketSettings type.
+ * @param {K} settingName - The name of the Order Ticket setting to be updated.
+ * @param {OrderTicketSettings[K]} value - The new value to be assigned to the setting.
+ * @returns {Promise} A promise that resolves when the setting is successfully updated.
+ */
+ setOrderTicketSetting(settingName: K, value: OrderTicketSettings[K]): Promise;
+}
+/**
+ * The Broker API is a key component that enables trading.
+ * Its main purpose is to connect TradingView charts with your trading logic.
+ * Refer to the [Core trading concepts](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/) article for more information.
+ */
+export interface IBrokerTerminal extends IBrokerCommon, IBrokerAccountInfo {
+ /**
+ * The library calls `placeOrder` to request placing an order pre-filled with partial or complete information.
+ * You should handle this request on your backend side. For more information, refer to [Order creation](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/#1-order-creation).
+ *
+ * To display an order preview before placing it, set {@link BrokerConfigFlags.supportPlaceOrderPreview} to `true`.
+ * Refer to [Enable order preview](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket#enable-order-preview) for more information.
+ * @param {PreOrder} order - Order information.
+ * @param {string} [confirmId] - The ID of the confirmed order. This parameter is passed if [`supportPlaceOrderPreview`](https://www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.BrokerConfigFlags#supportplaceorderpreview) is `true`.
+ * @returns {PlaceOrderResult} An object with the order ID.
+ */
+ placeOrder(order: PreOrder, confirmId?: string): Promise;
+ /**
+ * The library calls `previewOrder` to show an order preview when a user clicks _Buy order_ or _Modify order_ in the Order Ticket.
+ * To [enable order preview](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket#enable-order-preview), set the {@link BrokerConfigFlags.supportPlaceOrderPreview} or {@link BrokerConfigFlags.supportModifyOrderPreview} configuration flag to `true`.
+ *
+ * This method returns estimated commission, fees, margin, and other information for the order without it actually being placed.
+ * @param {PreOrder} order - Order information.
+ */
+ previewOrder?(order: PreOrder): Promise;
+ /**
+ * The library calls `modifyOrder` to request modifying an existing order.
+ * You should handle this request on your backend side and provide the library with a new order state. To do this, call the {@link IBrokerConnectionAdapterHost.orderUpdate} method right afterwards.
+ * Otherwise, the library will return a [timeout issue](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/common-issues#timeout-issue).
+ *
+ * Note that [market orders](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/orders#order-types) cannot be modified.
+ *
+ * To enable an order preview before modification, set the {@link BrokerConfigFlags.supportModifyOrderPreview} configuration flag to `true`.
+ * Refer to [Enable order preview](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket#enable-order-preview) for more information.
+ * @param {Order} order - Order information.
+ * @param {string} [confirmId] - The ID of the confirmed order. This parameter is passed if [`supportModifyOrderPreview`](https://www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.BrokerConfigFlags#supportmodifyorderpreview) is `true`.
+ */
+ modifyOrder(order: Order, confirmId?: string): Promise;
+ /**
+ * The library calls `cancelOrder` to request canceling an order.
+ * You should handle this request on your backend side and provide the library with a new order state. To do this, call the {@link IBrokerConnectionAdapterHost.orderUpdate} method right afterwards.
+ * @param {string} orderId - The ID of the order to cancel.
+ */
+ cancelOrder(orderId: string): Promise;
+ /**
+ * The library calls `cancelOrders` to request canceling multiple orders for a symbol.
+ * You should handle this request on your backend side and provide the library with a new order states. To do this, call the {@link IBrokerConnectionAdapterHost.orderUpdate} method right afterwards.
+ *
+ * `cancelOrders` is only called when users click the *CXL all* button in the [Depth of Market](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/depth-of-market) widget.
+ * @param {string} symbol - The symbol identifier.
+ * @param {Side|undefined} side - An order side.
+ * @param {string[]} ordersIds - IDs of the orders to cancel. The orders are selected based on the specified `symbol` and `side`.
+ */
+ cancelOrders?(symbol: string, side: Side | undefined, ordersIds: string[]): Promise;
+ /**
+ * This method is called if the {@link BrokerConfigFlags.supportNativeReversePosition} configuration flag is on.
+ * It allows reversing the position by ID.
+ *
+ * Note that the library expects you to call the {@link IBrokerConnectionAdapterHost.positionUpdate} method right afterwards.
+ * Otherwise, the library will return a [timeout issue](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/common-issues#timeout-issue).
+ * @param {string} positionId - position
+ */
+ reversePosition?(positionId: string): Promise;
+ /**
+ * The library calls `closePosition` to request [closing a position](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#close-positions) by ID.
+ * You should handle this request on your backend side and provide the library with a new position state. To do this, call the {@link IBrokerConnectionAdapterHost.positionUpdate} method right afterwards.
+ * Otherwise, the library will return a [timeout issue](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/common-issues#timeout-issue).
+ *
+ * `closePosition` is only called if the {@link BrokerConfigFlags.supportClosePosition} or {@link BrokerConfigFlags.supportPartialClosePosition} configuration flag is `true`.
+ * @param {string} positionId - The position ID.
+ * @param {number} [amount] - The amount is specified if [`supportPartialClosePosition`](https://www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.BrokerConfigFlags#supportpartialcloseposition) is `true` and the user wants to close only [part of the position](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#partial-closing).
+ */
+ closePosition?(positionId: string, amount?: number): Promise;
+ /**
+ * The library calls `closeIndividualPosition` if the {@link BrokerConfigFlags.supportCloseIndividualPosition} or {@link BrokerConfigFlags.supportPartialCloseIndividualPosition} configuration flag is `true`.
+ * `closeIndividualPosition` allows [closing an individual position](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#close-positions) by ID.
+ *
+ * Note that the library expects you to call the {@link IBrokerConnectionAdapterHost.positionUpdate} method right afterwards.
+ * Otherwise, the library will return a [timeout issue](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/common-issues#timeout-issue).
+ * @param {string} individualPositionId - The individual position ID.
+ * @param {number} [amount] - The amount is specified if `supportPartialCloseIndividualPosition` is `true` and the user wants to close only [part of the individual position](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#partial-closing).
+ */
+ closeIndividualPosition?(individualPositionId: string, amount?: number): Promise;
+ /**
+ * The library calls `editPositionBrackets` if the {@link BrokerConfigFlags.supportPositionBrackets} configuration flag is `true`.
+ * It shows a dialog that enables take-profit and stop-loss editing.
+ *
+ * Note that the library expects you to call the {@link IBrokerConnectionAdapterHost.positionUpdate} method right afterwards.
+ * @param {string} positionId - The ID of the existing position to be modified.
+ * @param {Brackets} brackets - New brackets to be set for the position.
+ * @param {CustomInputFieldsValues} [customFields] - Custom fields to display in the dialog.
+ */
+ editPositionBrackets?(positionId: string, brackets: Brackets, customFields?: CustomInputFieldsValues): Promise;
+ /**
+ * This method is called if the {@link BrokerConfigFlags.supportIndividualPositionBrackets} configuration flag is on.
+ * It displays a dialog that enables take-profit and stop-loss editing.
+ *
+ * Note that the library expects you to call the {@link IBrokerConnectionAdapterHost.positionUpdate} method right afterwards.
+ * @param {string} individualPositionId - ID of existing individual position to be modified
+ * @param {Brackets} brackets - new Brackets to be set for the individual position
+ */
+ editIndividualPositionBrackets?(individualPositionId: string, brackets: Brackets): Promise;
+ /**
+ * This method is called to receive leverageInfo from the broker.
+ * @param {LeverageInfoParams} leverageInfoParams - information about the specific symbol to provide leverage information for
+ */
+ leverageInfo?(leverageInfoParams: LeverageInfoParams): Promise;
+ /**
+ * This method is called to send user's leverage value to the broker. The value should be verified and corrected on the broker's side if required, and sent back in the response.
+ * @param {LeverageSetParams} leverageSetParams - `leverageSetParams` is an object similar to {@link leverageInfoParams}, but contains an additional `leverage: number` field, which holds the leverage value set by the user.
+ */
+ setLeverage?(leverageSetParams: LeverageSetParams): Promise;
+ /**
+ * This method is called to receive {@link LeveragePreviewResult} object which holds messages about the leverage value set by the user.
+ * @param {LeverageSetParams} leverageSetParams - `leverageSetParams` is an object similar to {@link leverageInfoParams}, but contains an additional `leverage: number` field, which holds the leverage value set by the user.
+ */
+ previewLeverage?(leverageSetParams: LeverageSetParams): Promise;
+ /**
+ * The method should be implemented if you use the standard Order Ticket and support stop loss. Equity is used to calculate Risk in Percent.
+ *
+ * Once this method is called the broker should provide equity (Balance + P/L) updates via {@link IBrokerConnectionAdapterHost.equityUpdate} method.
+ */
+ subscribeEquity?(): void;
+ /**
+ * The method should be implemented if you use the standard Order Ticket and want to show the margin meter.
+ *
+ * Once this method is called the broker should provide margin available updates via {@link IBrokerConnectionAdapterHost.marginAvailableUpdate} method.
+ * @param {string} symbol - symbol identifier
+ */
+ subscribeMarginAvailable?(symbol: string): void;
+ /**
+ * Use this method to enable dynamic updates of the pip value defined in {@link InstrumentInfo.pipValue}.
+ * The pip value is displayed in the *Order info* section of the [Order Ticket](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/order-ticket) and is used to calculate the trade value and risks.
+ * Once `subscribePipValue` is called, your Broker API implementation should provide pip value updates through the {@link IBrokerConnectionAdapterHost.pipValueUpdate} method.
+ *
+ * If `subscribePipValue` is not implemented, the static value from {@link InstrumentInfo.pipValue} is displayed in the UI.
+ * @param {string} symbol - symbol identifier
+ */
+ subscribePipValue?(symbol: string): void;
+ /**
+ * The method should be implemented if you use a standard Order Ticket and implement `subscribePipValue`.
+ *
+ * Once this method is called the broker should stop providing `pipValue` updates.
+ * @param {string} symbol - symbol identifier
+ */
+ unsubscribePipValue?(symbol: string): void;
+ /**
+ * The method should be implemented if you use the standard Order Ticket want to show the margin meter.
+ *
+ * Once this method is called the broker should stop providing margin available updates.
+ * @param {string} symbol - symbol identifier
+ */
+ unsubscribeMarginAvailable?(symbol: string): void;
+ /**
+ * The method should be implemented if you use the standard Order Ticket and support stop loss.
+ *
+ * Once this method is called the broker should stop providing equity updates.
+ */
+ unsubscribeEquity?(): void;
+}
+/**
+ * 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})
+ */
+export 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<() => 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>;
+ /**
+ * Scroll and/or scale the chart so a time range is visible.
+ *
+ * **Example**
+ * ```javascript
+ * widget.activeChart().setVisibleRange(
+ * { from: 1420156800, to: 1451433600 },
+ * { percentRightMargin: 20 }
+ * )
+ * ```
+ * @param range A range that will be made visible.
+ * @param options Optional object of 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.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.
+ * 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.
+ * 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.
+ * 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 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.
+ *
+ * **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;
+ /**
+ * 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;
+ /**
+ * 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 charts.
+ *
+ * The 'intraday_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 during to market inactivity.
+ * When disabled (`false`), these gaps are hidden and the chart appears continuous.
+ */
+ intradayInactivityGaps(): 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.
+ */
+export 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 a object. This method is part of the low-level save/load 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 a object. This method is part of the low-level save/load 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 the chart without reloading. See also {@link ChartingLibraryWidgetOptions.overrides}.
+ *
+ * @param overrides An object of overrides to apply to the chart.
+ */
+ 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;
+ /**
+ * 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;
+ /**
+ * 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`](@api/interfaces/Charting_Library.IDatafeedChartApi.md#subscribebars) for all symbol and resolution combinations at once.
+ */
+ resetCache(): void;
+}
+/**
+ * PineJS execution context.
+ */
+export 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 the minimum depth to be forced.
+ * @param {number} value - minimum depth to set
+ */
+ setMinimumAdditionalDepth(value: number): void;
+}
+export interface IContextMenuRenderer {
+ /**
+ * Displays the menu at the position.
+ * @param pos Position to show context menu
+ */
+ show(pos: ContextMenuPosition): void;
+ /**
+ * hides the menu.
+ */
+ hide(): void;
+ /**
+ * @returns `true` when the menu is currently displayed.
+ */
+ isShown(): boolean;
+}
+/**
+ * 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')
+ * ```
+ */
+export 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;
+}
+/**
+ * The custom symbol status API provides the ability to create (and adjust)
+ * additional status items to be displayed within the symbol status section
+ * of the main series legend. This section is typically used to show the
+ * market status (such as open or closed) but can additionally be used to
+ * display warnings related to the current symbol.
+ *
+ * This API allows custom status items to be added (which are tied to a
+ * specific symbol). You can customise the icon, color, tooltip, and content
+ * within the dropdown tooltip menu displayed when the user clicks on the
+ * icon.
+ *
+ * **Example**
+ * ```js
+ * widget
+ * .customSymbolStatus()
+ * .symbol('NASDAQNM:AAPL') // select the symbol
+ * .setVisible(true) // make the status visible
+ * .setColor('rgb(255, 40, 60)') // set the colour
+ * .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');
+ * },
+ * },
+ * },
+ * ]);
+ * ```
+ */
+export 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.
+ */
+export 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;
+}
+export 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/core_concepts/Resolution#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;
+ /**
+ * 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;
+}
+/** Quotes datafeed API */
+export interface IDatafeedQuotesApi {
+ /**
+ * This function is called when the library needs quote data.
+ * The library assumes that `onDataCallback` is called once when all the requested data is received.
+ * @param {string[]} symbols - symbol names.
+ * @param {QuotesCallback} onDataCallback - callback to return the requested data.
+ * @param {QuotesErrorCallback} onErrorCallback - callback for responding with an error.
+ */
+ getQuotes(symbols: string[], onDataCallback: QuotesCallback, onErrorCallback: QuotesErrorCallback): void;
+ /**
+ * Trading Platform calls this function when it wants to receive real-time quotes for a symbol.
+ * The library assumes that you will call `onRealtimeCallback` every time you want to update the quotes.
+ * @param {string[]} symbols - list of symbols that should be updated rarely (once per minute). These symbols are included in the watchlist but they are not visible at the moment.
+ * @param {string[]} fastSymbols - list of symbols that should be updated frequently (at least once every 10 seconds)
+ * @param {QuotesCallback} onRealtimeCallback - callback to send realtime quote data updates
+ * @param {string} listenerGUID - unique identifier of the listener
+ */
+ subscribeQuotes(symbols: string[], fastSymbols: string[], onRealtimeCallback: QuotesCallback, listenerGUID: string): void;
+ /**
+ * Trading Platform calls this function when it doesn't want to receive updates for this listener anymore.
+ * `listenerGUID` will be the same object that the Library passed to `subscribeQuotes` before.
+ * @param {string} listenerGUID - unique identifier of the listener
+ */
+ unsubscribeQuotes(listenerGUID: string): void;
+}
+export interface IDelegate extends ISubscription {
+ /** Fire (Evoke) */
+ fire: TFunc;
+}
+export interface IDestroyable {
+ /** Clean up (destroy) any subscriptions, intervals, or other resources that this `IDestroyable` instance has. */
+ destroy(): void;
+}
+/** Dropdown menu API */
+export 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 used to control execution lines.
+ */
+export 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;
+}
+export 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;
+}
+export interface IExternalSaveLoadAdapter {
+ /**
+ * Get all saved charts.
+ * @returns Array of chart meta information
+ */
+ getAllCharts(): Promise;
+ /**
+ * Remove a chart.
+ * @param id - Unique ID of the chart (see {@link getAllCharts})
+ */
+ removeChart(id: string | number): Promise;
+ /**
+ * Save the chart
+ * @param {ChartData} chartData - Chart description data
+ * @returns unique ID of the chart
+ */
+ saveChart(chartData: ChartData): Promise;
+ /**
+ * Load the chart from the server
+ * @param {number | string} chartId - Unique ID of the chart to load (see {@link getAllCharts})
+ * @returns chart content contained in the `content` field when saving the chart ({@link ChartData})
+ */
+ getChartContent(chartId: number | string): Promise;
+ /**
+ * Get all saved study templates
+ * @returns Array of study template meta information
+ */
+ getAllStudyTemplates(): Promise;
+ /**
+ * Remove a study template
+ * @param {StudyTemplateMetaInfo} studyTemplateInfo
+ */
+ removeStudyTemplate(studyTemplateInfo: StudyTemplateMetaInfo): Promise;
+ /**
+ * Save a study template
+ * @param {StudyTemplateData} studyTemplateData - Study template data to save
+ */
+ saveStudyTemplate(studyTemplateData: StudyTemplateData): Promise;
+ /**
+ * load a study template from the server
+ * @param {StudyTemplateMetaInfo} studyTemplateInfo
+ * @returns Study template `content`
+ */
+ getStudyTemplateContent(studyTemplateInfo: StudyTemplateMetaInfo): Promise;
+ /**
+ * Get names of all saved drawing templates
+ * @param {string} toolName - name of the drawing tool
+ * @returns names of saved drawing templates
+ */
+ getDrawingTemplates(toolName: string): Promise;
+ /**
+ * Load a drawing template from the server
+ * @param {string} toolName - name of the drawing tool
+ * @param {string} templateName - name of the template
+ * @returns content of the drawing template
+ */
+ loadDrawingTemplate(toolName: string, templateName: string): Promise;
+ /**
+ * Remove a drawing template
+ * @param {string} toolName - name of the drawing tool
+ * @param {string} templateName - name of the template
+ */
+ removeDrawingTemplate(toolName: string, templateName: string): Promise;
+ /**
+ * Save a drawing template
+ * @param {string} toolName - name of the drawing tool
+ * @param {string} templateName - name of the template
+ * @param {string} content - content of the drawing template
+ */
+ saveDrawingTemplate(toolName: string, templateName: string, content: string): Promise;
+ /**
+ * Load a chart template from the server
+ *
+ * @param templateName The name of the template.
+ *
+ * @returns The chart template content.
+ */
+ getChartTemplateContent(templateName: string): Promise;
+ /**
+ * Get names of all saved chart templates.
+ *
+ * @returns An array of names.
+ */
+ getAllChartTemplates(): Promise;
+ /**
+ * Save a chart template.
+ *
+ * @param newName The name of the template.
+ * @param theme The template content.
+ */
+ saveChartTemplate(newName: string, theme: ChartTemplateContent): Promise;
+ /**
+ * Remove a chart template.
+ *
+ * @param templateName The name of the template.
+ */
+ removeChartTemplate(templateName: string): Promise;
+ /**
+ * Save drawings and drawing groups associated with a chart layout.
+ *
+ * @param layoutId The chart layout ID
+ * @param chartId The chart ID
+ * @param state The drawings and drawing groups state
+ */
+ saveLineToolsAndGroups(layoutId: string | undefined, chartId: string | number, state: LineToolsAndGroupsState): Promise;
+ /**
+ * Load drawings and drawing groups associated with a chart layout.
+ *
+ * @param layoutId The chart layout ID
+ * @param chartId The chart ID
+ * @param requestType Type of load request
+ * @param requestContext Additional information for the request
+ *
+ * @returns The drawings and drawing groups state
+ */
+ loadLineToolsAndGroups(layoutId: string | undefined, chartId: string | number, requestType: LineToolsAndGroupsLoadRequestType, requestContext: LineToolsAndGroupsLoadRequestContext): Promise | null>;
+}
+/** Definition of a formatter */
+export 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;
+}
+export interface IImageStorageAdapter {
+ /**
+ * Return the maximum allowed image size in bytes that will be allowed by the image drawing tool.
+ */
+ getMaxImageSizeInBytes(): number;
+}
+/**
+ * Drawing API
+ *
+ * You can retrieve this interface by using the {@link IChartWidgetApi.getShapeById} method.
+ */
+export 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.
+ * @returns properties of the drawing
+ */
+ getProperties
= Record>(): 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;
+}
+export interface IMenuItem {
+ /** Menu item type */
+ readonly type: MenuItemType;
+ /**
+ * An unique ID of an action item. Could be used to distinguish actions between each other.
+ */
+ readonly id: string;
+}
+export interface INewsApi {
+ /** Refresh News */
+ refresh(): void;
+}
+export interface INonSeriesStudyBarsResult {
+ type: "non_series_bars";
+ /**
+ * Non series bars
+ */
+ bars: IBarArray[];
+}
+export interface INonSeriesStudyResult {
+ /** Type is `non_series_data` */
+ type: "non_series_data";
+ /** Always true */
+ nonseries: true;
+ /** Data */
+ data: object;
+}
+/** Specific formatter for number */
+export interface INumberFormatter extends IFormatter {
+ /**
+ * Formatter for a price change
+ * @param currentPrice - current price
+ * @param prevPrice - previous price
+ * @param options - format options
+ */
+ formatChange?(currentPrice: number, prevPrice: number, options?: FormatterFormatOptions): string;
+}
+export interface IObservable {
+ /**
+ * Subscribe to changes
+ * @param {(value:T)=>void} callback - callback function to be evoked when observed value changes
+ */
+ subscribe(callback: (value: T) => void): void;
+ /**
+ * Unsubscribe from changes
+ * @param {(value:T)=>void} callback - callback function to be unsubscribed
+ */
+ unsubscribe(callback: (value: T) => void): void;
+}
+export interface IObservableValue extends IBoxedValue, IObservable {
+}
+export interface IObservableValueReadOnly extends IBoxedValueReadOnly, IObservable {
+}
+/**
+ * An API object used to control order lines.
+ */
+export 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 The new body background color.
+ */
+ 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 The new body text color.
+ */
+ 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 The new quantity text color.
+ */
+ 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 The new cancel button background color.
+ */
+ 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
+ */
+export 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;
+}
+export 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 used to control position lines.
+ */
+export 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 font of the position line.
+ */
+ getBodyBackgroundColor(): string;
+ /**
+ * Set the body font of the position line.
+ * @param value The new body font.
+ */
+ 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 The new body text color.
+ */
+ 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 The new quantity text color.
+ */
+ 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 The new reverse button background color.
+ */
+ 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;
+}
+/**
+ * Specific formatter for numbers
+ */
+export interface IPriceFormatter extends ISymbolValueFormatter {
+ /** Price formatter */
+ format(price: number, options?: PriceFormatterFormatOptions): string;
+ /** Price change formatter */
+ formatChange?(price: number, prevPrice: number, options?: PriceFormatterFormatOptions): string;
+}
+/**
+ * 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`
+ */
+export 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;
+}
+export 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.
+ */
+export 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;
+}
+export interface ISeparator extends IMenuItem {
+ /** @inheritDoc */
+ readonly type: MenuItemType.Separator;
+}
+/**
+ * Series API
+ *
+ * You can retrieve this interface by using the {@link IChartWidgetApi.getSeries} method
+ */
+export 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;
+ /** Merges the main series up (if possible) */
+ mergeUp(): void;
+ /** Merges the main series down (if possible) */
+ mergeDown(): void;
+ /** Unmerges the main series up (if possible) */
+ unmergeUp(): void;
+ /** Unmerges the main series down (if possible) */
+ 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;
+}
+/**
+ * Properties of the {@link ChartingLibraryWidgetOptions.settings_adapter} property that allows saving [user settings](https://www.tradingview.com/charting-library-docs/latest/saving_loading/user-settings) to your preferred storage, including server-side.
+ */
+export interface ISettingsAdapter {
+ /** Initial settings the chart should be initiated with. */
+ initialSettings?: InitialSettingsMap;
+ /** Set a value for a setting. */
+ setValue(key: string, value: string): void;
+ /** Remove a value for a setting. */
+ removeValue(key: string): 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.
+ */
+export 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
+ */
+export 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;
+ /**
+ * Merge the study into the pane above, if possible.
+ */
+ mergeUp(): void;
+ /**
+ * Merge the study into the pane below, if possible.
+ */
+ mergeDown(): void;
+ /**
+ * Unmerge the study into the pane above, if possible.
+ */
+ unmergeUp(): void;
+ /**
+ * Unmerge the study into the pane below, if possible.
+ */
+ 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(): void;
+ /**
+ * 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.
+ */
+export 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.
+ */
+export 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;
+}
+export interface ISymbolValueFormatter extends INumberFormatter {
+ /** Default formatter function used to assign the correct sign (+ or -) to a number */
+ format(price: number, options?: SymbolValueFormatterFormatOptions): string;
+ /**
+ * Formatter for a price change
+ * @param currentPrice - current price
+ * @param prevPrice - previous price
+ * @param options - format options
+ */
+ formatChange?(currentPrice: number, prevPrice: number, options?: SymbolValueFormatterFormatOptions): string;
+}
+/**
+ * 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
+ */
+export 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;
+ /** To set a new bar spacing */
+ setBarSpacing(newBarSpacing: number): void;
+ /** Returns the current 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;
+}
+export 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`.
+ */
+export 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;
+}
+export 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;
+}
+export interface IWatchedValueReadonly