Repository navigation
Breaking Changes
We do our best to make every next version fully compatible with the previous one, but sometimes big changes requires you to make minor changes in your code when upgrading to a new version.
Note: you can check the Charting Library version by executing TradingView.version() in a browser console.
Here is the list of breaking changes:
- Featureset
show_logo_on_all_chartshas been removed. - Action
magnetActionfrom executeActionById and getCheckableActionState methods is removed. Use magnetEnabled instead. -
callbackargument of createStudy has been removed. -
createStudy returns Promise instead of
entityId. -
Pane-Api method
getLeftPriceScaleis removed and replaced withgetLeftPriceScalesthat returns an array of scales instead a single element. -
Pane-Api method
getRightPriceScaleis removed and replaced withgetRightPriceScalesthat returns an array of scales instead a single element.
Trading Terminal
We've changed the broker's interaction flow. Please read the following carefully to understand what changes should be made in your code to switch to the new version.
Till now the Trading Terminal called broker adapter's methods (e.g. placeOrder, modifyOrder) when user clicked on Buy/Sell/Modify buttons. When calling these methods the Trading Terminal passed a silently argument. When silently was set to true, the broker adapter could send an order without showing the dialog. When it was set to false, the broker adapter had to invoke a method from the host to show the order ticket (or the Edit Position dialog).
Starting from 1.15 the Trading Terminal shows all dialogs by itself and invokes broker adapter's methods to send an order or a position to the broker's server. The reason for this change is that we've added an order panel that can be used to place an order at any time.
If you use your own order dialog then you still need to make changes in your broker adapter's methods, but additionally you need to use metainfo to pass the dialog constructor to the Trading Terminal.
-
Argument
silentlywas removed fromplaceOrder,modifyOrder,reversePosition,closePosition,closeTrade,cancelOrder,cancelOrdersmethods of the Broker API. -
Arguments
handlerandoptionswere removed fromshowOrderDailogmethod of the Trading Host. -
Argument
handlerwas removed fromshowPositionBracketsDailogmethod of the Trading Host. -
supportCustomPlaceOrderTradableCheckflag is no longer supported. -
Override
symbolWatermarkPropertiesis not supported anymore. You can use settings_adapter withsymbolWatermarkkey.
-
createButton returns
HTMLElementinstead ofJQuery. -
createButton must be used after headerReady()
Promiseis resolved. -
getVisibleRange returns
{from, to}in the UTC timezone (it was a timezone selected on a chart before). - Method
onreadywas removed. You can usewindow.addEventListener('DOMContentLoaded', callback, false)instead. -
saveAsSnapshotparameter was removed from saveChartToServer -
indicators_file_nameconstructor option was removed. Use custom_indicators_getter instead. We made this change to speed up the loading of the library and get rid of possible vulnerabilities that may occur when loading a file. You just need to move the code of your custom indicators from the JS file to the widget constructor, wrapping them in a function and a Promise
TypeScript type definitions
-
StudyInputValueTypetype is renamed toStudyInputValue.
Featureset
- Starting from this version you are no longer able to use the
keep_left_toolbar_visible_on_small_screensfeatureset. This featureset is removed and the left toolbar visibility no longer depends on the screen size.
- Action
takeScreenshotfrom executeActionById method is removed. Use takeScreenshot method instead. - Action
lockDrawingsActionfrom executeActionById and getCheckableActionState methods is removed. Use lockAllDrawingTools instead. - Action
hideAllDrawingsActionfrom executeActionById and getCheckableActionState methods is removed. Use hideAllDrawingTools instead. - Featureset
caption_buttons_text_if_possibleis enabled by default. - Fixed an issue that was causing bars to shift. Time-shifted bars used to appear when daily bars had a negative exchange timezone offset along with a 24x7 session. If you have a workaround for this issue, please remove it before updating to this version.
Charting Library
-
charting_library/charting_library.min.jsis now UMD module.If you only inline this script into HTML then nothing has changed for you. If you import it as a module you should import
widget,versionandonreadyfunctions directly from it. -
searchSymbolsByNameis removed fromJS-API, usesearchSymbolsinstead.
Study overrides:
- Overrides for
Overlayshould be applied only viastudies_overrides(andapplyStudiesOverridesin runtime). In the previous versions you had to useoverridesandapplyOverrides). See Studies-Overrides page. - Starting from this version you are no longer able to override
showStudyArgumentsandshowLastValueusingoptionskeyword.
Trading Terminal
-
hasHistoryflag is removed. UsehistoryColumnsto display History in the Account Manager.
The following items are still supported in the Trading Terminal, but will be deprecated in future versions:
-
subscribePLandunsubscribePL. The broker should callplUpdatemethod of the Host every time the profit is changed. -
supportDOMis removed. DOM widget visibility can be set usingdome_widgetfeatureset.
The Trading Controller is replaced with Broker API.
The following changes should be applied to your Trading Controller implementation to move to new Broker API:
- Method
setHostis removed. Host should be passed to the constructor of Broker API. - Method
buttonDropdownItemsis removed. Broker API should update Broker API usingsetButtonDropdownActions. - Methods
configFlagsanddurationsare removed. Use Widget Constructor fields instead. - All methods that returned
$.Deferredshould be modified to return Promise. - Method
chartContextMenuItemsis renamed tochartContextMenuActions. - Method
isTradablechanged to return a Promise instead of a Boolean value. - All string constants ("working", "buy" etc.) should be replaced with the appropriate number of constants.
- Position
avg_pricerenamed toavgPrice. -
tradingControllerfield in the Widget Constructor is removed. UsebrokerFactoryinstead.
Trading Terminal
The following items are still supported in Trading Terminal, but will be deprecated in future versions:
-
supportDOMErenamed tosupportDOM. - The signature of `showClosePositionDialog has been changed.
-
showEditBracketsDialogwas renamed toshowPositionBracketsDialog.The signature has been changed.
-
Default behavior of Volume indicator was changed.
Previous behavior: Volume indicator is added/removed when an instrument or a resolution is switched depending on volume support by the instrument. You can get back to this behavior by disabling
create_volume_indicator_by_default_oncefeatureset.New behavior: Volume indicator is added when an empty chart is loaded for the first time provided that it is supported by an active instrument.
- We don't compile Pine scripts anymore. You can still use scripts that were compiled earlier.
- The chart can no longer show active orders only. Appropriate methods have been removed.
-
showOrderDialogreceives an object instead of arguments list -
showSampleOrderDialogremoved, use showOrderDialog instead -
showOrderDialogremoved from Broker API, useplaceOrderandmodifyOrderreceivesilentlyargument instead -
reversePosition,closePosition,cancelOrderhave an additional argumentsilently.
- Starting from this version calling
setSymbolwith the same symbol is no longer enough. You should callonResetCacheNeededCallbackfromsubscribeBarsfirst. Then you can usesetSymbolor newresetDatamethod of the chart. - JSAPI protocol version 1 is not supported anymore.
nextTimeandnoDatamust be provided.
-
Added
sourceargument to MACD. You should change MACD creation code to passsourcealso.chartWidget.chart().createStudy('MACD', false, false, [12, 26, "close", 9])
-
Override
transparencyis not supported anymore. We added transparency support to every color. Usergbaform to define a color with transparency. Example:"symbolWatermarkProperties.color" : "rgba(60, 70, 80, 0.05)"
-
Override
paneProperties.gridProperties.*is not supported anymore.Please use
paneProperties.vertGridProperties.*andpaneProperties.horzGridProperties.* -
Override
mainSeriesProperties.candleStyle.wickColoris not supported anymore.Use
mainSeriesProperties.candleStyle.wickUpColorandmainSeriesProperties.candleStyle.wickDownColor
- What is Charting Library
- Getting Started
- Data Binding
- Chart Customization
- Customization Overview
- Client-Side Customization
- Server-Side Customization
- Customization Use Cases
- Trading Terminal
- Saving/Loading Charts
- Creating Custom Studies
- Breaking changes in versions