tradingview widget code help

Hello! How can I change ‘symbol’ information to a variable from my app? I tried this way, but didn’t work. code:

` f"""<!-- TradingView Widget BEGIN --> 
<div class="tradingview-widget-container" style="height:100%;width:100%">
 <div id="tradingview_e7cdd" style="height:calc(100% - 32px);width:100%">
</div> <div class="tradingview-widget-copyright">
<a href="https://www.tradingview.com/" rel="noopener nofollow" target="_blank">
<span class="blue-text">Track all markets on TradingView</span>
</a></div> <script type="text/javascript" src="[https://s3.tradingview.com/tv.js">](https://s3.tradingview.com/tv.js%22%3E)</script>
 <script type="text/javascript"> new TradingView.widget( { 
"autosize": false,
 "symbol": {stock},
 "interval": "D", 
"timezone": "Etc/UTC", 
"theme": "dark", 
"style": "1", 
"locale": "en", 
"enable_publishing": false, 
"allow_symbol_change": true, 
"container_id": "tradingview_e7cdd"
 } ); </script>
 </div> <!-- TradingView Widget END -->"""`
1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.