File size: 3,064 Bytes
62a69ad
 
 
feebc2e
6da6219
962abd5
6da6219
 
 
 
 
feebc2e
6da6219
 
 
 
 
 
 
 
62a69ad
 
6da6219
62a69ad
6da6219
 
962abd5
 
 
 
 
 
b49dda0
962abd5
6da6219
feebc2e
6da6219
 
 
 
 
 
 
 
962abd5
6da6219
62a69ad
962abd5
6da6219
b7c740d
6da6219
62a69ad
962abd5
6da6219
feebc2e
 
962abd5
 
 
feebc2e
962abd5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6da6219
 
 
62a69ad
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>ADX Fullscreen Only</title>
  <style>
    html, body {
      margin: 0;
      padding: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: #000;
    }
    #tv_container {
      width: 100%;
      height: 100vh;
    }
  </style>
</head>
<body>
  <div id="tv_container"></div>

  <script src="https://s3.tradingview.com/tv.js"></script>
  <script>
    // Defaults (can pass ?exchange=BINANCE&symbol=BTCUSDT&interval=1D)
    const p = new URLSearchParams(location.search);
    const exchange = p.get('exchange') || 'BINANCE';
    const symbol = p.get('symbol') || 'BTCUSDT';
    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' };
    const interval = imap[(p.get('interval') || '1D').toUpperCase()] || (p.get('interval') || 'D');

    const widget = new TradingView.widget({
      autosize: true,
      symbol: `${exchange}:${symbol}`,
      interval: interval,
      timezone: "Etc/UTC",
      theme: "dark",
      style: "1",
      locale: "en",
      hide_top_toolbar: true,
      hide_legend: false,
      hide_volume: true,
      enable_publishing: false,
      container_id: "tv_container",

      // Only ADX study
      studies: [
        "STD;Auto%1Fib%1Retracement%1"
      ],

      // Hide main price series and collapse its pane
      overrides: {
        "mainSeriesProperties.visible": false,
        "paneProperties.background": "#000000",
        "paneProperties.legendProperties.showStudyArguments": false,
        "paneProperties.legendProperties.showStudyTitles": true,
        "scalesProperties.lineColor": "rgba(255,255,255,0.2)",
        "paneProperties.vertGridProperties.color": "rgba(255,255,255,0.06)",
        "paneProperties.horzGridProperties.color": "rgba(255,255,255,0.06)",

        // Collapse the main (price) pane to zero height
        "paneProperties.separatorRelatedProperties.style": 0,
        "paneProperties.topMargin": 0,
        "paneProperties.bottomMargin": 0,
        "mainSeriesProperties.statusViewStyle.showInterval": false,
        "mainSeriesProperties.statusViewStyle.showSymbol": false
      }
    });

    // After the widget is ready, force-collapse the main pane so only the ADX pane remains visible.
    widget.onChartReady(() => {
      const chart = widget.activeChart();
      // Remove all drawings/indicators from main pane if any stray
      // Ensure main pane height is 0 and indicator pane takes all space
      try {
        const panes = chart.getPanes();
        // panes[0] is main price pane, panes[1] is ADX pane
        if (panes.length > 1) {
          chart.setPaneHeight(panes[0].id, 0);      // collapse main pane
          chart.setPaneHeight(panes[1].id, 1000);   // give ADX all the space
        }
      } catch (e) {
        // Silently ignore if API differs
      }
    });
  </script>
</body>
</html>