Skip to content

Instantly share code, notes, and snippets.

@cosminonea
Last active March 1, 2019 08:08
Show Gist options
  • Save cosminonea/f4e3571b6276f3197918f45306a35773 to your computer and use it in GitHub Desktop.
Save cosminonea/f4e3571b6276f3197918f45306a35773 to your computer and use it in GitHub Desktop.
<html>
<head>
<meta charset="UTF-8" />
<title>Options</title>
<script
type="text/javascript"
src="https://s3.tradingview.com/tv.js"
></script>
<style>
body,
html {
padding: 0;
margin: 0;
font-family: "fontawesome", Calibri, Arial, sans-serif;
color: #666;
background: #111;
min-height: 800px;
}
/* Reset */
*,
*:after,
*:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
a {
color: #ccc;
text-decoration: none;
}
a:hover {
color: #fff;
}
.pair {
position: fixed;
float: left;
left: 0px;
color: #fd0;
font-weight: 800;
font-size: 20px;
line-height: 1em;
background: rgba(0, 0, 0, 0.8);
z-index: 999;
}
/* GRID LAYOUT */
.grid {
width: 100%;
z-index: 100;
}
.module {
color: #666;
background-color: #222;
float: left;
width: 33.22%;
height: 33.22vh;
}
.module2 {
color: #666;
background-color: #222;
float: left;
width: 50%;
height: 50vh;
}
.symbol {
display: none;
position: fixed;
float: left;
background: rgba(0, 0, 0, 1);
z-index: 1000;
}
</style>
</head>
<body>
<div class="container">
<div class="grid" id="container-grid">
</div>
</div>
<script>
var symbols = ["SP:SPX", "VXXB", "CAT", "DG", "EEM", "FDX", "NKE", "ORCL", "NBEV"];
function createChart(symbol, index) {
var panel = document.createElement('div');
panel.className = 'module';
panel.setAttribute('id', 'module-' + index);
var container = document.getElementById("container-grid");
container.appendChild(panel);
new TradingView.widget({
container_id: 'module-' + index,
autosize: true,
symbol: symbol,
interval: "1440",
timezone: "Etc/UTC",
theme: "Light",
style: "1",
locale: "en",
toolbar_bg: "rgba(0, 0, 0, 1)",
enable_publishing: false,
hide_top_toolbar: true,
allow_symbol_change: true,
save_image: false,
hideideas: true
});
}
symbols.map(createChart);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment