Breaking Changes - kroim/charting-library-wiki GitHub Wiki
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:
Version 18
Trading Terminal
-
accountsListandaccounthave been removed from Account Manager Info. They have been replaced with methodscurrentAccount,setCurrentAccountandaccountsMetainfoin broker's API. -
Method
fullUpdatein the Trading Host has been renamed tocurrentAccountUpdate. -
Method
showClosePositionDialoghas been removed. -
Trading Host method
floatingTradingPanelVisibilityhas been renamed tosellBuyButtonsVisibility. -
Trading Host
defaultDropdownMenuActionsoptions have been changed. OptionshowFloatingToolbarhas been renamed toshowSellBuyButtons. -
Method setPoints now behaves the same way as createMultipointShape for all tools. Previously it could change some other properties like width instead on moving points to their new places.
Version 17
- The orders response has been split into orders and ordersHistory.
- Widget Method
setLanguage(locale)has been removed. - The argument of
onIntervalChangedevent have been modified: type oftimeframefield has been changed to TimeFrameValue. - Featureset
same_data_requeryhas been removed, please use resetData() method to refresh the data. charting_library/charting_library.min.jsandcharting_library/charting_library.min.d.tsfiles have been renamed tocharting_library/charting_library.jsandcharting_library/charting_library.d.tsaccordingly.- The Chart Method removeEntity now can be undone by the user by default. To disable this, please use
disableUndofield in the new argumentoptions.
Trading Terminal
- Flag
supportBottomWidgethas been removed from Broker ConfigurationconfigFlagsobject. To remove the Account Manager thetrading_account_managerfeatureset should be used.
Version 16 (changed versioning)
-
Action
tmzPropertiesfrom executeActionById and getCheckableActionState methods is removed. -
Chart method
createStudyoptions forpriceScalehave been changed.leftandrighthave been renamed tonew-leftandnew-right. -
Series API method
moveToOtherSourceScalehas been renamed tochangePriceScale. New argument options are added:new-left,new-right,no-scale. -
Study API method
changePriceScaleargument options have been changed.leftandrighthave been renamed tonew-leftandnew-right. New argument optionentityIdhas been added, it pins the study to the same price axis as a study with a correspondingentityId. -
Method
applyOverridesof ChartWidget is disabled for "mainSeriesProperties.priceAxisProperties.*". -
Creating a study using
createStudyof ChartWidgetApi can be undone by the user from now. You can disable it usingdisableUndoinoptions.
Version 1.15
- Featureset
show_logo_on_all_chartshas been removed. - Featureset
cl_feed_return_all_datahas 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. - setVisibleRange method now returns a Promise object and don't accept a callback as the last argument.
- Priority of the symbol option has been made higher than the priority of the symbol from the saved_data option. Do not assign a value to the symbol option, if you don't want to override the symbol from saved_data.
- Override
symbolWatermarkPropertiesis not supported anymore. You can use settings_adapter withsymbolWatermarkkey. 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
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. -
We pass the parent order to
modifyOrderif it exists. If child order’s details are required while modifying the order you can get back this behavior by enablingalways_pass_called_order_to_modifyfeatureset.
Version 1.14
- 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
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.
Version 1.13
- 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.
Version 1.12
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.
Version 1.11
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.
Version 1.10
-
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.
Version 1.9
- We don't compile Pine scripts anymore. You can still use scripts that were compiled earlier.
Version 1.8 of Trading Terminal
- The chart can no longer show active orders only. Appropriate methods have been removed.
showOrderDialogreceives an object instead of arguments listshowSampleOrderDialogremoved, use showOrderDialog insteadshowOrderDialogremoved from Broker API, useplaceOrderandmodifyOrderreceivesilentlyargument insteadreversePosition,closePosition,cancelOrderhave an additional argumentsilently.
Version 1.7
- 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.
Version 1.5
-
Added
sourceargument to MACD. You should change MACD creation code to passsourcealso.chartWidget.chart().createStudy('MACD', false, false, [12, 26, "close", 9])
Version 1.4
-
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)"
Version 1.3
-
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