akumidv / tradingview-assistant-chrome-extension

An assistant for backtesting trading strategies and checking (showing) external signals in Tradingview implemented as a Chrome browser extension.
GNU General Public License v3.0
159 stars 56 forks source link

ERROR MESSAGE: There is not timeframe element on page. Open correct page please. #105

Closed yukio1 closed 1 year ago

yukio1 commented 1 year ago

Hi guys,

Found a bug which may have to do with very recent changes on TV site structure.

Seems we now an issue when starting backtest ... this issue started about 15 minutes ago.

"There is not timeframe element on page. Open correct page please."

Thanks!

kypexin commented 1 year ago

Confirming this, just got the same error in between my tests. Some TV layout seems to be changed again.

g001613001 commented 1 year ago

The TradingView website may have updated their HTML structure, causing the selector to fail in finding the corresponding element. You can inspect the TradingView website's source code to see if you can find a new selector and replace it in the "content.js" file. For example, replace: const timeFrameElement = document.querySelector('.button-2ioYh_0P'); with: const timeFrameElement = document.querySelector('new_selector');

agentollie commented 1 year ago

Confirming this error also.

dayu998 commented 1 year ago

Confirming this error also.

dannydanny77 commented 1 year ago

The TradingView website may have updated their HTML structure, causing the selector to fail in finding the corresponding element. You can inspect the TradingView website's source code to see if you can find a new selector and replace it in the "content.js" file. For example, replace: const timeFrameElement = document.querySelector('.button-2ioYh_0P'); with: const timeFrameElement = document.querySelector('new_selector');

Thanks for the way of solution. Thou, I cannot find the content.js file in the code files. Possibly the solution is easy for an expert to spot and correct in a couple of lines, but difficult for people like me :)

stefantabakovq commented 1 year ago

For anyone not using timeframes, just simple backtest on 1 tf: edit tvChart.js as tvChart.getCurrentTimeFrame = async () => { }

This will remove TF functionality! Very quick stupid fix for now

dannydanny77 commented 1 year ago

For anyone not using timeframes, just simple backtest on 1 tf: edit tvChart.js as tvChart.getCurrentTimeFrame = async () => { }

This will remove TF functionality! Very quick stupid fix for now

image

Just edited the file, but still getting this error unfortunately.

dannydanny77 commented 1 year ago

edit tvChart.js as

Sorry about that... Now managed to do that you have specified. Apparently I deleted wrong lines :). Thanks for a quick solution

dayu998 commented 1 year ago

this line in selector.js file timeFrame: '#header-toolbar-intervals div[data-role^="button"]', change it like this timeFrame: '#header-toolbar-intervals > div',

Tried modifying but still getting error

dayu998 commented 1 year ago

@dayu998 what error did it give? I am currently using...

image image

dayu998 commented 1 year ago

@dayu998 what error did it give? I am currently using...

image

dannydanny77 commented 1 year ago

I am not an expert, or anything close to that and many respect to the ones who are of much help here. I just humbly wanted to check if you are making the changes in the files and after that - removing the addon from chrome, and installing it manually (and of course refreshing the chrome page thereafter) - ? That helped me, thus just wanted to mention in case you haven't... Cheers and thanks again to all helpers here...

dayu998 commented 1 year ago

As @dannydanny77 said, after making changes to the file you have to uninstall the plugin and reinstall it manually. @dayu998

I downloaded the latest version of the code, modified it and reinstalled it, but the problem is still unresolved. I suspect that there is still a problem with the modified code. Can you provide a modified code?

dayu998 commented 1 year ago

const SEL = { tvDialogSymbol: '#overlap-manager-root > div > div[data-outside-boundary-for="symbol-search-items-dialog"]', tvDialogIndicator: '#overlap-manager-root > div > div[data-outside-boundary-for="indicator-properties-dialog"]',

tvLegendIndicatorItem: 'div[data-name="legend"] div[class^="sourcesWrapper"] div[class^="sources"] div[data-name="legend-source-item"]',
tvLegendIndicatorItemTitle: 'div[data-name="legend-source-title"]',
tvDialogRoot: '#overlap-manager-root',
indicatorTitle: '#overlap-manager-root div[data-name="indicator-properties-dialog"] div[class^="title"]',
tabInput: 'div[data-name="indicator-properties-dialog"] div[data-value="inputs"]',
tabInputActive: 'div[data-name="indicator-properties-dialog"] div[class*="active"][data-value="inputs"]',
tabProperties: 'div[data-name="indicator-properties-dialog"] div[data-value="properties"]',
ticker: '#header-toolbar-symbol-search > div[class*="text-"]',
//timeFrame: '#header-toolbar-intervals div[data-role^="button"]',
timeFrame: '#header-toolbar-intervals > div',
timeFrameActive: '#header-toolbar-intervals div[data-role^="button"][class*="isActive"]',
indicatorScroll: 'div[data-name="indicator-properties-dialog"] div[class^="scrollable-"]',
indicatorProperty: 'div[data-name="indicator-properties-dialog"] div[class^="content-"] div[class^="cell-"]',
okBtn: 'div[data-name="indicator-properties-dialog"] div[class^="footer-"] button[name="submit"]',
cancelBtn: 'div[data-name="indicator-properties-dialog"] span[data-name="close"][data-role="button"]',
strategyTesterTab: '#footer-chart-panel div[data-name="backtesting"]',
strategyTesterTabActive: '#footer-chart-panel div[data-name="backtesting"][data-active="true"]',
strategyCaption: '#bottom-area div[class^="backtesting"]  [class^="strategyGroup"] div[data-strategy-title]',
strategyDialogParam: '#bottom-area div[class^="backtesting"]  [class^="strategyGroup"]  > div:nth-child(2) > button:nth-child(1)',
strategySummary: '#bottom-area div[class^="backtesting"] div[class^="tabSwitcher"] > button:nth-child(2)',
strategySummaryActive: '#bottom-area div[class^="backtesting"] div[class^="tabSwitcher"] > button[class*="activeTab"]:nth-child(2)',
strategyOverview: '#bottom-area div[class^="backtesting"] div[class^="tabSwitcher"] > button:nth-child(1)',
strategyOverviewActive: '#bottom-area div[class^="backtesting"] div[class^="tabSwitcher"] > button[class*="activeTab"]:nth-child(1)',
strategyReport: '#bottom-area div.backtesting-content-wrapper > div[class^="reportContainer"]',
strategyReportInProcess: '#bottom-area div.backtesting-content-wrapper > [role="progressbar"]',
// strategyReportIsTransition: '#bottom-area div.backtesting-content-wrapper > div.reports-content.opacity-transition',
strategyReportPanel: '#bottom-area .backtesting-content-wrapper',
strategyReportReady: '#bottom-area div.backtesting-content-wrapper > div[class^="reportContainer"]',
strategyReportGraph: '#bottom-area div.backtesting-content-wrapper div[class^="chartContainer"] table tr td:nth-child(2) canvas',
// strategyReportTransitionReady: '#bottom-area div.backtesting-content-wrapper > div:not(.opacity-transition).reports-content',
strategyReportError: '#bottom-area div.backtesting-content-wrapper > [class*=emptyStateIcon]',
strategyReportHeader: '#bottom-area div.backtesting-content-wrapper thead > tr > th',
strategyReportRow: '#bottom-area div.backtesting-content-wrapper tbody > tr',
strategyListOptions: 'div[role="listbox"] div[data-name="menu-inner"] div[role="option"] span[class^="label-"]',
strategyDefaultElement: '#study-defaults-manager',

strategyDeepTestCheckbox: '#bottom-area div[class^="backtesting"]  [class^="deepHistoryContainer"]  [class^="switcher"] input',
strategyDeepTestStartDate: '#bottom-area div[class^="backtesting"]  [class^="historyParams"]  [class^="container" ]> div:nth-child(1) div[class^="pickerInput"] input',
strategyDeepTestEndDate: '#bottom-area div[class^="backtesting"]  [class^="historyParams"]  [class^="container" ]> div:nth-child(3) div[class^="pickerInput"] input',
strategyDeepTestGenerateBtn: '#bottom-area div[class^="backtesting"]  [class^="historyParams"] button[class^="generateReportBtn"]',

strategyImportExport: '#daviddImportExport',

wlButton: '.widgetbar-tabs div[data-name="base"]',
alertBtn: '.widgetbar-tabs div[data-name="alerts"]',
widgetWatchList: '.widgetbar-pages .widgetbar-page:nth-child(1).active',
wlListEmpty: '.widgetbar-page.active .widgetbar-widget-watchlist .widgetbar-widgetbody div[class^="empty"]',
wlList: '.widgetbar-page.active .widgetbar-widget-watchlist .widgetbar-widgetbody div[class^="listContainer"]',
wlWrapItem: '.widgetbar-page.active .widgetbar-widget-watchlist .widgetbar-widgetbody div[class^="listContainer"] > div > div',
wlItem: 'div[class^="symbol"]',

chartTicker: '#header-toolbar-symbol-search',
chartSearch: 'div[data-name="symbol-search-items-dialog"] input',
chartSearchAll: 'div[data-name="symbol-search-items-dialog"] div[class^="bubbles"] > span:nth-child(1)',
chartSearchAllActive: 'div[data-name="symbol-search-items-dialog"] div[class^="bubbles"] > span:nth-child(1)[class*="active"]',
chartSearchItem: 'div[data-name="symbol-search-items-dialog"] div[class^="listContainer"] > div[class^="itemRow"]',
chartSearchExpand: 'div[class^="expandHandleWrap"] > span[class^="expandHandle"]',

chartTimeframeFavorite: '#header-toolbar-intervals div[data-role="button"][data-value]',
chartTimeframeActive: '#header-toolbar-intervals div[data-role="button"][data-value][class*="isActive"]',
chartTimeframeMenuOrSingle: '#header-toolbar-intervals div[data-role="button"][class^="menu"]',
chartTimeframeMenuItem: "#overlap-manager-root div[data-name=\"menu-inner\"] div[class^=\"dropdown\"] div[data-value]",
chartTimeframeMenuInput: "#overlap-manager-root div[data-name=\"menu-inner\"] div[class^=\"dropdown\"] div[class^=\"form\"] > input",
chartTimeframeMenuType: "#overlap-manager-root div[data-name=\"menu-inner\"] div[class^=\"dropdown\"] div[class^=\"form\"] > div[class^=\"menu\"]",
chartTimeframeMenuAdd: "#overlap-manager-root div[data-name=\"menu-inner\"] div[class^=\"dropdown\"] div[class^=\"form\"] > div[class^=\"add\"]",
chartTimeframeMenuTypeItems: "#overlap-manager-root div[data-name=\"menu-inner\"] > div[class^=\"item\"]",
chartTimeframeMenuTypeItemsMin: "#overlap-manager-root div[data-name=\"menu-inner\"] > div[class^=\"item\"]:nth-child(1)",
chartTimeframeMenuTypeItemsHours: "#overlap-manager-root div[data-name=\"menu-inner\"] > div[class^=\"item\"]:nth-child(2)",
chartTimeframeMenuTypeItemsDays: "#overlap-manager-root div[data-name=\"menu-inner\"] > div[class^=\"item\"]:nth-child(3)",
chartTimeframeMenuTypeItemsWeeks: "#overlap-manager-root div[data-name=\"menu-inner\"] > div[class^=\"item\"]:nth-child(4)",
chartTimeframeMenuTypeItemsMonth: "#overlap-manager-root div[data-name=\"menu-inner\"] > div[class^=\"item\"]:nth-child(5)",
chartTimeframeMenuTypeItemsRange: "#overlap-manager-root div[data-name=\"menu-inner\"] > div[class^=\"item\"]:nth-child(6)",

dialogCloseBtn: 'div[class^="dialog"] span[data-name="close"][data-role="button"]',

}

Thank you for your help, but after the code modification of the selector.js file is completed, it still does not work properly. Moreover, the latest version of the code I downloaded differs greatly from the code you provided. I don't want to trouble you any more. I will wait for the official update. Thank you again

epixia commented 1 year ago

Tried to use latest selector.js file.. not working for me either

MrDenfish commented 1 year ago

Ditto, tried the above suggestions and the fix dose not work for me. Apple Macbook, Chrome Version 111.0.5563.64 (Official Build) (x86_64) and of coarse TV assistant 2.2.

MrDenfish commented 1 year ago

...its actually creating errors Screen Shot 2023-03-23 at 12 10 16 PM My Selector.js Screen Shot 2023-03-23 at 12 17 45 PM

Camilo-Mora commented 1 year ago

Has anyone found a solution to this problem?

Camilo-Mora commented 1 year ago

tvChart.getCurrentTimeFrame = async () => { }

For anyone not using timeframes, just simple backtest on 1 tf: edit tvChart.js as tvChart.getCurrentTimeFrame = async () => { }

This will remove TF functionality! Very quick stupid fix for now

This does it.

akumidv commented 1 year ago

Fixed in version v2.3. It is possible to install version from repositry or it should update automatically in browser after review in google webstore.

akumidv commented 1 year ago

strategyDeepTestGenerateBtn: '#bottom-area div[class^="backtesting"] [class^="historyParams"] button[class^="generateReportBtn"]',

strategyImportExport: '#daviddImportExport',

Thank you for your help, but after the code modification of the selector.js file is completed, it still does not work properly. Moreover, the latest version of the code I downloaded differs greatly from the code you provided. I don't want to trouble you any more. I will wait for the official update. Thank you again

It wouldn't work because this file from another extension with different selectors names.