CORVO-AI commited on
Commit
962abd5
·
verified ·
1 Parent(s): feebc2e

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +40 -17
index.html CHANGED
@@ -3,7 +3,7 @@
3
  <head>
4
  <meta charset="UTF-8"/>
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6
- <title>ADX Only</title>
7
  <style>
8
  html, body {
9
  margin: 0;
@@ -24,18 +24,14 @@
24
 
25
  <script src="https://s3.tradingview.com/tv.js"></script>
26
  <script>
27
- // You can change these defaults or pass via URL (?exchange=BINANCE&symbol=BTCUSDT&interval=1D)
28
- const url = new URLSearchParams(location.search);
29
- const exchange = url.get('exchange') || 'BINANCE';
30
- const symbol = url.get('symbol') || 'BTCUSDT';
31
- const intervalParam = (url.get('interval') || '1D').toUpperCase();
32
- const intervalMap = {
33
- '1M':'1','3M':'3','5M':'5','15M':'15','30M':'30',
34
- '1H':'60','2H':'120','4H':'240','1D':'D','D':'D','1W':'W','W':'W','1MO':'M','M':'M'
35
- };
36
- const interval = intervalMap[intervalParam] || intervalParam;
37
 
38
- new TradingView.widget({
39
  autosize: true,
40
  symbol: `${exchange}:${symbol}`,
41
  interval: interval,
@@ -43,23 +39,50 @@
43
  theme: "dark",
44
  style: "1",
45
  locale: "en",
46
- enable_publishing: false,
47
  hide_top_toolbar: true,
48
  hide_legend: false,
49
- save_image: false,
50
  hide_volume: true,
 
51
  container_id: "tv_container",
52
 
 
53
  studies: [
54
- "PUB;p28oOtSBJQa8LJd6b1ytDsu8OUkNbzA1" // ADX
55
  ],
56
 
57
- // Make the main price series invisible so only the ADX pane shows
58
  overrides: {
59
  "mainSeriesProperties.visible": false,
60
  "paneProperties.background": "#000000",
 
 
 
61
  "paneProperties.vertGridProperties.color": "rgba(255,255,255,0.06)",
62
- "paneProperties.horzGridProperties.color": "rgba(255,255,255,0.06)"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  }
64
  });
65
  </script>
 
3
  <head>
4
  <meta charset="UTF-8"/>
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6
+ <title>ADX Fullscreen Only</title>
7
  <style>
8
  html, body {
9
  margin: 0;
 
24
 
25
  <script src="https://s3.tradingview.com/tv.js"></script>
26
  <script>
27
+ // Defaults (can pass ?exchange=BINANCE&symbol=BTCUSDT&interval=1D)
28
+ const p = new URLSearchParams(location.search);
29
+ const exchange = p.get('exchange') || 'BINANCE';
30
+ const symbol = p.get('symbol') || 'BTCUSDT';
31
+ const imap = { '1M':'1','3M':'3','5M':'5','15M':'15','30M':'30','1H':'60','2H':'120','4H':'240','1D':'D','D':'D','1W':'W','W':'W','1MO':'M','M':'M' };
32
+ const interval = imap[(p.get('interval') || '1D').toUpperCase()] || (p.get('interval') || 'D');
 
 
 
 
33
 
34
+ const widget = new TradingView.widget({
35
  autosize: true,
36
  symbol: `${exchange}:${symbol}`,
37
  interval: interval,
 
39
  theme: "dark",
40
  style: "1",
41
  locale: "en",
 
42
  hide_top_toolbar: true,
43
  hide_legend: false,
 
44
  hide_volume: true,
45
+ enable_publishing: false,
46
  container_id: "tv_container",
47
 
48
+ // Only ADX study
49
  studies: [
50
+ "PUB;p28oOtSBJQa8LJd6b1ytDsu8OUkNbzA1"
51
  ],
52
 
53
+ // Hide main price series and collapse its pane
54
  overrides: {
55
  "mainSeriesProperties.visible": false,
56
  "paneProperties.background": "#000000",
57
+ "paneProperties.legendProperties.showStudyArguments": false,
58
+ "paneProperties.legendProperties.showStudyTitles": true,
59
+ "scalesProperties.lineColor": "rgba(255,255,255,0.2)",
60
  "paneProperties.vertGridProperties.color": "rgba(255,255,255,0.06)",
61
+ "paneProperties.horzGridProperties.color": "rgba(255,255,255,0.06)",
62
+
63
+ // Collapse the main (price) pane to zero height
64
+ "paneProperties.separatorRelatedProperties.style": 0,
65
+ "paneProperties.topMargin": 0,
66
+ "paneProperties.bottomMargin": 0,
67
+ "mainSeriesProperties.statusViewStyle.showInterval": false,
68
+ "mainSeriesProperties.statusViewStyle.showSymbol": false
69
+ }
70
+ });
71
+
72
+ // After the widget is ready, force-collapse the main pane so only the ADX pane remains visible.
73
+ widget.onChartReady(() => {
74
+ const chart = widget.activeChart();
75
+ // Remove all drawings/indicators from main pane if any stray
76
+ // Ensure main pane height is 0 and indicator pane takes all space
77
+ try {
78
+ const panes = chart.getPanes();
79
+ // panes[0] is main price pane, panes[1] is ADX pane
80
+ if (panes.length > 1) {
81
+ chart.setPaneHeight(panes[0].id, 0); // collapse main pane
82
+ chart.setPaneHeight(panes[1].id, 1000); // give ADX all the space
83
+ }
84
+ } catch (e) {
85
+ // Silently ignore if API differs
86
  }
87
  });
88
  </script>