| | <!DOCTYPE html> |
| | <html lang="en"> |
| | <head> |
| | <meta charset="UTF-8"> |
| | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| | <title>TradingView Chart</title> |
| | <style> |
| | body, html { |
| | margin: 0; |
| | padding: 0; |
| | width: 100%; |
| | height: 100%; |
| | overflow: hidden; |
| | } |
| | #tradingview_widget_container { |
| | width: 100%; |
| | height: 100vh; |
| | } |
| | </style> |
| | </head> |
| | <body> |
| | <div id="tradingview_widget_container"></div> |
| |
|
| | <script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script> |
| | <script type="text/javascript"> |
| | |
| | const urlParams = new URLSearchParams(window.location.search); |
| | |
| | const symbol = urlParams.get('symbol') || 'BTCUSDT'; |
| | |
| | |
| | let interval = urlParams.get('interval') || '1D'; |
| | |
| | |
| | const intervalMap = { |
| | '1m': '1', |
| | '3m': '3', |
| | '5m': '5', |
| | '5min': '5', |
| | '15m': '15', |
| | '15min': '15', |
| | '30m': '30', |
| | '30min': '30', |
| | '1h': '60', |
| | '2h': '120', |
| | '4h': '240', |
| | '1d': 'D', |
| | '1D': 'D', |
| | 'D': 'D', |
| | '1W': 'W', |
| | 'W': 'W', |
| | '1M': 'M', |
| | 'M': 'M' |
| | }; |
| | |
| | |
| | interval = intervalMap[interval] || interval; |
| | |
| | |
| | const exchange = urlParams.get('exchange') || 'BINANCE'; |
| | |
| | const fullSymbol = exchange + ":" + symbol; |
| | |
| | |
| | new TradingView.widget({ |
| | "autosize": true, |
| | "symbol": fullSymbol, |
| | "interval": interval, |
| | "timezone": "Etc/UTC", |
| | "theme": "dark", |
| | "style": "1", |
| | "locale": "en", |
| | "toolbar_bg": "#f1f3f6", |
| | "enable_publishing": false, |
| | "hide_top_toolbar": false, |
| | "hide_legend": false, |
| | "save_image": false, |
| | "hide_volume": false, |
| | "container_id": "tradingview_widget_container", |
| | "studies": [ |
| | "PUB;ae9bc503c1604345bb8b6968d92f466c", |
| | "PUB;2835" , |
| | |
| | |
| | ] |
| | }); |
| | </script> |
| | </body> |
| | </html> |