tradingview / charting-library-examples

Examples of Charting Library integrations with other libraries, frameworks and data transports
MIT License
1.32k stars 744 forks source link

switch Symbol without searchSymbols not fetch data #377

Open keene2 opened 1 month ago

keene2 commented 1 month ago

I'm encountering an issue where if I switch symbols through 'setSymbol' in the following order - tokenA -> setSymbol(tokenB) -> setSymbol(tokenA), the getBars method doesn't get called when switching back to tokenA.

Here are the steps to reproduce:

I observed that when switching back to tokenA, getBars was not triggered.

This behavior is causing an issue because I expect the chart to fetch the latest data for tokenA by calling getBars when it is set as the active symbol through setSymbol.

I am wondering if this is the expected behavior, or if there is a mechanism I need to implement to ensure that getBars gets called to fetch up-to-date data upon switching back to previously viewed symbols.

Please note, in our implementation, we are not utilizing the searchSymbols function to switch symbols, we directly use setSymbol.