-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
50 lines (46 loc) · 1.13 KB
/
index.html
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
<html>
<head>
<script type="text/javascript" src="tv.js"></script>
<script src="exchangeInfo.js"></script>
</head>
<body>
<select onChange="LoadCharts();" id="pairs">
<!-- <option value="BTCUSDT">BTCUSDT</option>
<option value="ETHUSDT">ETHUSDT</option>-->
</select>
<br>
<div class="tradingview-widget-container" id="tvchart"></div>
</body>
<script>
//PASS ALL THE SYMBOLS
var sym = exchangeInfo.symbols,markup='';
sym.forEach(d => {
markup += '<option value="' + d.symbol + '">' + d.symbol + '</option>';
});
document.getElementById('pairs').innerHTML = markup;
LoadCharts();
function LoadCharts(){
let symbol = document.getElementById('pairs').value;
//RENDER CHART
new TradingView.widget(
{
"autosize": true,
"symbol": "BINANCE:" + symbol,
"interval": "5",
"timezone": "Asia/Kolkata",
"theme": "Dark",
"style": "1",
"locale": "in",
"toolbar_bg": "#f1f3f6",
"enable_publishing": false,
"allow_symbol_change": true,
"studies": [
"AwesomeOscillator@tv-basicstudies",
"MACD@tv-basicstudies",
"RSI@tv-basicstudies"
],
"container_id": "tvchart"
});
}
</script>
</html>