CORVO-AI commited on
Commit
62a69ad
·
verified ·
1 Parent(s): 54b64d4

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +63 -19
index.html CHANGED
@@ -1,19 +1,63 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>TradingView Chart</title>
7
+ <style>
8
+ body, html {
9
+ margin: 0;
10
+ padding: 0;
11
+ width: 100%;
12
+ height: 100%;
13
+ overflow: hidden;
14
+ }
15
+ #tradingview_widget_container {
16
+ width: 100%;
17
+ height: 100vh;
18
+ }
19
+ </style>
20
+ </head>
21
+ <body>
22
+ <div id="tradingview_widget_container"></div>
23
+
24
+ <script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
25
+ <script type="text/javascript">
26
+ // Parse URL parameters
27
+ const urlParams = new URLSearchParams(window.location.search);
28
+
29
+ // Get symbol from URL or default to BTCUSDT
30
+ const symbol = urlParams.get('symbol') || 'BTCUSDT';
31
+
32
+ // Get timeframe from URL or default to 1D
33
+ const interval = urlParams.get('interval') || '1D';
34
+
35
+ // Get exchange from URL or default to BINANCE
36
+ const exchange = urlParams.get('exchange') || 'BINANCE';
37
+
38
+ // Create the full symbol string
39
+ const fullSymbol = exchange + ":" + symbol;
40
+
41
+ // Initialize TradingView widget
42
+ new TradingView.widget({
43
+ "autosize": true,
44
+ "symbol": fullSymbol,
45
+ "interval": interval,
46
+ "timezone": "Etc/UTC",
47
+ "theme": "dark",
48
+ "style": "1",
49
+ "locale": "en",
50
+ "toolbar_bg": "#f1f3f6",
51
+ "enable_publishing": false,
52
+ "hide_top_toolbar": false,
53
+ "hide_legend": false,
54
+ "save_image": false,
55
+ "container_id": "tradingview_widget_container",
56
+ "studies": [
57
+ "RSI@tv-basicstudies",
58
+ "MASimple@tv-basicstudies"
59
+ ]
60
+ });
61
+ </script>
62
+ </body>
63
+ </html>